Skip to content

Commit

Permalink
PHP/AMPHP: Update to amphp/amp v3 by switching to Revolt\EventLoop
Browse files Browse the repository at this point in the history
After updating to `amphp/postgres 2`, amphp/php v3 became obligatory,
so these updates were needed.
  • Loading branch information
amotl committed Jun 19, 2024
1 parent 6238987 commit fddb6fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions by-language/php-amphp/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

require __DIR__ . '/vendor/autoload.php';

use Amp\Loop;
use Amp\Postgres;
use Revolt\EventLoop;


function print_header($title)
Expand Down Expand Up @@ -58,7 +58,7 @@ function show_all_settings()

print_header("Display all settings using `SHOW ALL`");

Loop::run(function () {
EventLoop::run(function () {

// Connect to CrateDB's PostgreSQL interface.
$config = Postgres\ConnectionConfig::fromString($this->dsn);
Expand All @@ -85,7 +85,7 @@ function ddl_dml_dql()

print_header("Run DDL, DML, and DQL statements subsequently");

Loop::run(function () {
EventLoop::run(function () {

// Connect to CrateDB's PostgreSQL interface.
$config = Postgres\ConnectionConfig::fromString($this->dsn);
Expand Down Expand Up @@ -132,7 +132,7 @@ function use_pool()

print_header("Using a connection pool");

Loop::run(function () {
EventLoop::run(function () {

// Connect to CrateDB's PostgreSQL interface, using a connection pool.
$config = Postgres\ConnectionConfig::fromString($this->dsn);
Expand Down

0 comments on commit fddb6fe

Please sign in to comment.