diff options
author | zotlabs <mike@macgirvin.com> | 2016-12-04 15:19:58 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-12-04 15:19:58 -0800 |
commit | 6d9fe04aa875baedb1370f72d05145518afd0fba (patch) | |
tree | 522c2d64b914490651d002cc1293473009641077 /Zotlabs | |
parent | 16e48a859cffb0f81f19dc847210c98ac32d8d09 (diff) | |
download | volse-hubzilla-6d9fe04aa875baedb1370f72d05145518afd0fba.tar.gz volse-hubzilla-6d9fe04aa875baedb1370f72d05145518afd0fba.tar.bz2 volse-hubzilla-6d9fe04aa875baedb1370f72d05145518afd0fba.zip |
setup changes to check for shell_exec and exec functions
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Setup.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index fde9fe823..7de67e85c 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -161,13 +161,6 @@ class Setup extends \Zotlabs\Web\Controller { } } - function get_db_errno() { - if(class_exists('mysqli')) - return mysqli_connect_errno(); - else - return mysql_errno(); - } - /** * @brief Get output for the setup page. * @@ -175,6 +168,7 @@ class Setup extends \Zotlabs\Web\Controller { * * @return string parsed HTML output */ + function get() { $o = ''; @@ -401,7 +395,8 @@ class Setup extends \Zotlabs\Web\Controller { if (strlen($phpath)) { $passed = file_exists($phpath); - } else { + } + elseif(function_exists('shell_exec')) { if(is_windows()) $phpath = trim(shell_exec('where php')); else @@ -426,9 +421,13 @@ class Setup extends \Zotlabs\Web\Controller { if($passed) { $str = autoname(8); $cmd = "$phpath install/testargs.php $str"; - $result = trim(shell_exec($cmd)); - $passed2 = $result == $str; $help = ''; + + if(function_exists('shell_exec')) + $result = trim(shell_exec($cmd)); + else + $help .= t('Unable to check command line PHP as shell_exec() is disabled. This is required.') . EOL; + $passed2 = (($result == $str) ? true : false); if(!$passed2) { $help .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL; $help .= t('This is required for message delivery to work.'); @@ -518,6 +517,18 @@ class Setup extends \Zotlabs\Web\Controller { else { $this->check_add($ck_funcs, t('proc_open'), true, true); } + if((! function_exists('exec')) || strstr(ini_get('disable_functions'),'exec')) { + $this->check_add($ck_funcs, t('exec'), false, true, t('Error: exec is required but is either not installed or has been disabled in php.ini')); + } + else { + $this->check_add($ck_funcs, t('exec'), true, true); + } + if((! function_exists('shell_exec')) || strstr(ini_get('disable_functions'),'shell_exec')) { + $this->check_add($ck_funcs, t('shell_exec'), false, true, t('Error: shell_exec is required but is either not installed or has been disabled in php.ini')); + } + else { + $this->check_add($ck_funcs, t('shell_exec'), true, true); + } if(! function_exists('curl_init')) { $ck_funcs[0]['status'] = false; |