浏览代码

Update school_bells_cron.php (#181)

Remove root.php reference
frytimo 11 月之前
父节点
当前提交
364fa185d8
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      school_bells/school_bells_cron.php

+ 1 - 4
school_bells/school_bells_cron.php

@@ -2,11 +2,8 @@
 
 
 //restrict to command line only
 //restrict to command line only
 	if(defined('STDIN')) {
 	if(defined('STDIN')) {
-		$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
-		preg_match("/^(.*)\/app\/.*$/", $document_root, $matches);
-		$document_root = $matches[1];
+		$document_root = dirname(__DIR__, 2);
 		set_include_path($document_root);
 		set_include_path($document_root);
-		include "root.php";
 		require_once "resources/require.php";
 		require_once "resources/require.php";
 		require_once "resources/classes/text.php";
 		require_once "resources/classes/text.php";
 		$_SERVER["DOCUMENT_ROOT"] = $document_root;
 		$_SERVER["DOCUMENT_ROOT"] = $document_root;