Browse Source

Update school_bells_cron.php (#181)

Remove root.php reference
frytimo 1 năm trước cách đây
mục cha
commit
364fa185d8

+ 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;