Ignore:
Timestamp:
08/15/10 18:45:12 (22 months ago)
Author:
vain
Message:
  • several changes to copyright, router, bootstrap, frontcontroller and various other files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/bootstrap/clansuite.application.php

    r4568 r4578  
    2828    * 
    2929    * @license    GNU/GPL v2 or (at your option) any later version, see "/doc/LICENSE". 
    30     * 
    3130    * @author     Jens-André Koch <vain@clansuite.com> 
    3231    * @copyright  Copyleft: All rights reserved. Jens-André Koch (2005 - onwards) 
    33     * 
    3432    * @link       http://www.clansuite.com 
    35     * @link       http://gna.org/projects/clansuite 
    36     * 
     33    *  
    3734    * @version    SVN: $Id$ 
    3835    */ 
     
    7774         * @var STARTTIME shows Application Starttime 
    7875         */ 
    79         define('STARTTIME', microtime(1)); 
     76        define('STARTTIME', microtime(1), false); 
    8077 
    8178        self::initialize_Loader(); 
     
    8582        self::initialize_Debug(); 
    8683        self::initialize_Version(); 
    87         self::initialize_Locale(); 
     84        self::initialize_Timezone(); 
    8885        self::initialize_Eventdispatcher(); 
    8986        self::initialize_Errorhandling(); 
     
    110107        if(version_compare(PHP_VERSION, $REQUIRED_PHP_VERSION, '<') === true) 
    111108        { 
    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>!'); 
    113111        } 
    114112        unset($REQUIRED_PHP_VERSION); 
     
    169167         *  ================================================ 
    170168         */ 
    171         ini_set('short_open_tag',               'off'); 
    172         ini_set('arg_separator.input',          '&amp;'); 
    173         ini_set('arg_separator.output',         '&amp;'); 
     169        ini_set('short_open_tag', 'off'); 
     170        ini_set('arg_separator.input', '&amp;'); 
     171        ini_set('arg_separator.output', '&amp;'); 
    174172 
    175173        if(extension_loaded('mbstring') == true) 
     
    187185        if(intval(ini_get('memory_limit')) < 16) 
    188186        { 
    189             ini_set('memory_limit',             '16M' ); 
     187            ini_set('memory_limit', '16M'); 
    190188        } 
    191189    } 
     
    213211         * @var DS is a shorthand for DIRECTORY_SEPARATOR 
    214212         */ 
    215         define('DS', DIRECTORY_SEPARATOR); 
     213        define('DS', DIRECTORY_SEPARATOR, false); 
    216214 
    217215        /** 
    218216         * @var PS is a shorthand for PATH_SEPARATOR 
    219217         */ 
    220         define('PS', PATH_SEPARATOR); 
     218        define('PS', PATH_SEPARATOR, false); 
    221219 
    222220        /** 
    223221         * @var HTML Break + Carriage Return "<br />\r\n" 
    224222         */ 
    225         define('NL', "<br />\r\n"); 
     223        define('NL', "<br />\r\n", false); 
    226224 
    227225        /** 
    228226         * @var Carriage Return "\n" 
    229227         */ 
    230         define('CR', "\n"); 
     228        define('CR', "\n", false); 
    231229 
    232230        /** 
    233231         * @var Carriage Return and Tabulator "\n\t" 
    234232         */ 
    235         define('CRT', "\n\t"); 
     233        define('CRT', "\n\t", false); 
    236234 
    237235        /** 
     
    244242         * @var Purpose of ROOT is to provide the absolute path to the current working dir of clansuite 
    245243         */ 
    246         define('ROOT', getcwd() . DS); 
     244        define('ROOT', getcwd() . DS, false); 
    247245        #define('ROOT',  realpath('../')); 
    248246 
     
    250248         * @var ROOT_MOD Root path of the modules directory (with trailing slash) 
    251249         */ 
    252         define('ROOT_MOD', ROOT . self::$config['paths']['mod_folder'] . DS); 
     250        define('ROOT_MOD', ROOT . self::$config['paths']['mod_folder'] . DS, false); 
    253251 
    254252        /** 
    255253         * @var Root path of the themes directory (with trailing slash) 
    256254         */ 
    257         define('ROOT_THEMES', ROOT . self::$config['paths']['themes_folder'] . DS); 
     255        define('ROOT_THEMES', ROOT . self::$config['paths']['themes_folder'] . DS, false); 
    258256 
    259257        /** 
    260258         * @var Root path of the languages directory (with trailing slash) 
    261259         */ 
    262         define('ROOT_LANGUAGES', ROOT . self::$config['paths']['language_folder'] . DS); 
     260        define('ROOT_LANGUAGES', ROOT . self::$config['paths']['language_folder'] . DS, false); 
    263261 
    264262        /** 
    265263         * @var Root path of the core directory (with trailing slash) 
    266264         */ 
    267         define('ROOT_CORE', ROOT . self::$config['paths']['core_folder'] . DS); 
     265        define('ROOT_CORE', ROOT . self::$config['paths']['core_folder'] . DS, false); 
    268266 
    269267        /** 
    270268         * @var Root path of the libraries directory (with trailing slash) 
    271269         */ 
    272         define('ROOT_LIBRARIES', ROOT . self::$config['paths']['libraries_folder'] . DS); 
     270        define('ROOT_LIBRARIES', ROOT . self::$config['paths']['libraries_folder'] . DS, false); 
    273271 
    274272        /** 
    275273         * @var Root path of the upload directory (with trailing slash) 
    276274         */ 
    277         define('ROOT_UPLOAD', ROOT . self::$config['paths']['upload_folder'] . DS); 
     275        define('ROOT_UPLOAD', ROOT . self::$config['paths']['upload_folder'] . DS, false); 
    278276 
    279277        /** 
    280278         * @var Root path of the logs directory (with trailing slash) 
    281279         */ 
    282         define('ROOT_LOGS', ROOT . self::$config['paths']['logfiles_folder'] . DS); 
     280        define('ROOT_LOGS', ROOT . self::$config['paths']['logfiles_folder'] . DS, false); 
    283281 
    284282        /** 
    285283         * @var Root path of the cache directory (with trailing slash) 
    286284         */ 
    287         define('ROOT_CACHE', ROOT . 'cache' . DS); 
     285        define('ROOT_CACHE', ROOT . 'cache' . DS, false); 
    288286 
    289287        /** 
    290288         * @var Root path of the config directory (with trailing slash) 
    291289         */ 
    292         define('ROOT_CONFIG', ROOT . 'configuration' . DS); 
     290        define('ROOT_CONFIG', ROOT . 'configuration' . DS, false); 
    293291 
    294292        /** 
     
    297295        if(isset($_SERVER['HTTPS']) and mb_strtolower($_SERVER['HTTPS']) == 'on') 
    298296        { 
    299             define('PROTOCOL', 'https://'); 
     297            define('PROTOCOL', 'https://', false); 
    300298        } 
    301299        else 
    302300        { 
    303301 
    304             define('PROTOCOL', 'http://'); 
     302            define('PROTOCOL', 'http://', false); 
    305303        } 
    306304 
     
    308306         * @var SERVER_URL 
    309307         */ 
    310         define('SERVER_URL', PROTOCOL . $_SERVER['SERVER_NAME']); 
     308        define('SERVER_URL', PROTOCOL . $_SERVER['SERVER_NAME'], false); 
    311309 
    312310        /** 
     
    315313        if(dirname($_SERVER['PHP_SELF']) == '\\') 
    316314        { 
    317             define('WWW_ROOT', SERVER_URL); 
     315            define('WWW_ROOT', SERVER_URL, false); 
    318316        } 
    319317        else 
    320318        { 
    321             define('WWW_ROOT', SERVER_URL . dirname($_SERVER['PHP_SELF'])); 
     319            define('WWW_ROOT', SERVER_URL . dirname($_SERVER['PHP_SELF']), false); 
    322320        } 
    323321 
     
    325323         * @var WWW_ROOT_THEMES defines the themes folder 
    326324         */ 
    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); 
    328326 
    329327        /** 
    330328         * @var WWW_ROOT_THEMES defines the themes/core folder 
    331329         */ 
    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); 
    333331 
    334332        /** 
     
    345343            ROOT_LIBRARIES . 'PEAR' . DS 
    346344        ); 
    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()); 
    348348        unset($paths); 
    349349    } 
     
    368368         * @var Debug-Mode Constant is set via config setting ['error']['debug'] 
    369369         */ 
    370         define('DEBUG', (bool) self::$config['error']['debug']); 
     370        define('DEBUG', (bool) self::$config['error']['debug'], false); 
    371371 
    372372        # If Debug is enabled, set FULL error_reporting, else DISABLE it completely 
     
    381381             * @var Development-Mode is set via config setting ['error']['development'] 
    382382             */ 
    383             define('DEVELOPMENT', (bool) self::$config['error']['development']); 
     383            define('DEVELOPMENT', (bool) self::$config['error']['development'], false); 
    384384 
    385385            /** 
     
    395395             * @var XDebug and set it's value via the config setting ['error']['xdebug'] 
    396396             */ 
    397             define('XDEBUG', (bool) self::$config['error']['xdebug']); 
     397            define('XDEBUG', (bool) self::$config['error']['xdebug'], false); 
    398398 
    399399            # If XDebug is enabled, load xdebug helpers and start the debug/tracing 
     
    401401            { 
    402402                include ROOT_CORE . 'debug/xdebug.core.php'; 
    403                 Clansuite_XDebug::start_Xdebug(); 
     403                Clansuite_XDebug::start_xdebug(); 
    404404            } 
    405405        } 
    406406        else # application is in live/production mode. errors are not shown, but logged to file! 
    407407        { 
    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 
    410413            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() 
    413419        } 
    414420    } 
     
    454460    private static function initialize_DependecyInjection() 
    455461    { 
    456         # Setup Phemto 
    457         include ROOT_LIBRARIES.'phemto/phemto.php'; 
     462        include ROOT_LIBRARIES . 'phemto/phemto.php'; 
    458463        self::$injector = new Phemto(); 
    459464    } 
     
    474479                              'Clansuite_Inputfilter', 
    475480                              'Clansuite_Localization', 
    476                               'Clansuite_User' 
     481                              'Clansuite_User', 
     482                              'Clansuite_Session', 
     483                              'Clansuite_Router', 
    477484                             ); 
    478485 
     
    491498        # define prefilters to load 
    492499        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', 
    494502                                         'Clansuite_Filter_Maintenance', 
    495503                                         'Clansuite_Filter_GetUser', 
    496504                                         #'Clansuite_Filter_Session_Security', 
     505                                         'Clansuite_Filter_Routing', 
    497506                                         'Clansuite_Filter_LanguageViaGet', 
    498507                                         'Clansuite_Filter_ThemeViaGet', 
    499508                                         'Clansuite_Filter_SetModuleLanguage', 
    500                                          #'Clansuite_Filter_SetBreadcrumbs', 
    501509                                         'Clansuite_Filter_StartupChecks', 
    502510                                         'Clansuite_Filter_Statistics' 
     
    557565        } 
    558566 
    559         # Router 
    560         $router = new Clansuite_Router($request::getRequestURI(), self::$config['defaults']); 
    561  
    562567        # 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(); 
    564595    } 
    565596 
     
    572603     *      (3) putenv(TZ=) 
    573604     * 
    574      * PHP 5.1 strftime() and date-calculation bugfix by setting the timezone 
    575605     * For a lot more timezones look in the Appendix H of the PHP Manual 
    576606     * @link http://php.net/manual/en/timezones.php 
    577607     * @todo make $timezone configurable by user (small dropdown) or autodetected from user 
    578608     */ 
    579     private static function initialize_Locale() 
     609    private static function initialize_Timezone() 
    580610    { 
    581611        # apply timezone defensivly 
     
    597627        { 
    598628            # 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        } 
    629631    } 
    630632 
Note: See TracChangeset for help on using the changeset viewer.