[svn] / trunk / loader.php  
Irokez CMS

View of /trunk/loader.php

Parent Directory Parent Directory Revision Log Revision Log


Revision 2 - Download Blame
Fri Mar 27 08:39:01 2009 UTC (17 months, 2 weeks ago) by irokez
File size: 1283 byte(s)
Adding files to repository
    1 <?php
    2 require_once 'include/cherokee/Framework.php';
    3 $Cherokee = Framework::instance();
    4 $Cherokee->load();
    5 
    6 $Conf   = $Cherokee->Conf;
    7 $Timer  = $Cherokee->Timer;
    8 
    9 // register database
   10 Framework::register('db', 'Database::plug_n_play', array($Conf->CNF->database->type, Database::MODE_DEV, $Conf->CNF->database));
   11 
   12 // start session
   13 $Session = Session::instance();
   14 Framework::set('Session', $Session);
   15 $Timer->reg('Session is started');
   16 
   17 $Router = $Cherokee->Router;
   18 $Router->addRoute(new StaticRoute);
   19 $Router->addRoute(new DynamicRoute);
   20 $content = $Router->route();
   21 $Timer->stop('Load controller');
   22 
   23 $content = Framework::addEnviroment($content);
   24 
   25 if ($Conf->CNF->site->gzip_enabled) {
   26     header('Content-Encoding: gzip');
   27 
   28     $gzip_size = strlen($content);
   29     $gzip_crc = crc32($content);
   30 
   31     $content = gzcompress($content, 9);
   32     $content = substr($content, 0, strlen($content) - 4);
   33 
   34     $content = "\x1f\x8b\x08\x00\x00\x00\x00\x00"
   35              . $content
   36              . pack('V', $gzip_crc)
   37              . pack('V', $gzip_size);
   38 }
   39 
   40 header('X-Powered-By: Irokez 0.8 alpha');
   41 header('X-Stat-Generated: ' . $Cherokee->Timer->getTime());
   42 header('X-Stat-Database: ' . (Framework::has('db') ? 'yes' : 'no'));
   43 
   44 echo $content;
   45 ?>

support@irokez.org
Subversion  TortoiseSVN  ViewVC