예제 #1
0
 function test_should_balk_upon_file_not_found()
 {
     $exception_catched = false;
     // workaround for different phpunit versions, i.e. 3.7 and > 4.0
     // the exceptions thrown differ in these versions
     try {
         StudipFileloader::load('var://pathto/not-there.php', $container);
     } catch (PHPUnit_Framework_Error_Warning $e) {
         $exception_catched = true;
     } catch (PHPUnit_Framework_Exception $e) {
         $exception_catched = true;
     }
     $this->assertTrue($exception_catched);
 }
예제 #2
0
파일: bootstrap.php 프로젝트: ratbird/hope
 $trails_classes = array('Trails_Dispatcher', 'Trails_Response', 'Trails_Controller', 'Trails_Inflector', 'Trails_Flash', 'Trails_Exception', 'Trails_DoubleRenderError', 'Trails_MissingFile', 'Trails_RoutingError', 'Trails_UnknownAction', 'Trails_UnknownController', 'Trails_SessionRequiredException');
 StudipAutoloader::addClassLookup($trails_classes, $GLOBALS['STUDIP_BASE_PATH'] . '/vendor/trails/trails.php');
 StudipAutoloader::addClassLookup('StudipController', $GLOBALS['STUDIP_BASE_PATH'] . '/app/controllers/studip_controller.php');
 StudipAutoloader::addClassLookup('AuthenticatedController', $GLOBALS['STUDIP_BASE_PATH'] . '/app/controllers/authenticated_controller.php');
 StudipAutoloader::addClassLookup('PluginController', $GLOBALS['STUDIP_BASE_PATH'] . '/app/controllers/plugin_controller.php');
 // Vendor
 StudipAutoloader::addClassLookups(array('PasswordHash' => $GLOBALS['STUDIP_BASE_PATH'] . '/vendor/phpass/PasswordHash.php', 'TCPDF' => $GLOBALS['STUDIP_BASE_PATH'] . '/vendor/tcpdf/tcpdf.php'));
 StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/vendor/mishal-iless/lib/ILess', 'ILess');
 // sample the request time and number of db queries every tenth time
 register_shutdown_function(function ($timer) {
     $timer('core.request_time', 0.1);
     $query_count = DBManager::get()->query_count;
     Metrics::gauge('core.database.queries', $query_count, 0.1);
 }, Metrics::startTimer());
 require 'lib/phplib/page_open.php';
 StudipFileloader::load('config_local.inc.php', $GLOBALS, compact('STUDIP_BASE_PATH'));
 require 'config.inc.php';
 require_once 'lib/functions.php';
 require_once 'lib/language.inc.php';
 require_once 'lib/visual.inc.php';
 require_once 'lib/deputies_functions.inc.php';
 //setup default logger
 Log::get()->setHandler($GLOBALS['TMP_PATH'] . '/studip.log');
 if (Studip\ENV == 'development') {
     Log::get()->setLogLevel(Log::DEBUG);
 } else {
     Log::get()->setLogLevel(Log::ERROR);
 }
 // set default time zone
 date_default_timezone_set($DEFAULT_TIMEZONE ?: @date_default_timezone_get());
 // set assets url