【发布时间】:2013-10-30 00:15:03
【问题描述】:
这是我正在使用的代码,是否足以确保脚本只能作为 cron 作业运行?它确实有效,但也许我错过了一些东西。
if (php_sapi_name() !== 'cli') {
die("You are not allwod here");
}
【问题讨论】:
-
us2.php.net/manual/en/function.php-sapi-name.php#89858 :与您的问题相关的非常重要的说明。