2017-12-16 19:17:29 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu;
|
|
|
|
|
|
|
|
require_once 'vendor/autoload.php';
|
2018-01-02 19:37:13 +00:00
|
|
|
|
2018-01-04 20:01:55 +00:00
|
|
|
$app = Application::start(
|
|
|
|
__DIR__ . '/config/config.ini',
|
|
|
|
IO\Directory::exists(__DIR__ . '/vendor/phpunit/phpunit')
|
|
|
|
);
|
2018-01-03 21:39:01 +00:00
|
|
|
$app->startDatabase();
|
2018-03-14 01:39:02 +00:00
|
|
|
|
|
|
|
if (PHP_SAPI !== 'cli') {
|
2018-03-24 04:31:42 +00:00
|
|
|
$storage_dir = $app->getStoragePath();
|
|
|
|
if (!$storage_dir->isReadable()
|
|
|
|
|| !$storage_dir->isWritable()) {
|
|
|
|
echo 'Cannot access storage directory.';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2018-03-14 01:39:02 +00:00
|
|
|
if (isset($_COOKIE['msz_uid'], $_COOKIE['msz_sid'])) {
|
|
|
|
$app->startSession((int)$_COOKIE['msz_uid'], $_COOKIE['msz_sid']);
|
|
|
|
}
|
|
|
|
|
2018-03-24 04:31:42 +00:00
|
|
|
if (!$app->inDebugMode()) {
|
|
|
|
ob_start('ob_gzhandler');
|
|
|
|
}
|
2018-03-14 01:39:02 +00:00
|
|
|
|
|
|
|
$app->startTemplating();
|
|
|
|
}
|