Merge branch 'php' into 'dev'
Update PHP Version check during Setup. See merge request hubzilla/core!1530
This commit is contained in:
commit
ef6a280019
@ -39,7 +39,7 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
ini_set('display_errors', '1');
|
||||
|
||||
// $baseurl/setup/testrewrite to test if rewrite in .htaccess is working
|
||||
if (argc() == 2 && argv(1) == "testrewrite") {
|
||||
if(argc() == 2 && argv(1) == 'testrewrite') {
|
||||
echo 'ok';
|
||||
killme();
|
||||
}
|
||||
@ -63,7 +63,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
// implied break;
|
||||
case 3:
|
||||
$urlpath = \App::get_path();
|
||||
$dbhost = trim($_POST['dbhost']);
|
||||
$dbport = intval(trim($_POST['dbport']));
|
||||
$dbuser = trim($_POST['dbuser']);
|
||||
@ -89,7 +88,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
// implied break;
|
||||
case 4:
|
||||
$urlpath = \App::get_path();
|
||||
$dbhost = trim($_POST['dbhost']);
|
||||
$dbport = intval(trim($_POST['dbport']));
|
||||
$dbuser = trim($_POST['dbuser']);
|
||||
@ -162,7 +160,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
*
|
||||
* @return string parsed HTML output
|
||||
*/
|
||||
|
||||
function get() {
|
||||
|
||||
$o = '';
|
||||
@ -213,10 +210,10 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if(x(\App::$data, 'txt') && strlen(\App::$data['txt'])) {
|
||||
$db_return_text .= $this->manual_config($a);
|
||||
$db_return_text .= $this->manual_config();
|
||||
}
|
||||
|
||||
if ($db_return_text != "") {
|
||||
if($db_return_text != '') {
|
||||
$tpl = get_markup_template('install.tpl');
|
||||
return replace_macros($tpl, array(
|
||||
'$title' => $install_title,
|
||||
@ -278,7 +275,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
$dbtype = intval(trim($_POST['dbtype']));
|
||||
$phpath = trim($_POST['phpath']);
|
||||
$adminmail = trim($_POST['adminmail']);
|
||||
$siteurl = trim($_POST['siteurl']);
|
||||
|
||||
$tpl = get_markup_template('install_db.tpl');
|
||||
$o .= replace_macros($tpl, array(
|
||||
@ -320,7 +316,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
$phpath = trim($_POST['phpath']);
|
||||
|
||||
$adminmail = trim($_POST['adminmail']);
|
||||
$siteurl = trim($_POST['siteurl']);
|
||||
$timezone = ((x($_POST,'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
|
||||
|
||||
|
||||
@ -363,12 +358,12 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
* @param string $help optional help string
|
||||
*/
|
||||
function check_add(&$checks, $title, $status, $required, $help = '') {
|
||||
$checks[] = array(
|
||||
$checks[] = [
|
||||
'title' => $title,
|
||||
'status' => $status,
|
||||
'required' => $required,
|
||||
'help' => $help
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -380,8 +375,8 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
function check_php(&$phpath, &$checks) {
|
||||
$help = '';
|
||||
|
||||
if(version_compare(PHP_VERSION, '5.5') < 0) {
|
||||
$help .= t('PHP version 5.5 or greater is required.');
|
||||
if(version_compare(PHP_VERSION, '7.1') < 0) {
|
||||
$help .= t('PHP version 7.1 or greater is required.');
|
||||
$this->check_add($checks, t('PHP version'), false, false, $help);
|
||||
}
|
||||
|
||||
@ -419,6 +414,7 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
$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;
|
||||
@ -666,7 +662,6 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
$help .= t('If your certificate is not recognized, members of other sites (who may themselves have valid certificates) will get a warning message on their own site complaining about security issues.') . EOL;
|
||||
$help .= t('This can cause usability issues elsewhere (not just on your own site) so we must insist on this requirement.') .EOL;
|
||||
$help .= t('Providers are available that issue free certificates which are browser-valid.'). EOL;
|
||||
|
||||
$help .= t('If you are confident that the certificate is valid and signed by a trusted authority, check to see if you have failed to install an intermediate cert. These are not normally required by browsers, but are required for server-to-server communications.') . EOL;
|
||||
|
||||
$this->check_add($checks, t('SSL certificate validation'), false, true, $help);
|
||||
@ -687,10 +682,9 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param App &$a
|
||||
* @return string with paresed HTML
|
||||
*/
|
||||
function manual_config(&$a) {
|
||||
function manual_config() {
|
||||
$data = htmlspecialchars(\App::$data['txt'], ENT_COMPAT, 'UTF-8');
|
||||
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
||||
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
||||
@ -707,7 +701,12 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Executes the SQL install script and create database tables.
|
||||
*
|
||||
* @param dba_driver $db (unused)
|
||||
* @return boolean|string false on success or error message as string
|
||||
*/
|
||||
function load_database($db) {
|
||||
$str = file_get_contents(\DBA::$dba->get_install_script());
|
||||
$arr = explode(';', $str);
|
||||
@ -767,7 +766,7 @@ class Setup extends \Zotlabs\Web\Controller {
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param unknown $v
|
||||
* @param array $v
|
||||
* @param array $c
|
||||
* @return array
|
||||
*/
|
||||
|
Reference in New Issue
Block a user