Beispiel #1
0
 static function main()
 {
     Zend_Registry::set('config', new Strass_Config_Php('strass', array()));
     Zend_Registry::set('acl', new Strass_Installer_FakeAcl());
     Strass_Cache::setup();
     try {
         $fc = Zend_Controller_Front::getInstance();
         $fc->setRequest(new Strass_Controller_Request_Http());
         $fc->setParam('useDefaultControllerAlways', true);
         $fc->setParam('noViewRenderer', true);
         $fc->setModuleControllerDirectoryName('Installer');
         $fc->addControllerDirectory(Strass::getPrefix() . 'include/Strass/Installer/Controller', 'Strass');
         $fc->setDefaultModule('Strass');
         $fc->registerPlugin(new Strass_Controller_Plugin_Error());
         $fc->dispatch();
         Zend_Session::writeClose();
     } catch (Exception $e) {
         // affichage complet des exceptions non intercepté par le controlleur. À améliorer.
         $msg = ":(\n\n";
         $msg .= $e->getMessage() . "\n\n";
         $msg .= " à " . $e->getFile() . ":" . $e->getLine() . "\n\n";
         $msg .= str_replace('#', '<br/>#', $e->getTraceAsString()) . "\n";
         Orror::kill(strip_tags($msg));
     }
 }
Beispiel #2
0
 static function main()
 {
     Strass_Cache::setup();
     $db = Strass_Db::setup();
     Zend_Registry::set('acl', new Strass_Installer_FakeAcl());
     self::run($db);
 }
Beispiel #3
0
 static function run()
 {
     Zend_Registry::set('config', new Strass_Config_Php('strass'));
     Strass_Cache::setup();
     $fc = Zend_Controller_Front::getInstance();
     $request = new Strass_Controller_Request_Http();
     $fc->setRequest($request);
     $routeur = $fc->getRouter();
     $routeur->removeDefaultRoutes();
     $p = '([[:alpha:]]+)';
     $f = '(xhtml|ics|vcf|rss|atom|pdf|tex|txt|od[ts]|csv)';
     $vars = array('controller' => array($p, 'unites'), 'action' => array($p, 'index'), 'format' => array($f, 'html'), 'annee' => array('([[:digit:]]{4})', null));
     $pattern = '[%controller%[/%action%][.%format%][/%annee%]*]';
     if ($prefix = @getenv('STRASS_ROUTE_PREFIX')) {
         $pattern = $prefix . $pattern;
     }
     $opattern = null;
     $route = new Strass_Controller_Router_Route_Uri($vars, $pattern, $opattern);
     $routeur->addRoute('default', $route);
     $fc->setParam('noViewRenderer', true);
     $fc->setModuleControllerDirectoryName('Controller');
     $fc->addControllerDirectory(self::getPrefix() . 'include/Strass/Controller', 'Strass');
     Zend_Controller_Action_HelperBroker::addPrefix('Strass_Controller_Action_Helper');
     $fc->setDefaultModule('Strass');
     // greffons
     $fc->registerPlugin(new Strass_Controller_Plugin_Error());
     $fc->registerPlugin(new Strass_Controller_Plugin_Db());
     $fc->registerPlugin(new Strass_Controller_Plugin_Auth());
     $fc->dispatch();
     self::saveSession();
 }
Beispiel #4
0
<?php

$_ENV['STRASS_UNIT_TEST'] = 1;
putenv('STRASS_UNIT_TEST=1');
$paths = explode(':', get_include_path());
array_shift($paths);
array_unshift($paths, '.', dirname(dirname(__FILE__)) . '/../include');
set_include_path(implode(':', $paths));
require_once 'Strass.php';
require_once 'Orror.php';
chdir(realpath(getenv('STRASS_ROOT')));
Strass::bootstrap();
Orror::init(E_ALL | E_STRICT);
Strass_Cache::setup();
Strass_Db::setup();
Zend_Registry::set('config', new Zend_Config(array(), true));