1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Issue #1356 - Installation and PHP notice fixes.

This commit is contained in:
Cameron
2016-02-15 11:09:58 -08:00
parent 4314bb625b
commit 9f96a70e76
5 changed files with 69 additions and 58 deletions

View File

@@ -1473,7 +1473,7 @@ class e_parse extends e_parser
// Make sure we have a valid count for word wrapping
if (!$wrap && $pref['main_wordwrap'])
if (!$wrap && !empty($pref['main_wordwrap']))
{
$wrap = $pref['main_wordwrap'];
}
@@ -1785,7 +1785,7 @@ class e_parse extends e_parser
// profanity filter
if ($pref['profanity_filter'])
if (!empty($pref['profanity_filter']))
{
if (!is_object($this->e_pf))
{

View File

@@ -1713,10 +1713,10 @@ class e_form
// $text[] = $this->radio($name, $value, (string) $checked === (string) $value)."".$this->label($label, $name, $value).(isset($helpLabel) ? "<div class='field-help'>".$helpLabel."</div>" : '');
}
if($multi_line === false)
{
// if($multi_line === false)
// {
// return implode("&nbsp;&nbsp;", $text);
}
// }
// support of UI owned 'newline' parameter
if(!varset($options['sep']) && vartrue($options['newline'])) $options['sep'] = '<br />'; // TODO div class=separator?

View File

@@ -71,11 +71,11 @@ define("LANINS_046", "5");
define("LANINS_047", "Administrator Details");
define("LANINS_048", "EXIF extension");
define("LANINS_049", "The two passwords you entered are not the same. Please go back and try again.");
define("LANINS_050", "XML Extension");
define("LANINS_050", "XML extension");
define("LANINS_051", "Installed");
define("LANINS_052", "Not Installed");
define("LANINS_053", "e107 v2.x requires the PHP XML Extension to be installed. Please contact your host or read the information at [x] before continuing");
define("LANINS_054", "e107 v2.x requires the PHP EXIF Extension to be installed. Please contact your host or read the information at [x] before continuing");
// define("LANINS_053", "e107 v2.x requires the PHP XML Extension to be installed. Please contact your host or read the information at [x] before continuing");
// define("LANINS_054", "e107 v2.x requires the PHP EXIF Extension to be installed. Please contact your host or read the information at [x] before continuing");
define("LANINS_055", "Install Confirmation");
define("LANINS_056", "6");
define("LANINS_057", " e107 now has all the information it needs to complete the installation.
@@ -176,8 +176,9 @@ define("LANINS_134", "Installation");
define("LANINS_135", "of"); //single time use installer only as in .1 of 8 not replacing by LAN_SEARCH_12
define("LANINS_136", "Deleted existing database");
define("LANINS_137", "Found existing database");
define("LANINS_138", "Version");
// define("LANINS_138", "Version");
define("LANINS_141", "Please fill in the form below with your MySQL details. If you do not know this information, please contact your hosting provider. You may hover over each field for additional information.");
define("LANINS_142", "IMPORTANT: Please rename e107.htaccess to .htaccess");
define("LANINS_144", "IMPORTANT: Please copy and paste the contents of the [b]e107.htaccess[/b] into your [b].htaccess[/b] file. Please take care NOT to overwrite any existing data that may be in it.");
define("LANINS_145", "e107 v2.x requires the PHP [x] to be installed. Please contact your host or read the information at [y] before continuing.");

View File

@@ -105,10 +105,11 @@ class newsletter
$this->createIssue();
}
if($mes)
echo $mes->render();
/*if($mes)
{
$ns->tablerender($caption, $mes->render() . $text);
}
}*/
}

View File

