Пример #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);
 }
Пример #2
0
 /**
  * Setter for Lithium instance
  * 
  * @param Lithium $oLithium
  */
 public static function setLithium(Lithium $oLithium)
 {
     self::$oLithium = $oLithium;
 }
Пример #3
0
 private function installModuleIfNecessary(Core_Module $module)
 {
     $moduleName = $module->getClassName();
     // is the module already installed or is it the first time we activate it?
     $modulesInstalled = $this->getInstalledModulesName();
     if (!in_array($moduleName, $modulesInstalled)) {
         $this->installModule($module);
         $modulesInstalled[] = $moduleName;
         Zend_Registry::get('config')->ModulesInstalled = array('ModulesInstalled' => $modulesInstalled);
     }
     $information = $module->getInformation();
     // if the module is to be loaded during the statistics logging
     if (isset($information['TrackerModule']) && $information['TrackerModule'] === true) {
         $modulesTracker = Zend_Registry::get('config')->Modules_Tracker->Modules_Tracker;
         if (is_null($modulesTracker)) {
             $modulesTracker = array();
         } else {
             $modulesTracker = $modulesTracker->toArray();
         }
         if (!in_array($moduleName, $modulesTracker)) {
             $modulesTracker[] = $moduleName;
             Zend_Registry::get('config')->Modules_Tracker = array('Modules_Tracker' => $modulesTracker);
         }
     }
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     $this->menu = array(array('sorting' => 140, 'block' => 1, 'name' => "Экспорт в Twitter", 'href' => "/admin/repairmanjacktwitterexport/index.php", 'onclick' => "\$.adminLoad({path: '/admin/repairmanjacktwitterexport/index.php'}); return false", 'image' => 'repairmanjacktwitterexport_logo.png'));
 }