From b39c0d54c07c1a89aa1e4ecaef134b96e4ed4b8a Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 14:06:36 -0800 Subject: some windows fixes --- boot.php | 6 +++++- index.php | 20 ++++++++++++-------- mod/setup.php | 5 ++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/boot.php b/boot.php index 9048223bf..8460d76c6 100755 --- a/boot.php +++ b/boot.php @@ -1571,13 +1571,17 @@ function proc_run($cmd){ $args[$x] = escapeshellarg($args[$x]); $cmdline = implode($args," "); - if(get_config('system','proc_windows')) + if(is_windows()) proc_close(proc_open('cmd /c start /b ' . $cmdline,array(),$foo)); else proc_close(proc_open($cmdline." &",array(),$foo)); } +function is_windows() { + return ((strtoupper(substr(PHP_OS,0,3)) === 'WIN') ? true : false); +} + function current_theme(){ $app_base_themes = array('redbasic'); diff --git a/index.php b/index.php index c2421bc0e..a9264fee7 100755 --- a/index.php +++ b/index.php @@ -242,18 +242,22 @@ if (file_exists($theme_info_file)){ if(! x($a->page,'content')) $a->page['content'] = ''; -/* set JS cookie */ -if($_COOKIE['jsAvailable'] != 1) { - $a->page['content'] .= ''; - /* emulate JS cookie if cookies are not accepted */ - if ($_GET['JS'] == 1) { - $_COOKIE['jsAvailable'] = 1; + + +if(! $install) { + /* set JS cookie */ + if($_COOKIE['jsAvailable'] != 1) { + $a->page['content'] .= ''; + /* emulate JS cookie if cookies are not accepted */ + if ($_GET['JS'] == 1) { + $_COOKIE['jsAvailable'] = 1; + } } + call_hooks('page_content_top',$a->page['content']); } -if(! $install) - call_hooks('page_content_top',$a->page['content']); + /** * Call module functions diff --git a/mod/setup.php b/mod/setup.php index ca5566578..14572699e 100755 --- a/mod/setup.php +++ b/mod/setup.php @@ -373,7 +373,10 @@ function check_php(&$phpath, &$checks) { if (strlen($phpath)){ $passed = file_exists($phpath); } else { - $phpath = trim(shell_exec('which php')); + if(is_windows()) + $phpath = trim(shell_exec('where php')); + else + $phpath = trim(shell_exec('which php')); $passed = strlen($phpath); } $help = ""; -- cgit v1.2.3 From 02e4527de682042562dccac83899ef562c4b1e05 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 14:09:09 -0800 Subject: better check for setup module --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index a9264fee7..0012798a6 100755 --- a/index.php +++ b/index.php @@ -244,7 +244,7 @@ if(! x($a->page,'content')) -if(! $install) { +if(! ($a->module === 'setup')) { /* set JS cookie */ if($_COOKIE['jsAvailable'] != 1) { $a->page['content'] .= ''; -- cgit v1.2.3