public function run(Request $request = null)
    {
        $this->init();
        $this->getLogger()->debug('Application launched');
        if (!($request instanceof Request)) {
            $appMode = $this->detectRunMode();
            if ($appMode == self::MODE_WEB) {
                $request = Request\Web::makeFromGlobals();
            } else {
                $request = Request\Cli::makeFromGlobals();
            }
        }
        $this->setupRouter($request);
        $response = $this->execute($request);
        $this->output($response);
        $this->getLogger()->debug('Application execution completed');
    }
public function run(Request $request = null)
    {
        $this->init();
        $this->getLogger()->debug('Application launched');
        if (!($request instanceof Request)) {
            $appMode = $this->detectRunMode();
            if ($appMode == self::MODE_WEB) {
                $request = Request\Web::makeFromGlobals();
            } else {
                $request = Request\Cli::makeFromGlobals();
            }
        }
        $this->setupRouter($request);
        $response = $this->execute($request);
        $this->output($response);
        $this->getLogger()->debug('Application execution completed');
    }
public function run ( Request $ request = null ) { $ this -> init ( ) ; $ this -> getLogger ( ) -> debug ( 'Application launched' ) ; if ( ! ( $ request instanceof Request ) ) { $ appMode = $ this -> detectRunMode ( ) ; if ( $ appMode == self :: MODE_WEB ) { $ request = Request \ Web :: makeFromGlobals ( ) ; } else { $ request = Request \ Cli :: makeFromGlobals ( ) ; } } $ this -> setupRouter ( $ request ) ; $ response = $ this -> execute ( $ request ) ; $ this -> output ( $ response ) ; $ this -> getLogger ( ) -> debug ( 'Application execution completed' ) ; }
Run Application and output content

@param \Shade\Request|null $request Request

@throws \Shade\Exception
Run Application and output content