src/wcmf/lib/presentation/Application.php
public function initialize($defaultController='', $defaultContext='', $defaultAction='login') {
    $config = ObjectFactory::getInstance('configuration');
    $this->debug = $config->getBooleanValue('debug', 'Application');

    // configure php
    if ($config->hasSection('phpconfig')) {
      $phpSettings = $config->getSection('phpconfig');
      foreach ($phpSettings as $option => $value) {
        ini_set($option, $value);
      }
    }

    // create the Request and Response instances
    $this->request = ObjectFactory::getInstance('request');
    $this->response = ObjectFactory::getInstance('response');
    $this->request->setResponse($this->response);

    $this->request->initialize($defaultController, $defaultContext, $defaultAction);

    // initialize session
    $session = ObjectFactory::getInstance('session');

    // load user configuration
    $principalFactory = ObjectFactory::getInstance('principalFactory');
    $authUser = $principalFactory->getUser($session->getAuthUser(), true);
    if ($authUser && strlen($authUser->getConfig()) > 0) {
      $config->addConfiguration($authUser->getConfig(), true);
    }

    // load event listeners
    $listeners = $config->getValue('listeners', 'application');
    foreach ($listeners as $key) {
      ObjectFactory::getInstance($key);
    }

    // set timezone
    date_default_timezone_set($config->getValue('timezone', 'application'));

    // return the request
    return $this->request;
  }
public function initialize($defaultController='', $defaultContext='', $defaultAction='login') {
    $config = ObjectFactory::getInstance('configuration');
    $this->debug = $config->getBooleanValue('debug', 'Application');

    // configure php
    if ($config->hasSection('phpconfig')) {
      $phpSettings = $config->getSection('phpconfig');
      foreach ($phpSettings as $option => $value) {
        ini_set($option, $value);
      }
    }

    // create the Request and Response instances
    $this->request = ObjectFactory::getInstance('request');
    $this->response = ObjectFactory::getInstance('response');
    $this->request->setResponse($this->response);

    $this->request->initialize($defaultController, $defaultContext, $defaultAction);

    // initialize session
    $session = ObjectFactory::getInstance('session');

    // load user configuration
    $principalFactory = ObjectFactory::getInstance('principalFactory');
    $authUser = $principalFactory->getUser($session->getAuthUser(), true);
    if ($authUser && strlen($authUser->getConfig()) > 0) {
      $config->addConfiguration($authUser->getConfig(), true);
    }

    // load event listeners
    $listeners = $config->getValue('listeners', 'application');
    foreach ($listeners as $key) {
      ObjectFactory::getInstance($key);
    }

    // set timezone
    date_default_timezone_set($config->getValue('timezone', 'application'));

    // return the request
    return $this->request;
  }
public function initialize ( $ defaultController = '' , $ defaultContext = '' , $ defaultAction = 'login' ) { $ config = ObjectFactory :: getInstance ( 'configuration' ) ; $ this -> debug = $ config -> getBooleanValue ( 'debug' , 'Application' ) ; // configure php if ( $ config -> hasSection ( 'phpconfig' ) ) { $ phpSettings = $ config -> getSection ( 'phpconfig' ) ; foreach ( $ phpSettings as $ option => $ value ) { ini_set ( $ option , $ value ) ; } } // create the Request and Response instances $ this -> request = ObjectFactory :: getInstance ( 'request' ) ; $ this -> response = ObjectFactory :: getInstance ( 'response' ) ; $ this -> request -> setResponse ( $ this -> response ) ; $ this -> request -> initialize ( $ defaultController , $ defaultContext , $ defaultAction ) ; // initialize session $ session = ObjectFactory :: getInstance ( 'session' ) ; // load user configuration $ principalFactory = ObjectFactory :: getInstance ( 'principalFactory' ) ; $ authUser = $ principalFactory -> getUser ( $ session -> getAuthUser ( ) , true ) ; if ( $ authUser && strlen ( $ authUser -> getConfig ( ) ) > 0 ) { $ config -> addConfiguration ( $ authUser -> getConfig ( ) , true ) ; } // load event listeners $ listeners = $ config -> getValue ( 'listeners' , 'application' ) ; foreach ( $ listeners as $ key ) { ObjectFactory :: getInstance ( $ key ) ; } // set timezone date_default_timezone_set ( $ config -> getValue ( 'timezone' , 'application' ) ) ; // return the request return $ this -> request ; }
Initialize the request.

@param $defaultController The controller to call if none is given in request parameters (optional, default: '')
@param $defaultContext The context to set if none is given in request parameters (optional, default: '')
@param $defaultAction The action to perform if none is given in request parameters (optional, default: 'login')
@return Request instance representing the current HTTP request
Initialize the request .