-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
27 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
/* | ||
* This file is not in VCS - create it if you want to set | ||
* the DB credentials without having them commited to VCS. | ||
*/ | ||
@include_once __DIR__ . "/../../mysql-config.php"; | ||
|
||
if (!defined('DB_HOST') || !defined('DB_USER') || !defined('DB_PASS') || !defined('DB_NAME')) { | ||
throw new \Exception("Must create mysql-config.php in project root directory defining connection constants"); | ||
} |
4 changes: 2 additions & 2 deletions
4
examples/support/generic_table.php → examples/support/generic-table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?php | ||
|
||
/* Create table and fill in a few rows for examples; for comments see 003_generic_with_yield.php */ | ||
function genTable(\Amp\Mysql\Pool $db) { | ||
function createGenericTable(\Amp\Mysql\Pool $db): Generator { | ||
yield $db->query("CREATE TABLE tmp SELECT 1 AS a, 2 AS b"); | ||
$promises = []; | ||
foreach (range(1, 5) as $num) { | ||
$promises[] = $db->query("INSERT INTO tmp (a, b) VALUES ($num, $num * 2)"); | ||
} | ||
yield \Amp\Promise\all($promises); | ||
return yield $promises; | ||
} |