2013-05-03 11:57:08 +00:00
|
|
|
<?php
|
|
|
|
|
2013-06-17 18:40:04 +00:00
|
|
|
define('LYCHEE', true);
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Declare
|
2013-06-17 18:40:04 +00:00
|
|
|
$error = '';
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Include
|
2013-06-17 18:40:04 +00:00
|
|
|
require('config.php');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// PHP Version
|
2013-06-17 18:40:04 +00:00
|
|
|
if (floatval(phpversion())<5.2) $error .= ('Error 100: Please upgrade to PHP 5.2 or higher!<br>\n');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Extensions
|
2013-06-17 18:40:04 +00:00
|
|
|
if (!extension_loaded('exif')) $error .= ('Error 200: PHP exif extension not activated.<br>\n');
|
|
|
|
if (!extension_loaded('mbstring')) $error .= ('Error 201: PHP mbstring extension not activated.<br>\n');
|
|
|
|
if (!extension_loaded('gd')) $error .= ('Error 202: PHP gd extension not activated.<br>\n');
|
|
|
|
if (!extension_loaded('mysqli')) $error .= ('Error 203: PHP mysqli extension not activated.<br>\n');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Config
|
2013-06-17 18:40:04 +00:00
|
|
|
if (!$db||$db=='') $error .= ('Error 300: No property for \$db in config.php.<br>\n');
|
|
|
|
if (!$dbUser||$dbUser=='') $error .= ('Error 301: No property for \$dbUser in config.php.<br>\n');
|
|
|
|
if (!$dbPassword||$dbPassword=='') $error .= ('Error 302: No property for \$dbPassword in config.php.<br>\n');
|
|
|
|
if (!$dbHost||$dbHost=='') $error .= ('Error 303: No property for \$dbHost in config.php.<br>\n');
|
|
|
|
if (!$user||$user=='') $error .= ('Error 304: No property for \$user in config.php.<br>\n');
|
|
|
|
if (!$password||$password=='') $error .= ('Error 305: No property for \$password in config.php.<br>\n');
|
|
|
|
|
|
|
|
// Additional Config
|
|
|
|
//if ($checkForUpdates!=true&&heckForUpdates!=false) $error .= ('Error 306: No property for \$checkForUpdates in config.php.<br>\n');
|
|
|
|
if (!is_numeric($thumbQuality)||$thumbQuality<=0||$thumbQuality>=100) $error .= ('Error 307: Wrong property for \$thumbQuality in config.php.<br>\n');
|
|
|
|
if ($sorting!='ASC'&&$sorting!='DESC') $error .= ('Error 308: Wrong property for \$sorting in config.php.<br>\n');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Database
|
|
|
|
$database = new mysqli($dbHost, $dbUser, $dbPassword, $db);
|
2013-06-17 18:40:04 +00:00
|
|
|
if (mysqli_connect_errno()!=0) $error .= ('Error 400: ' . mysqli_connect_errno() . ': ' . mysqli_connect_error() . '<br>\n');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
// Permissions
|
2013-06-17 18:40:04 +00:00
|
|
|
if (substr(sprintf('%o', fileperms('../uploads/big/')), -4)!='0777') $error .= ('Error 500: Wrong permissions for \'/uploads/big\' (777 required).<br>\n');
|
|
|
|
if (substr(sprintf('%o', fileperms('../uploads/thumb/')), -4)!='0777') $error .= ('Error 501: Wrong permissions for \'/uploads/thumb\' (777 required).<br>\n');
|
|
|
|
if (substr(sprintf('%o', fileperms('../uploads/import/')), -4)!='0777') $error .= ('Error 502: Wrong permissions for \'/uploads/import\' (777 required).<br>\n');
|
|
|
|
if (substr(sprintf('%o', fileperms('../uploads/')), -4)!='0777') $error .= ('Error 503: Wrong permissions for \'/uploads\' (777 required).<br>\n');
|
2013-05-03 11:57:08 +00:00
|
|
|
|
2013-06-17 18:40:04 +00:00
|
|
|
if ($error=='') echo('Lychee is ready!'); else echo $error;
|
2013-05-03 11:57:08 +00:00
|
|
|
|
|
|
|
?>
|