Skip to content

Commit

Permalink
fixes so cli installs/upgrades work.
Browse files Browse the repository at this point in the history
Also another step along the way allowing freeswitch to run -u -g freeswitch and fusionpbx to run -u -g www-data
  • Loading branch information
hcoin committed Apr 26, 2016
1 parent 4fad23f commit f020286
Show file tree
Hide file tree
Showing 68 changed files with 274 additions and 72 deletions.
5 changes: 4 additions & 1 deletion app/access_controls/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/adminer/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/backup/root.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/call_block/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/call_broadcast/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/call_center_active/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/call_centers/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/call_flows/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/calls/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/calls_active/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/click_to_call/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/conference_centers/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/conferences/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/conferences_active/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/contacts/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/destinations/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/devices/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
5 changes: 4 additions & 1 deletion app/dialplan/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", ";");
Expand All @@ -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')) {
Expand Down
Loading

0 comments on commit f020286

Please sign in to comment.