Skip to content

Commit

Permalink
Block running incompatible examples via PHAR
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed Oct 11, 2023
1 parent 7629bf3 commit e5424b6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/topics/async/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php declare(strict_types=1);

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

require __DIR__ . '/../../bootstrap.php';

const __FLOW_AUTOLOAD__ = __DIR__ . '/../vendor/autoload.php';
Expand Down
6 changes: 6 additions & 0 deletions examples/topics/db/db_clean.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env php
<?php

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Table;
Expand Down
6 changes: 6 additions & 0 deletions examples/topics/db/db_source.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env php
<?php

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

use function Flow\ETL\DSL\ref;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\Column;
Expand Down
6 changes: 6 additions & 0 deletions examples/topics/db/db_to_db_sync.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php declare(strict_types=1);

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

use function Flow\ETL\DSL\concat;
use function Flow\ETL\DSL\lit;
use function Flow\ETL\DSL\ref;
Expand Down
6 changes: 6 additions & 0 deletions examples/topics/fs/remote/json_remote_stream.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php declare(strict_types=1);

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

use function Flow\ETL\DSL\concat;
use function Flow\ETL\DSL\lit;
use function Flow\ETL\DSL\ref;
Expand Down
6 changes: 6 additions & 0 deletions examples/topics/fs/remote/json_remote_stream_glob.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php declare(strict_types=1);

if ('' !== \Phar::running(false)) {
print 'This example cannot be run in PHAR, please use CLI approach.';

exit(1);
}

use function Flow\ETL\DSL\concat;
use function Flow\ETL\DSL\lit;
use function Flow\ETL\DSL\ref;
Expand Down

0 comments on commit e5424b6

Please sign in to comment.