Skip to content

Commit e0d2cc3

Browse files
Guard scripts from being run in non-CLI contexts
1 parent 2900c66 commit e0d2cc3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Resources/bin/update-data.php

+4
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)