29 lines
676 B
PHP
29 lines
676 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
require_once 'vendor/autoload.php';
|
|
|
|
$app = Application::start(
|
|
__DIR__ . '/config/config.ini',
|
|
IO\Directory::exists(__DIR__ . '/vendor/phpunit/phpunit')
|
|
);
|
|
$app->startDatabase();
|
|
|
|
if (PHP_SAPI !== 'cli') {
|
|
$storage_dir = $app->getStoragePath();
|
|
if (!$storage_dir->isReadable()
|
|
|| !$storage_dir->isWritable()) {
|
|
echo 'Cannot access storage directory.';
|
|
exit;
|
|
}
|
|
|
|
if (isset($_COOKIE['msz_uid'], $_COOKIE['msz_sid'])) {
|
|
$app->startSession((int)$_COOKIE['msz_uid'], $_COOKIE['msz_sid']);
|
|
}
|
|
|
|
if (!$app->inDebugMode()) {
|
|
ob_start('ob_gzhandler');
|
|
}
|
|
|
|
$app->startTemplating();
|
|
}
|