浏览代码

Update record_path.php

FusionPBX 7 年之前
父节点
当前提交
c6ed05cbe4
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      upgrade/record_path.php

+ 5 - 1
upgrade/record_path.php

@@ -26,10 +26,14 @@
 	$execute_sql = true;
 	$execute_sql = true;
         $document_root = '/var/www/fusionpbx';
         $document_root = '/var/www/fusionpbx';
 
 
-//check the permission
+//web server or command line
         if(defined('STDIN')) {
         if(defined('STDIN')) {
                 set_include_path($document_root);
                 set_include_path($document_root);
                 $_SERVER["DOCUMENT_ROOT"] = $document_root;
                 $_SERVER["DOCUMENT_ROOT"] = $document_root;
+                $project_path = $_SERVER["DOCUMENT_ROOT"];
+                define('PROJECT_PATH', $project_path);
+                $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
+                set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
                 require_once "resources/require.php";
                 require_once "resources/require.php";
                 $display_type = 'text'; //html, text
                 $display_type = 'text'; //html, text
         }
         }