-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
46 lines (36 loc) · 1.08 KB
/
bootstrap.php
File metadata and controls
46 lines (36 loc) · 1.08 KB
1
<?php# INIT_::init(array( 'templates_dir' => './templates'));# LOG$log = _::Log();_::Registry()->set('log', $log);function l($msg, $lvl) { _::Registry()->get('log')->log($msg, $lvl);} # ROUTES$routes = array( '' => array('index', 'index'), // Default route '#comment/(\d{4})/(\d{2})/(\d{2})/(.+)#' => array('comment', 'index', array('file' => '$1_$2_$3_$4')), //'#show/(\d+)/.+/?#' => array('article', 'show', array('id' => '$1')), //'go/:id/aa' => array('url', 'show', array('id' => ':id')),);_::Router($routes, array('ext' => '.html'))->route();# AUTH_::Auth()->setup(new AuthBackendArray());# CACHE$cache = _::Cache(new CacheBackendFile('./cache/cachebackend/', array('gc_prob' => 100)));_::Registry()->set('cache', $cache);# ACL$acl = _::ACL();$acl->addRole('mod');$acl->addRole('admin', 'mod');$acl->allow('admin', 'admin');# VIEW$view = new _View();$view->setLayout('layout');_::Controller()->setView($view);# CONTROLLER_::Controller()->registerSlot('sidebar', 'slots/sidebar.php', 'templates/_aside.phtml');_::Controller()->go();