Skip to content
Snippets Groups Projects
Select Git revision
  • d7fd18ff77555d99706fae57413b33bd3c3b550f
  • master default protected
2 results

script.js

Blame
  • index.php 1.43 KiB
    <?php
    
    $startTime = microtime(true);
    
    define('APPLICATION_DIR', '../application');
    define('MODULES_DIR', APPLICATION_DIR . '/modules');
    
    set_include_path(get_include_path() . PATH_SEPARATOR . '../library');
    require_once 'Zend/Loader.php';
    Zend_Loader::registerAutoload('Unl_Loader');
    
    $config = new Zend_Config_Ini(APPLICATION_DIR . '/config.ini');
    
    $pearPath = $config->pear->include_path;
    if ($pearPath) {
        set_include_path(get_include_path() . PATH_SEPARATOR . $pearPath);
    }
    
    Zend_Session::setOptions($config->session->toArray());
    
    $cache = Zend_Cache::factory(
        'Core',
        'Memcached',
        array('lifetime' => 60, 'automatic_serialization' => true),
        array('servers' => array('host' => 'localhost', 'port' => 11211))
    );
    Zend_Registry::set('cache', $cache);
    
    Zend_Session::start();
    
    $db = Zend_Db::factory($config->database);
    $db->query('SET NAMES utf8');
    Zend_Registry::set('db', $db);
    $db->getProfiler()->setEnabled(true);
    
    Zend_Layout::startMvc();
    $layout = Zend_Layout::getMvcInstance();
    $layout->setLayoutPath(MODULES_DIR . '/default/views/scripts');
    
    $front = Zend_Controller_Front::getInstance();
    $front->addModuleDirectory(MODULES_DIR);
    $front->setBaseUrl('/~tsteiner/CREQ3');
    $front->dispatch();
    
    /*
    echo '<!-- Query Count:  ' . $db->getProfiler()->getTotalNumQueries() . "\n";
    echo '     Query Time:   ' . $db->getProfiler()->getTotalElapsedSecs() . "\n";
    echo '     Request Time: ' . (microtime(true) - $startTime) . ' seconds -->';
    */