Skip to content

Commit

Permalink
Merge pull request #245 from clue-labs/update-mysql
Browse files Browse the repository at this point in the history
Update documentation for reactphp/mysql v0.6.0
  • Loading branch information
SimonFrings authored Dec 11, 2023
2 parents 3a48d46 + 8faa289 commit 0dc1473
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/async/coroutines.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Let's take a look at the most basic coroutine usage by using an

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -59,7 +59,7 @@ shown in a simple example:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down
2 changes: 1 addition & 1 deletion docs/async/fibers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use function React\Async\await;

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down
4 changes: 2 additions & 2 deletions docs/async/promises.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Let's take a look at the most basic promise usage by using an

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -58,7 +58,7 @@ order to "await" its fulfillment value. This is best shown in a simple example:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down
2 changes: 1 addition & 1 deletion docs/best-practices/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ all uppercase in any factory function like this:
$container = new FrameworkX\Container([
React\MySQL\ConnectionInterface::class => function (string $DB_HOST = 'localhost', string $DB_USER = 'root', string $DB_PASS = '', string $DB_NAME = 'acme') {
// connect to database defined in optional $DB_* environment variables
$uri = 'mysql://' . $DB_USER . ':' . rawurlencode($DB_PASS) . '@' . $DB_HOST . '/' . $DB_NAME . '?idle=0.001';
$uri = 'mysql://' . $DB_USER . ':' . rawurlencode($DB_PASS) . '@' . $DB_HOST . '/' . $DB_NAME;
return (new React\MySQL\Factory())->createLazyConnection($uri);
}
]);
Expand Down
16 changes: 8 additions & 8 deletions docs/integrations/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Let's take a look at the most basic async database integration possible with X:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -44,7 +44,7 @@ Let's take a look at the most basic async database integration possible with X:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -72,7 +72,7 @@ Let's take a look at the most basic async database integration possible with X:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -214,7 +214,7 @@ from a [route placeholder](../api/app.md#routing) like this:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -252,7 +252,7 @@ from a [route placeholder](../api/app.md#routing) like this:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -290,7 +290,7 @@ from a [route placeholder](../api/app.md#routing) like this:

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);

$app = new FrameworkX\App();
Expand Down Expand Up @@ -371,7 +371,7 @@ controller and uses dependency injection (DI) or a

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

$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
$db = (new React\MySQL\Factory())->createLazyConnection($credentials);
$repository = new Acme\Todo\BookRepository($db);

Expand All @@ -394,7 +394,7 @@ controller and uses dependency injection (DI) or a

$container = new FrameworkX\Container([
React\MySQL\ConnectionInterface::class => function () {
$credentials = 'alice:secret@localhost/bookstore?idle=0.001';
$credentials = 'alice:secret@localhost/bookstore';
return (new React\MySQL\Factory())->createLazyConnection($credentials);
}
]);
Expand Down

0 comments on commit 0dc1473

Please sign in to comment.