-
Notifications
You must be signed in to change notification settings - Fork 28
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
12 changed files
with
160 additions
and
49 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env php | ||
<?php declare(strict_types=1); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use Symfony\Component\Finder\Finder; | ||
|
||
if ($_ENV['FLOW_PHAR_APP'] ?? false) { | ||
print PHP_EOL . 'This script cannot be run in PHAR, please use CLI approach.' . PHP_EOL; | ||
|
||
exit(1); | ||
} | ||
|
||
if (false === \in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { | ||
print PHP_EOL . 'This script may only be invoked from a command line, got "' . PHP_SAPI . '"' . PHP_EOL; | ||
|
||
exit(1); | ||
} | ||
|
||
\ini_set('memory_limit', -1); | ||
|
||
print "Running all available examples.\n"; | ||
print "Excluding: async, database & remote filesystem. Those examples require additional manual setup to be run properly.\n"; | ||
print "Removing previously generated output files.\n"; | ||
|
||
$finder = new Finder(); | ||
|
||
foreach ($finder->in(__DIR__ . '/output')->exclude('.gitkeep') as $file) { | ||
@\unlink($file->getRealPath()); | ||
} | ||
|
||
print "Running setup scripts.\n"; | ||
|
||
$finder = new Finder(); | ||
$finder->in(__DIR__ . '/setup') | ||
->files() | ||
->name('*.php'); | ||
|
||
foreach ($finder as $file) { | ||
print "\nScript: {$file->getRelativePathname()}\n"; | ||
|
||
include $file->getRealPath(); | ||
} | ||
|
||
$finder = new Finder(); | ||
$finder->in(__DIR__ . '/topics') | ||
// async, database & remote filesystem examples require additional manual setup to be run properly | ||
->exclude(['async', 'db', 'fs']) | ||
->files() | ||
->name('*.php'); | ||
|
||
foreach ($finder as $file) { | ||
print "\nExample: {$file->getRelativePathname()}\n"; | ||
|
||
try { | ||
include $file->getRealPath(); | ||
} catch (\Exception $e) { | ||
print "Example failed: {$e->getMessage()}\n"; | ||
} | ||
} |
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 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.