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
This commit is contained in:
Harry G. Coin
2016-04-25 21:26:26 -05:00
parent 1497c7cb7e
commit fd313a7c66
68 changed files with 274 additions and 72 deletions

View File

@@ -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')) {