separate runtime check to a function
This commit is contained in:
parent
2807c3ce6d
commit
94495614c3
|
|
@ -300,3 +300,20 @@ if (! function_exists('delete_sessions')) {
|
||||||
Session::save();
|
Session::save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! function_exists('runtime_check')) {
|
||||||
|
|
||||||
|
function runtime_check(array $requirements)
|
||||||
|
{
|
||||||
|
// check php version
|
||||||
|
if (version_compare(PHP_VERSION, $requirements['php'], '<')) {
|
||||||
|
exit("[Error] Blessing Skin Server needs PHP version >= {$requirements['php']}, you are now using ".PHP_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($requirements['extensions'] as $extension) {
|
||||||
|
if (!extension_loaded($extension)) {
|
||||||
|
exit("[Error] You have not installed the $extension extension");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require __DIR__.'/autoload.php';
|
|
||||||
|
|
||||||
$app = require_once __DIR__.'/app.php';
|
$app = require_once __DIR__.'/app.php';
|
||||||
|
|
||||||
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
||||||
|
|
|
||||||
17
index.php
17
index.php
|
|
@ -7,18 +7,13 @@
|
||||||
* @author printempw <h@prinzeugen.net>
|
* @author printempw <h@prinzeugen.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// runtime check
|
require __DIR__.'/bootstrap/autoload.php';
|
||||||
if (version_compare(PHP_VERSION, '5.5.9', '<')) {
|
|
||||||
exit('[Error] Blessing Skin Server needs PHP version >= 5.5.9, you are now using '.PHP_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!class_exists('PDO')) {
|
// check the runtime environment
|
||||||
exit('[Error] You have not installed the PDO extension');
|
runtime_check([
|
||||||
}
|
'php' => '5.5.9',
|
||||||
|
'extensions' => ['pdo_mysql', 'openssl', 'gd']
|
||||||
if (!function_exists('openssl_encrypt')) {
|
]);
|
||||||
exit('[Error] You have not installed the OpenSSL extension');
|
|
||||||
}
|
|
||||||
|
|
||||||
// handle the request
|
// handle the request
|
||||||
require __DIR__.'/bootstrap/handler.php';
|
require __DIR__.'/bootstrap/handler.php';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user