-
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.
Added a DSL documentation to landing page
- Loading branch information
1 parent
c492f3b
commit b52a921
Showing
49 changed files
with
1,799 additions
and
100 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Flow\Documentation\{FunctionCollector, FunctionsExtractor}; | ||
use Symfony\Component\Console\Application; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\{InputArgument, InputInterface}; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
if (false === in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { | ||
print PHP_EOL . 'This app may only be invoked from a command line, got "' . PHP_SAPI . '"' . PHP_EOL; | ||
|
||
exit(1); | ||
} | ||
|
||
ini_set('memory_limit', -1); | ||
|
||
$application = new Application('Flow-PHP - Documentation'); | ||
|
||
$application->add(new class extends Command { | ||
public function configure() : void | ||
{ | ||
$this | ||
->setName('dsl:dump') | ||
->setDescription('Dump DSL into json file.') | ||
->addArgument('output', InputArgument::REQUIRED, 'Where to dump dsl.'); | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) : int | ||
{ | ||
|
||
$paths = [ | ||
__DIR__ . '/../src/core/etl/src/Flow/ETL/DSL/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-chartjs/src/Flow/ETL/Adapter/ChartJS/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-csv/src/Flow/ETL/Adapter/CSV/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-doctrine/src/Flow/ETL/Adapter/Doctrine/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-elasticsearch/src/Flow/ETL/Adapter/Elasticsearch/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-meilisearch/src/Flow/ETL/Adapter/Meilisearch/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/functions.php', | ||
__DIR__ . '/../src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php', | ||
]; | ||
|
||
$extractor = new FunctionsExtractor(new FunctionCollector()); | ||
|
||
$normalizedFunctions = []; | ||
|
||
foreach ($extractor->extract($paths) as $function) { | ||
$normalizedFunctions[] = $function->normalize(); | ||
} | ||
|
||
\file_put_contents(__DIR__ . '/../' . \ltrim($input->getArgument('output'), '/'), \json_encode($normalizedFunctions)); | ||
|
||
return Command::SUCCESS; | ||
} | ||
}); | ||
|
||
$application->run(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Simple example of reading from rows and writing to stdout. |
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.