@@ -13,7 +13,7 @@
// minimal software version
define('MIN_PHP_VERSION', '5.3');
define('MIN_MYSQL_VERSION', '4.1.2');
define('MAKE_INSTALL_LOG', false);
define('MAKE_INSTALL_LOG', true);
// ensure CHARSET is UTF-8 if used
//define('CHARSET', 'utf-8');
@@ -224,6 +224,7 @@ class e_install
var $dbLink = NULL; // DB link - needed for PHP5.3 bug
var $session = null;
protected $pdo = false;
protected $debug = false;
// public function __construct()
function __construct()
@@ -235,6 +236,11 @@ class e_install
define('e_UC_MAINADMIN', 250);
define('E107_DEBUG_LEVEL',0);
if($_SERVER['QUERY_STRING'] == "debug")
{
$this->debug = true;
}
if(defined('PDO::ATTR_DRIVER_NAME')) // TODO Uncomment when ready.
{
$this->pdo = true;
@@ -839,15 +845,6 @@ class e_install
}
}
$xml_installed = (!function_exists('utf8_encode')) ? false : true;
$exif_installed = (!function_exists('exif_imagetype')) ? false : true;
$gdlib_installed = (extension_loaded('gd') && function_exists('gd_info')) ? true : false;
$curl_installed = (function_exists('curl_version')) ? true : false;
$exifExtensionLink = "<a href='http://php.net/manual/en/book.exif.php'>php.net</a>";
$php_version = phpversion();
if(version_compare($php_version, MIN_PHP_VERSION, ">="))
@@ -861,28 +858,21 @@ class e_install
$e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : ""));
if(!$perms_pass)
{
$this->add_button("retest_perms", LANINS_009);
$this->stage = 3; // make the installer jump back a step
}
elseif ($perms_pass && !$version_fail && $xml_installed)
{
$this->add_button("continue_install", LAN_CONTINUE);
}
$permColor = ($perms_pass == true) ? "text-success" : "text-error";
$PHPColor = ($version_fail == false) ? "text-success" : "text-error";
$xmlColor = ($xml_installed == true) ? "text-success" : "text-error";
$exifColor = ($exif_installed == true) ? "text-success" : "text-error";
$mysqlColor = ($mysql_pass == true) ? "text-success" : "text-error";
$gdLibColor = ($gdlib_installed == true) ? "text-success" : "text-error";
$curlColor = ($curl_installed == true) ? "text-success" : "text-error"; //TODO Below.
$xmlExtensionLink = "<a href='http://php.net/manual/en/ref.xml.php'>php.net</a>";
$extensionCheck = array(
'xml' => array('label'=> LANINS_050, 'status'=> function_exists('utf8_encode'), 'url'=> 'http://php.net/manual/en/ref.xml.php'),
'exif' => array('label'=> LANINS_048, 'status'=> function_exists('exif_imagetype'), 'url'=> 'http://php.net/manual/en/book.exif.php'),
'gd' => array('label'=> 'GD Library', 'status'=> function_exists('gd_info'), 'url'=> 'http://php.net/manual/en/book.image.php'),
'curl' => array('label'=>'Curl Library', 'status'=> function_exists('curl_version'), 'url'=>'http://php.net/manual/en/book.curl.php')
);
// TODO Lots of repetition below - clean it up with an array and loop.
$output = "
<table class='table table-striped table-bordered' style='width: 100%; margin-left: auto; margin-right: auto;'>
@@ -902,26 +892,36 @@ class e_install
<td>MySQL</td>
<td>{$mysql_note}</td>
<td class='{$mysqlColor}'>{$mysql_help}</td>
</tr>
</tr>";
<tr>
<td>GD Extension</td>
<td>".($gdlib_installed ? LANINS_051 : LANINS_052)."</td>
<td class='{$gdLibColor}'>".($gdlib_installed ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : str_replace("[x]",$xmlExtensionLink, LANINS_053) )."</td>
</tr>
<tr>
<td>".LANINS_050."</td>
<td>".($xml_installed ? LANINS_051 : LANINS_052)."</td>
<td class='{$xmlColor}'>".($xml_installed ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : str_replace("[x]",$xmlExtensionLink, LANINS_053) )."</td>
</tr>
<tr>
<td>".LANINS_048."</td>
<td>".($exif_installed ? LANINS_051 : LANINS_052)."</td>
<td class='{$exifColor}'>".($exif_installed ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : str_replace("[x]", $exifExtensionLink, LANINS_054) )."</td>
</tr>
foreach($extensionCheck as $ext)
{
$statusText = ($ext['status'] === true) ? LANINS_051 : LANINS_052;
$statusColor = ($ext['status'] === true) ? "text-success" : "text-error";
$statusIcon = ($ext['status'] === true) ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : str_replace(array("[x]",'[y]'), array($ext['label'], "<a href='".$ext['url']."'>php.net</a>"), LANINS_145);
$output .= "
<tr>
<td>".$ext['label']."</td>
<td>".$statusText."</td>
<td class='".$statusColor."'>".$statusIcon."</td>
</tr>";
}
$output .= "
</table>\n";
if(!$perms_pass || (($extensionCheck['xml']['status'] !== true)))
{
$this->add_button("retest_perms", LANINS_009);
$this->stage = 3; // make the installer jump back a step
}
elseif ($perms_pass && !$version_fail && ($extensionCheck['xml']['status'] == true))
{
$this->add_button("continue_install", LAN_CONTINUE);
}
$this->finish_form();
$this->template->SetTag("stage_content", $output.$e_forms->return_form());
$this->logLine('Stage 4 completed');
@@ -1837,6 +1837,16 @@ if($this->pdo == true)
if (!$this->dbqry($sql_table, $link))
{
if($this->debug)
{
echo "<h3>filename</h3>";
var_dump($filename);
echo "<h3>sql_table</h3>";
var_dump($sql_table);
echo "<h3>result[0]</h3>";
var_dump($result[0]);
}
return nl2br(LANINS_061."\n\n<b>".LANINS_083."\n</b><i>".e107::getDb()->getLastErrorText()."</i>");
}
}
@@ -1861,18 +1871,17 @@ if($this->pdo == true)
function dbqry($qry)
{
// mysql_query($qry);
$sql = e107::getDb();
$sql->db_Query($qry);
return $sql->db_Query($qry);
if($error = $sql->getLastErrorNumber())
/*if($error = $sql->getLastErrorNumber())
{
$errorInfo = 'Query Error [#'.$error.']: '.$sql->getLastErrorText()."\nQuery: {$qry}";
$this->debug_db_info['db_error_log'][] = $errorInfo;
return false;
}
return true;
return true;*/
}
}
@@ -2090,7 +2099,7 @@ function template_data()
<div class="footer">
<p class="pull-left">&copy; e107 Inc. '.date("Y").'</p>
<p class="pull-right">'.LANINS_138.' &#58 '.e_VERSION.'</p>
<p class="pull-right">'.LAN_VERSION.' &#58 '.e_VERSION.'</p>
</div>
<div>{debug_info}</div>
</div> <!-- /container -->