public static function checkCliExecution() { if (php_sapi_name() != 'cli') { throw new \Exception("Script execution is restricted to CLI"); } }