$missing_tpl='%n (<a href="http://php.net/manual/en/%t.%u.php" target="_blank">%f</a>) %t is disabled in this server. This %t must be enabled in your PHP configuration (php.ini) and/or you must add this missing %t.';
if(version_compare(PHP_VERSION,'5.6.0','<')){
$install_errors[]='This server is currently running PHP version '.PHP_VERSION.' and Chevereto needs at least PHP 5.6.0 to run. You need to update PHP in this server.';
$install_errors[]='Apache <a href="http://httpd.apache.org/docs/2.1/rewrite/rewrite_intro.html" target="_blank">mod_rewrite</a> is not enabled in this server. This must be enabled to run Chevereto.';
$install_errors[]='<a href="http://www.libgd.org" target="_blank">GD Library</a> is not enabled in this server. GD is needed to perform image handling.';
}else{
$imagetype_fail='image support is not enabled in your current PHP setup (GD Library).';
if(!imagetypes()&IMG_PNG){
$install_errors[]='PNG '.$imagetype_fail;
}
if(!imagetypes()&IMG_GIF){
$install_errors[]='GIF '.$imagetype_fail;
}
if(!imagetypes()&IMG_JPG){
$install_errors[]='JPG '.$imagetype_fail;
}
if(!imagetypes()&IMG_WBMP){
$install_errors[]='BMP '.$imagetype_fail;
}
}
foreach([
'pdo'=>[
'%label'=>'PDO',
'%name'=>'PHP Data Objects',
'%slug'=>'book.pdo',
'%desc'=>'PDO is needed to perform database operations'
],
'pdo_mysql'=>[
'%label'=>'PDO_MYSQL',
'%name'=>'PDO MySQL Functions',
'%slug'=>'ref.pdo-mysql',
'%desc'=>'PDO_MYSQL is needed to work with a MySQL database',
],
'mbstring'=>[
'%label'=>'mbstring',
'%name'=>'Multibyte string',
'%slug'=>'book.mbstring',
'%desc'=>'Mbstring is needed to handle multibyte strings',
]
]as$k=>$v){
if(!extension_loaded($k)){
$install_errors[]=strtr('%name (<a href="http://www.php.net/manual/%slug.php">%label</a>) is not loaded in this server. %desc.',$v);
$install_errors[]='No write permission for PHP user '.get_current_user().' in <code>'.G\absolute_to_relative($v).'</code> directory. Chevereto needs to be able to write in this directory.';
$install_errors[]="<code>".G\absolute_to_relative($system_template)."</code> doesn't exists. Make sure to upload this.";
}
/*** License file ***/
$license_file=G_APP_PATH.'license/check.php';
if(!file_exists($license_file)){
$install_errors[]="Can't find <code>".G\absolute_to_relative($license_file)."</code> file. Make sure to upload the <code>app/license</code> folder.";
}else{
require_once($license_file);
}
/*** .htaccess checks (only for Apache) ***/
if(G\is_apache()){
// Check for the root .htaccess file
if(!file_exists(G_ROOT_PATH.'.htaccess')){
$install_errors[]="Can't find root <code>.htaccess</code> file. Re-upload this file and take note that in some computers this file could be hidden in your local folder.";