Skip to content

Commit 1bda98d

Browse files
committed
Console: Added check to ensure this tool is being run in a command line environment, and not via a web server.
(I thought the Symfony console component did this already.) #8
1 parent 28451fd commit 1bda98d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/console

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4+
if ("cli" !== php_sapi_name()) {
5+
printf("This tool must be used in a command line environment only.\n");
6+
exit 1;
7+
}
8+
49
require_once __DIR__ . "/../vendor/autoload.php";
510

611
define("ROOT_DIR", sprintf("%s/../", __DIR__));

0 commit comments

Comments
 (0)