Skip to content

Commit 306ae41

Browse files
Guard scripts from being run in non-CLI contexts
1 parent 3b6b41b commit 306ae41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Resources/bin/update-data.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
use Symfony\Component\String\Resources\WcswidthDataGenerator;
1313

14+
if ('cli' !== \PHP_SAPI) {
15+
throw new Exception('This script must be run from the command line.');
16+
}
17+
1418
error_reporting(\E_ALL);
1519

1620
set_error_handler(static function (int $type, string $msg, string $file, int $line): void {

0 commit comments

Comments
 (0)