Эх сурвалжийг харах

fixes so cli installs/upgrades work.
Also another step along the way allowing freeswitch to run -u -g freeswitch and fusionpbx to run -u -g www-data

Harry G. Coin 9 жил өмнө
parent
commit
82dd4b33e2
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      root.php

+ 4 - 1
root.php

@@ -25,6 +25,7 @@
 */
 
 // make sure the PATH_SEPARATOR is defined
+        umask(2);
 	if (!defined("PATH_SEPARATOR")) {
 		if (strpos($_ENV["OS"], "Win") !== false) {
 			define("PATH_SEPARATOR", ";");
@@ -33,10 +34,12 @@
 		}
 	}
 
+        if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
+        
 	// make sure the document_root is set
 	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
 	if(PHP_SAPI == 'cli'){
-		chdir(pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME));
+		chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
 		$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
 		$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
 		if (file_exists('/project_root.php')) {