Example #1
0
 /**
  * Set up class properties etc.
  */
 private function Setup()
 {
     // place for additional sets
     // e.g. $this->aConfig[ section_key ][ value_key ] = value
     $sAppConfigIni = DOCROOT . $this->oConfig->getValue(sprintf('applications.%s.config_file', $this->oRouter->getApplicationName()));
     $this->oConfig->loadIniFile($sAppConfigIni);
     $this->sLogsDirectory = $this->getConfig('General.Logs_directory', DOCROOT . 'logs/');
     $this->sLogsDirectory .= date('Y-m-d') . '/';
     // set main framework path
     $this->addPath('Lithium');
     // set application path received from config file
     if ($sAppPath = $this->getConfig('General.App_path')) {
         $this->addPath($sAppPath);
         Loader::addPath(DOCROOT . $sAppPath);
     }
     // add path for external classes
     Loader::addPath(DOCROOT);
     // set language
     if ($sLanguage = $this->getConfig('Locale.Language')) {
         $this->sLanguage = $sLanguage;
     }
     Core_Model::setLithium($this);
     Core_Module::setLithium($this);
     Database_Driver::setLithium($this);
     // initialize router
     $this->oRouter->init();
     View::setRouter($this->oRouter);
     Module_Sorter::setRouter($this->oRouter);
     Module_Pagination::setRouter($this->oRouter);
 }