Improved CLI mode checking.
This commit is contained in:
parent
1412fd6568
commit
b041962403
1 changed files with 2 additions and 1 deletions
|
@ -26,6 +26,7 @@ $errorHandler->pushHandler(
|
|||
);
|
||||
$errorHandler->register();
|
||||
|
||||
// TODO: do something about this, probably a good idea to include shit as required rather than all at once here
|
||||
require_once 'src/array.php';
|
||||
require_once 'src/audit_log.php';
|
||||
require_once 'src/cache.php';
|
||||
|
@ -83,7 +84,7 @@ db_setup([
|
|||
define('MSZ_STORAGE', create_directory(config_get_default(MSZ_ROOT . '/store', 'Storage', 'path')));
|
||||
|
||||
if (PHP_SAPI === 'cli') {
|
||||
if ($argv[0] === basename(__FILE__)) {
|
||||
if (realpath($_SERVER['SCRIPT_FILENAME']) === __FILE__) {
|
||||
switch ($argv[1] ?? null) {
|
||||
case 'cron':
|
||||
// Ensure main role exists.
|
||||
|
|
Loading…
Reference in a new issue