Removed global settings
This commit is contained in:
parent
d17f64e709
commit
f0261ba2d2
2 changed files with 21 additions and 27 deletions
|
@ -2,36 +2,31 @@
|
||||||
|
|
||||||
use Utopia\View;
|
use Utopia\View;
|
||||||
use Utopia\Config\Config;
|
use Utopia\Config\Config;
|
||||||
use Utopia\Locale\Locale;
|
|
||||||
|
|
||||||
Locale::$exceptions = false;
|
|
||||||
|
|
||||||
$roles = [
|
|
||||||
['type' => 'owner', 'label' => 'Owner'],
|
|
||||||
['type' => 'developer', 'label' => 'Developer'],
|
|
||||||
['type' => 'admin', 'label' => 'Admin'],
|
|
||||||
];
|
|
||||||
|
|
||||||
$layout = new View(__DIR__.'/../../views/layouts/default.phtml');
|
$layout = new View(__DIR__.'/../../views/layouts/default.phtml');
|
||||||
|
|
||||||
|
$utopia->init(function () use ($utopia, $response, $request, $layout) {
|
||||||
|
|
||||||
/* AJAX check */
|
/* AJAX check */
|
||||||
if (!empty($request->getQuery('version', ''))) {
|
if (!empty($request->getQuery('version', ''))) {
|
||||||
$layout->setPath(__DIR__.'/../../views/layouts/empty.phtml');
|
$layout->setPath(__DIR__.'/../../views/layouts/empty.phtml');
|
||||||
}
|
}
|
||||||
|
|
||||||
$layout
|
$layout
|
||||||
->setParam('title', APP_NAME)
|
->setParam('title', APP_NAME)
|
||||||
->setParam('protocol', Config::getParam('protocol'))
|
->setParam('protocol', Config::getParam('protocol'))
|
||||||
->setParam('domain', $domain)
|
->setParam('domain', Config::getParam('domain'))
|
||||||
->setParam('home', $request->getServer('_APP_HOME'))
|
->setParam('home', $request->getServer('_APP_HOME'))
|
||||||
->setParam('setup', $request->getServer('_APP_SETUP'))
|
->setParam('setup', $request->getServer('_APP_SETUP'))
|
||||||
->setParam('class', 'unknown')
|
->setParam('class', 'unknown')
|
||||||
->setParam('icon', '/images/favicon.png')
|
->setParam('icon', '/images/favicon.png')
|
||||||
->setParam('roles', $roles)
|
->setParam('roles', [
|
||||||
|
['type' => 'owner', 'label' => 'Owner'],
|
||||||
|
['type' => 'developer', 'label' => 'Developer'],
|
||||||
|
['type' => 'admin', 'label' => 'Admin'],
|
||||||
|
])
|
||||||
->setParam('env', $utopia->getMode())
|
->setParam('env', $utopia->getMode())
|
||||||
;
|
;
|
||||||
|
|
||||||
$utopia->init(function () use ($utopia, $response, $request, $layout) {
|
|
||||||
$time = (60 * 60 * 24 * 45); // 45 days cache
|
$time = (60 * 60 * 24 * 45); // 45 days cache
|
||||||
$isDev = (\Utopia\App::MODE_TYPE_DEVELOPMENT == Config::getParam('env'));
|
$isDev = (\Utopia\App::MODE_TYPE_DEVELOPMENT == Config::getParam('env'));
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ ini_set('display_errors', 0);
|
||||||
// error_reporting(E_ALL);
|
// error_reporting(E_ALL);
|
||||||
|
|
||||||
$path = (isset($_GET['q'])) ? explode('/', $_GET['q']) : [];
|
$path = (isset($_GET['q'])) ? explode('/', $_GET['q']) : [];
|
||||||
$domain = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : '';
|
|
||||||
|
|
||||||
array_shift($path);
|
array_shift($path);
|
||||||
$version = array_shift($path);
|
$version = array_shift($path);
|
||||||
|
|
Loading…
Reference in a new issue