1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Extra warnings/alerts added for possible upgrade issues.

This commit is contained in:
Cameron 2016-12-01 11:20:56 -08:00
parent ab26e0cb13
commit 59e97ba8dc
3 changed files with 39 additions and 3 deletions

View File

@ -56,6 +56,12 @@ if(isset($_E107['cli']) && !isset($_E107['debug']) && isset($_SERVER["HTTP_USER_
exit();
}
if(function_exists('utf8_encode') === false)
{
echo "e107 requires the PHP <a href='http://php.net/manual/en/book.xml.php'>XML parser</a> package. Please install it to use e107. ";
exit();
}
if(!isset($_E107['cli']))
{
while (@ob_end_clean()); // destroy all ouput buffering

View File

@ -118,6 +118,7 @@ class admin_start
$this->checkSuspiciousFiles();
$this->checkDeprecated();
$this->checkPasswordEncryption();
$this->checkHtaccess();
if($this->refresh == true)
{
@ -130,7 +131,7 @@ class admin_start
{
$create_dir = array(e_MEDIA,e_SYSTEM,e_CACHE,e_CACHE_CONTENT,e_CACHE_IMAGE, e_CACHE_DB, e_LOG, e_BACKUP, e_CACHE_URL, e_TEMP, e_IMPORT);
$refresh = false;
$mes = e107::getMessage();
foreach($create_dir as $dr)
{
@ -140,6 +141,10 @@ class admin_start
{
$this->refresh = true;
}
else
{
$mes->addWarning("Unable to create <b>".$dr."</b>. Please check your folder permissions.");
}
}
}
@ -242,6 +247,11 @@ class admin_start
}
private function checkDependencies()
{
}
function checkDeprecated()
@ -287,6 +297,20 @@ class admin_start
}
function checkHtaccess() // upgrade scenario
{
if(!file_exists(e_BASE.".htaccess") && file_exists(e_BASE."e107.htaccess"))
{
if(rename(e_BASE."e107.htaccess", e_BASE.".htaccess")===false)
{
e107::getMessage()->addWarning("Please rename your <b>e107.htaccess</b> file to <b>.htaccess</b>");
}
}
}
function checkFileTypes()
{
$mes = e107::getMessage();

View File

@ -1301,7 +1301,10 @@ function update_706_to_800($type='')
{
if(!is_dir(e_MEDIA.$md))
{
mkdir(e_MEDIA.$md);
if(mkdir(e_MEDIA.$md)===false)
{
e107::getMessage()->addWarning("Unable to create ".e_MEDIA.$md.".");
}
}
}
}
@ -1319,7 +1322,10 @@ function update_706_to_800($type='')
{
$apath = (strstr($av['path'],'public/')) ? e_AVATAR_UPLOAD : e_AVATAR_DEFAULT;
@rename($av['path'].$av['fname'], $apath. $av['fname']);
if(rename($av['path'].$av['fname'], $apath. $av['fname'])===false)
{
e107::getMessage()->addWarning("Unable to more ".$av['path'].$av['fname']." to ".$apath. $av['fname'].". Please move manually.");
}
}
}