Skip to content
Snippets Groups Projects
Select Git revision
  • 2cd23f099196e98bb645b04a9581311558bd8b5f
  • master default
  • disable-new-requests
  • fix-bulletin-view-missing-notes-error
  • add-missing-queue-managers
  • projects-task-53
  • projects-task-51
  • projects-task-43
  • projects-task-24
  • projects-task-31
  • projects-task-32
  • projects-task-8
  • project-setup-docs
  • projects-task-28
  • projects-task-27
  • projects-task-9
  • projects-task-7
  • mass-update-course-codes-in-sections
  • wdn-four
  • learning-outcomes
  • additional-bulletin-pages
  • svn-redesign
  • svn-popups
  • svn-trunk
  • svn-performance
  • svn-tim
26 results

index.php

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 -->';
    */