-
-
Notifications
You must be signed in to change notification settings - Fork 38
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 (#1440) * Added composer.json to each example and make it standalone downloadable project * Updated composer.lock * Removed dependency added by mistake during development * Fixed code higlight in docs * Simplified reading composer.json content in examples * Reduced example archive size and excluded .env/vendor from archives * Fixed indention in test-suite.yml
- Loading branch information
1 parent
12bf88e
commit 464399b
Showing
199 changed files
with
1,301 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ build/flow.phar.asc | |
var | ||
vendor | ||
compose.yml | ||
phpunit.xml | ||
phpunit.xml | ||
.env |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ output/* | |
!output/.gitkep | ||
compose.yml | ||
var | ||
.env | ||
.env |
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,71 @@ | ||
#!/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 and code archive: {$file->getRelativePathname()}"); | ||
|
||
$vendorPath = path($file->getPath() . '/vendor'); | ||
|
||
if ($fs->status($vendorPath)?->isDirectory()) { | ||
$fs->rm(path($file->getPath() . '/vendor')); | ||
} | ||
|
||
$archiveZip = path($file->getPath() . '/flow_php_example.zip'); | ||
|
||
if ($fs->status($archiveZip)?->isFile()) { | ||
$fs->rm($archiveZip); | ||
} | ||
} | ||
|
||
$style->success('Vendor adn archive 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,15 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
}, | ||
"archive": { | ||
"exclude": [ | ||
".env", | ||
"vendor" | ||
] | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
}, | ||
"archive": { | ||
"exclude": [ | ||
".env", | ||
"vendor" | ||
] | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"name": "flow-php/examples", | ||
"description": "Flow PHP - Examples", | ||
"license": "MIT", | ||
"type": "library", | ||
"require": { | ||
"flow-php/etl": "1.x-dev" | ||
}, | ||
"archive": { | ||
"exclude": [ | ||
".env", | ||
"vendor" | ||
] | ||
} | ||
} |
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
Oops, something went wrong.