Changeset 4578 for trunk/core/bootstrap/clansuite.application.php
- Timestamp:
- 08/15/10 18:45:12 (22 months ago)
- File:
-
- 1 edited
-
trunk/core/bootstrap/clansuite.application.php (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/bootstrap/clansuite.application.php
r4568 r4578 28 28 * 29 29 * @license GNU/GPL v2 or (at your option) any later version, see "/doc/LICENSE". 30 *31 30 * @author Jens-André Koch <vain@clansuite.com> 32 31 * @copyright Copyleft: All rights reserved. Jens-André Koch (2005 - onwards) 33 *34 32 * @link http://www.clansuite.com 35 * @link http://gna.org/projects/clansuite 36 * 33 * 37 34 * @version SVN: $Id$ 38 35 */ … … 77 74 * @var STARTTIME shows Application Starttime 78 75 */ 79 define('STARTTIME', microtime(1) );76 define('STARTTIME', microtime(1), false); 80 77 81 78 self::initialize_Loader(); … … 85 82 self::initialize_Debug(); 86 83 self::initialize_Version(); 87 self::initialize_ Locale();84 self::initialize_Timezone(); 88 85 self::initialize_Eventdispatcher(); 89 86 self::initialize_Errorhandling(); … … 110 107 if(version_compare(PHP_VERSION, $REQUIRED_PHP_VERSION, '<') === true) 111 108 { 112 die('Your PHP Version is <b><font color="#FF0000">' . PHP_VERSION . '</font></b>! Clansuite requires PHP Version <b><font color="#4CC417">' . $REQUIRED_PHP_VERSION . '</font></b>!'); 109 die('Your PHP Version is <b><font color="#FF0000">' . PHP_VERSION . '</font></b>! 110 Clansuite requires PHP Version <b><font color="#4CC417">' . $REQUIRED_PHP_VERSION . '</font></b>!'); 113 111 } 114 112 unset($REQUIRED_PHP_VERSION); … … 169 167 * ================================================ 170 168 */ 171 ini_set('short_open_tag', 'off');172 ini_set('arg_separator.input', '&');173 ini_set('arg_separator.output', '&');169 ini_set('short_open_tag', 'off'); 170 ini_set('arg_separator.input', '&'); 171 ini_set('arg_separator.output', '&'); 174 172 175 173 if(extension_loaded('mbstring') == true) … … 187 185 if(intval(ini_get('memory_limit')) < 16) 188 186 { 189 ini_set('memory_limit', '16M');187 ini_set('memory_limit', '16M'); 190 188 } 191 189 } … … 213 211 * @var DS is a shorthand for DIRECTORY_SEPARATOR 214 212 */ 215 define('DS', DIRECTORY_SEPARATOR );213 define('DS', DIRECTORY_SEPARATOR, false); 216 214 217 215 /** 218 216 * @var PS is a shorthand for PATH_SEPARATOR 219 217 */ 220 define('PS', PATH_SEPARATOR );218 define('PS', PATH_SEPARATOR, false); 221 219 222 220 /** 223 221 * @var HTML Break + Carriage Return "<br />\r\n" 224 222 */ 225 define('NL', "<br />\r\n" );223 define('NL', "<br />\r\n", false); 226 224 227 225 /** 228 226 * @var Carriage Return "\n" 229 227 */ 230 define('CR', "\n" );228 define('CR', "\n", false); 231 229 232 230 /** 233 231 * @var Carriage Return and Tabulator "\n\t" 234 232 */ 235 define('CRT', "\n\t" );233 define('CRT', "\n\t", false); 236 234 237 235 /** … … 244 242 * @var Purpose of ROOT is to provide the absolute path to the current working dir of clansuite 245 243 */ 246 define('ROOT', getcwd() . DS );244 define('ROOT', getcwd() . DS, false); 247 245 #define('ROOT', realpath('../')); 248 246 … … 250 248 * @var ROOT_MOD Root path of the modules directory (with trailing slash) 251 249 */ 252 define('ROOT_MOD', ROOT . self::$config['paths']['mod_folder'] . DS );250 define('ROOT_MOD', ROOT . self::$config['paths']['mod_folder'] . DS, false); 253 251 254 252 /** 255 253 * @var Root path of the themes directory (with trailing slash) 256 254 */ 257 define('ROOT_THEMES', ROOT . self::$config['paths']['themes_folder'] . DS );255 define('ROOT_THEMES', ROOT . self::$config['paths']['themes_folder'] . DS, false); 258 256 259 257 /** 260 258 * @var Root path of the languages directory (with trailing slash) 261 259 */ 262 define('ROOT_LANGUAGES', ROOT . self::$config['paths']['language_folder'] . DS );260 define('ROOT_LANGUAGES', ROOT . self::$config['paths']['language_folder'] . DS, false); 263 261 264 262 /** 265 263 * @var Root path of the core directory (with trailing slash) 266 264 */ 267 define('ROOT_CORE', ROOT . self::$config['paths']['core_folder'] . DS );265 define('ROOT_CORE', ROOT . self::$config['paths']['core_folder'] . DS, false); 268 266 269 267 /** 270 268 * @var Root path of the libraries directory (with trailing slash) 271 269 */ 272 define('ROOT_LIBRARIES', ROOT . self::$config['paths']['libraries_folder'] . DS );270 define('ROOT_LIBRARIES', ROOT . self::$config['paths']['libraries_folder'] . DS, false); 273 271 274 272 /** 275 273 * @var Root path of the upload directory (with trailing slash) 276 274 */ 277 define('ROOT_UPLOAD', ROOT . self::$config['paths']['upload_folder'] . DS );275 define('ROOT_UPLOAD', ROOT . self::$config['paths']['upload_folder'] . DS, false); 278 276 279 277 /** 280 278 * @var Root path of the logs directory (with trailing slash) 281 279 */ 282 define('ROOT_LOGS', ROOT . self::$config['paths']['logfiles_folder'] . DS );280 define('ROOT_LOGS', ROOT . self::$config['paths']['logfiles_folder'] . DS, false); 283 281 284 282 /** 285 283 * @var Root path of the cache directory (with trailing slash) 286 284 */ 287 define('ROOT_CACHE', ROOT . 'cache' . DS );285 define('ROOT_CACHE', ROOT . 'cache' . DS, false); 288 286 289 287 /** 290 288 * @var Root path of the config directory (with trailing slash) 291 289 */ 292 define('ROOT_CONFIG', ROOT . 'configuration' . DS );290 define('ROOT_CONFIG', ROOT . 'configuration' . DS, false); 293 291 294 292 /** … … 297 295 if(isset($_SERVER['HTTPS']) and mb_strtolower($_SERVER['HTTPS']) == 'on') 298 296 { 299 define('PROTOCOL', 'https://' );297 define('PROTOCOL', 'https://', false); 300 298 } 301 299 else 302 300 { 303 301 304 define('PROTOCOL', 'http://' );302 define('PROTOCOL', 'http://', false); 305 303 } 306 304 … … 308 306 * @var SERVER_URL 309 307 */ 310 define('SERVER_URL', PROTOCOL . $_SERVER['SERVER_NAME'] );308 define('SERVER_URL', PROTOCOL . $_SERVER['SERVER_NAME'], false); 311 309 312 310 /** … … 315 313 if(dirname($_SERVER['PHP_SELF']) == '\\') 316 314 { 317 define('WWW_ROOT', SERVER_URL );315 define('WWW_ROOT', SERVER_URL, false); 318 316 } 319 317 else 320 318 { 321 define('WWW_ROOT', SERVER_URL . dirname($_SERVER['PHP_SELF']) );319 define('WWW_ROOT', SERVER_URL . dirname($_SERVER['PHP_SELF']), false); 322 320 } 323 321 … … 325 323 * @var WWW_ROOT_THEMES defines the themes folder 326 324 */ 327 define('WWW_ROOT_THEMES', WWW_ROOT . '/' . self::$config['paths']['themes_folder'] );325 define('WWW_ROOT_THEMES', WWW_ROOT . '/' . self::$config['paths']['themes_folder'], false); 328 326 329 327 /** 330 328 * @var WWW_ROOT_THEMES defines the themes/core folder 331 329 */ 332 define('WWW_ROOT_THEMES_CORE', WWW_ROOT . '/' . self::$config['paths']['themes_folder'] . '/core' );330 define('WWW_ROOT_THEMES_CORE', WWW_ROOT . '/' . self::$config['paths']['themes_folder'] . '/core', false); 333 331 334 332 /** … … 345 343 ROOT_LIBRARIES . 'PEAR' . DS 346 344 ); 347 set_include_path(implode($paths, PATH_SEPARATOR) . PATH_SEPARATOR . get_include_path()); # attach original include paths 345 346 # attach original include paths 347 set_include_path(implode($paths, PS) . PS . get_include_path()); 348 348 unset($paths); 349 349 } … … 368 368 * @var Debug-Mode Constant is set via config setting ['error']['debug'] 369 369 */ 370 define('DEBUG', (bool) self::$config['error']['debug'] );370 define('DEBUG', (bool) self::$config['error']['debug'], false); 371 371 372 372 # If Debug is enabled, set FULL error_reporting, else DISABLE it completely … … 381 381 * @var Development-Mode is set via config setting ['error']['development'] 382 382 */ 383 define('DEVELOPMENT', (bool) self::$config['error']['development'] );383 define('DEVELOPMENT', (bool) self::$config['error']['development'], false); 384 384 385 385 /** … … 395 395 * @var XDebug and set it's value via the config setting ['error']['xdebug'] 396 396 */ 397 define('XDEBUG', (bool) self::$config['error']['xdebug'] );397 define('XDEBUG', (bool) self::$config['error']['xdebug'], false); 398 398 399 399 # If XDebug is enabled, load xdebug helpers and start the debug/tracing … … 401 401 { 402 402 include ROOT_CORE . 'debug/xdebug.core.php'; 403 Clansuite_XDebug::start_ Xdebug();403 Clansuite_XDebug::start_xdebug(); 404 404 } 405 405 } 406 406 else # application is in live/production mode. errors are not shown, but logged to file! 407 407 { 408 ini_set('log_errors', true); # enable error_logging 409 ini_set('display_errors', false); # do not display errors in the browser 408 # enable error_logging 409 ini_set('log_errors', true); 410 # do not display errors in the browser 411 ini_set('display_errors', false); 412 # log only certain errors 410 413 error_reporting(E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR); 411 #error_reporting(0); # do not report errors 412 ini_set('error_log', ROOT_LOGS . 'clansuite_errorlog.txt'); # write to errorlog 414 # do not report any errors 415 #error_reporting(0); 416 # write to errorlog 417 ini_set('error_log', ROOT_LOGS . 'clansuite_errorlog.txt'); 418 # @todo use logger instead of error_log() 413 419 } 414 420 } … … 454 460 private static function initialize_DependecyInjection() 455 461 { 456 # Setup Phemto 457 include ROOT_LIBRARIES.'phemto/phemto.php'; 462 include ROOT_LIBRARIES . 'phemto/phemto.php'; 458 463 self::$injector = new Phemto(); 459 464 } … … 474 479 'Clansuite_Inputfilter', 475 480 'Clansuite_Localization', 476 'Clansuite_User' 481 'Clansuite_User', 482 'Clansuite_Session', 483 'Clansuite_Router', 477 484 ); 478 485 … … 491 498 # define prefilters to load 492 499 self::$prefilter_classes = array( 493 'Clansuite_Filter_PhpDebugConsole', # let the debug console be first 500 # let the debug console always be first 501 'Clansuite_Filter_PhpDebugConsole', 494 502 'Clansuite_Filter_Maintenance', 495 503 'Clansuite_Filter_GetUser', 496 504 #'Clansuite_Filter_Session_Security', 505 'Clansuite_Filter_Routing', 497 506 'Clansuite_Filter_LanguageViaGet', 498 507 'Clansuite_Filter_ThemeViaGet', 499 508 'Clansuite_Filter_SetModuleLanguage', 500 #'Clansuite_Filter_SetBreadcrumbs',501 509 'Clansuite_Filter_StartupChecks', 502 510 'Clansuite_Filter_Statistics' … … 557 565 } 558 566 559 # Router560 $router = new Clansuite_Router($request::getRequestURI(), self::$config['defaults']);561 562 567 # Take off. 563 $clansuite->processRequest($router); 568 $clansuite->processRequest(); 569 } 570 571 /** 572 * Starts a new Session and Userobject 573 */ 574 private static function start_Session() 575 { 576 # Initialize Doctrine before session start, because session is written to database 577 new Clansuite_Doctrine(self::$config['database']); 578 579 # Initialize Session 580 self::$injector->create('Clansuite_Session'); 581 582 # register the session-depending User-Object manually 583 self::$injector->instantiate('Clansuite_User'); 584 } 585 586 /** 587 * ================================================ 588 * Clansuite Version Information 589 * ================================================ 590 */ 591 private static function initialize_Version() 592 { 593 include ROOT_CORE . 'bootstrap/clansuite.version.php'; 594 Clansuite_Version::setVersionInformation(); 564 595 } 565 596 … … 572 603 * (3) putenv(TZ=) 573 604 * 574 * PHP 5.1 strftime() and date-calculation bugfix by setting the timezone575 605 * For a lot more timezones look in the Appendix H of the PHP Manual 576 606 * @link http://php.net/manual/en/timezones.php 577 607 * @todo make $timezone configurable by user (small dropdown) or autodetected from user 578 608 */ 579 private static function initialize_ Locale()609 private static function initialize_Timezone() 580 610 { 581 611 # apply timezone defensivly … … 597 627 { 598 628 # set date formating via config 599 define('DATE_FORMAT', self::$config['locale']['dateformat']); 600 } 601 } 602 603 /** 604 * Starts a new Session and Userobject 605 */ 606 private static function start_Session() 607 { 608 # Initialize Doctrine before session start, because session is written to database 609 new Clansuite_Doctrine(self::$config['database']); 610 611 # Initialize Session 612 new Clansuite_Session(self::$config, self::$injector->instantiate('Clansuite_HttpRequest')); 613 614 # instantiate the Locale 615 self::$injector->instantiate('Clansuite_Localization'); 616 617 # register the session-depending User-Object manually 618 self::$injector->instantiate('Clansuite_User'); 619 } 620 621 /** 622 * ================================================ 623 * Clansuite Version Information 624 * ================================================ 625 */ 626 private static function initialize_Version() 627 { 628 include ROOT_CORE . 'bootstrap/clansuite.version.php'; 629 define('DATE_FORMAT', self::$config['locale']['dateformat'], false); 630 } 629 631 } 630 632
Note: See TracChangeset
for help on using the changeset viewer.
