Skip to content

Commit

Permalink
Ensure PHP-Scoper can only be called from the CLI (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jun 9, 2018
1 parent a503f54 commit 5ff91b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/php-scoper
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ use Isolated\Symfony\Component\Finder\Finder as IsolatedFinder;
use RuntimeException;
use Symfony\Component\Finder\Finder;

if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
echo PHP_EOL.'PHP-Scoper may only be invoked from a command line'.\PHP_EOL;

exit(1);
}

$findAutoload = function () {
if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
// Is installed via composer
Expand Down

0 comments on commit 5ff91b8

Please sign in to comment.