-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added composer.json to each example and make it standalone downloadab…
…le project
- Loading branch information
1 parent
447178d
commit b2ee529
Showing
195 changed files
with
941 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ output/* | |
compose.yml | ||
var | ||
.env | ||
composer.lock |
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,65 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use function Flow\Filesystem\DSL\{fstab, path, protocol}; | ||
use Flow\ETL\Dataset\Statistics\HighResolutionTime; | ||
use Symfony\Component\Console\Input\{ArgvInput, InputDefinition, InputOption}; | ||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
use Symfony\Component\Console\Style\SymfonyStyle; | ||
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); | ||
|
||
$finder = new Finder(); | ||
$finder->in(__DIR__ . '/topics') | ||
->files() | ||
->name('*.php'); | ||
|
||
$output = new ConsoleOutput(); | ||
$intput = new ArgvInput(definition: new InputDefinition( | ||
[ | ||
new InputOption(name: 'composer-update', shortcut: 'u', mode: InputOption::VALUE_NONE), | ||
new InputOption(name: 'composer-archive', shortcut: 'a', mode: InputOption::VALUE_NONE), | ||
] | ||
)); | ||
$style = new SymfonyStyle($intput, $output); | ||
$style->setDecorated(true); | ||
|
||
$style->title('Cleaning Flow PHP Examples'); | ||
|
||
$fs = fstab()->for(protocol('file')); | ||
|
||
foreach ($finder as $file) { | ||
|
||
if ($file->getBasename() !== 'code.php') { | ||
continue; | ||
} | ||
|
||
$start = HighResolutionTime::now(); | ||
|
||
$style->info("Removing vendor folder: {$file->getRelativePathname()}"); | ||
|
||
$vendorPath = path($file->getPath() . '/vendor'); | ||
|
||
if ($fs->status($vendorPath)?->isDirectory()) { | ||
$fs->rm(path($file->getPath() . '/vendor')); | ||
} | ||
} | ||
|
||
$style->success('Vendor folders remove from all examples'); |
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.