src/RocknRoot/StrayFw/Bootstrap.php
public static function run()
    {
        if (self::$isInit === false) {
            throw new BadUse('bootstrap doesn\'t seem to have been initialized');
        }
        foreach (self::$namespaces as $name => $path) {
            if (is_readable($path . DIRECTORY_SEPARATOR . 'init.php') === true) {
                require $path . DIRECTORY_SEPARATOR . 'init.php';
            } elseif (stripos($path, 'vendor') === false || stripos($path, 'vendor') == strlen($path) - strlen('vendor')) {
                Logger::get()->error('namespace "' . $name . '" doesn\'t have an init.php');
            }
        }
        if (defined('STRAY_IS_CLI') === true && constant('STRAY_IS_CLI') === true) {
            Console::run();
        } elseif (defined('STRAY_IS_HTTP') === true && constant('STRAY_IS_HTTP') === true) {
            if (count(self::$applications) == 0) {
                throw new BadUse('no application has been registered');
            }
            Http::run();
        } else {
            throw new BadUse('unknown mode, not CLI_IS_CLI nor STRAY_IS_HTTP');
        }
    }
public static function run()
    {
        if (self::$isInit === false) {
            throw new BadUse('bootstrap doesn\'t seem to have been initialized');
        }
        foreach (self::$namespaces as $name => $path) {
            if (is_readable($path . DIRECTORY_SEPARATOR . 'init.php') === true) {
                require $path . DIRECTORY_SEPARATOR . 'init.php';
            } elseif (stripos($path, 'vendor') === false || stripos($path, 'vendor') == strlen($path) - strlen('vendor')) {
                Logger::get()->error('namespace "' . $name . '" doesn\'t have an init.php');
            }
        }
        if (defined('STRAY_IS_CLI') === true && constant('STRAY_IS_CLI') === true) {
            Console::run();
        } elseif (defined('STRAY_IS_HTTP') === true && constant('STRAY_IS_HTTP') === true) {
            if (count(self::$applications) == 0) {
                throw new BadUse('no application has been registered');
            }
            Http::run();
        } else {
            throw new BadUse('unknown mode, not CLI_IS_CLI nor STRAY_IS_HTTP');
        }
    }
public static function run ( ) { if ( self :: $ isInit === false ) { throw new BadUse ( 'bootstrap doesn\'t seem to have been initialized' ) ; } foreach ( self :: $ namespaces as $ name => $ path ) { if ( is_readable ( $ path . DIRECTORY_SEPARATOR . 'init.php' ) === true ) { require $ path . DIRECTORY_SEPARATOR . 'init.php' ; } elseif ( stripos ( $ path , 'vendor' ) === false || stripos ( $ path , 'vendor' ) == strlen ( $ path ) - strlen ( 'vendor' ) ) { Logger :: get ( ) -> error ( 'namespace "' . $ name . '" doesn\'t have an init.php' ) ; } } if ( defined ( 'STRAY_IS_CLI' ) === true && constant ( 'STRAY_IS_CLI' ) === true ) { Console :: run ( ) ; } elseif ( defined ( 'STRAY_IS_HTTP' ) === true && constant ( 'STRAY_IS_HTTP' ) === true ) { if ( count ( self :: $ applications ) == 0 ) { throw new BadUse ( 'no application has been registered' ) ; } Http :: run ( ) ; } else { throw new BadUse ( 'unknown mode, not CLI_IS_CLI nor STRAY_IS_HTTP' ) ; } }
Launch the logic stuff. Bootstrap need to be initialized beforehand.

@throws BadUse if bootstrap isn't initialized
@throws BadUse if no application is registered
@throws BadUse if not CLI_IS_CLI nor STRAY_IS_HTTP
@static
Launch the logic stuff . Bootstrap need to be initialized beforehand .