public static function parse()
 {
     if (!self::$mConfigData) {
         $params = Factory::getParameters();
         $file = isset($params['conf']) ? $params['conf'] : DIR_CONF . '/peel.conf';
         self::$mConfigData = parse_ini_file($file, true, INI_SCANNER_NORMAL);
         self::$mConfigData['config_file_path'] = $file;
         self::$mConfigData['config_directory'] = dirname($file);
         self::createDirectories();
         self::parsePeelers();
     }
     return self::$mConfigData;
 }
Exemple #2
0
 public function getDeleteError($moduleGroupKey, $moduleKey, $ignoreGroupId = null)
 {
     global $parametersMod;
     $moduleGroups = \Backend\Db::modules();
     foreach ($moduleGroups as $group) {
         foreach ($group as $module) {
             if ($module['g_id'] != $ignoreGroupId) {
                 if (!$module['core']) {
                     $configuration = new ConfigurationFile(BASE_DIR . PLUGIN_DIR . $module['g_name'] . '/' . $module['m_name'] . '/install/plugin.ini');
                     if ($configuration) {
                         foreach ($configuration->getRequiredModules() as $requiredModule) {
                             if ($requiredModule['module_group_key'] == $moduleGroupKey && $requiredModule['module_key'] == $moduleKey) {
                                 $error = $parametersMod->getValue('developer', 'modules', 'admin_translations', 'error_delete_required_module') . ' ' . $module['g_name'] . '/' . $module['m_name'];
                                 return $error;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 private function addConfigFile()
 {
     if ($this->requestParameter['submit']) {
         $applicationId = $this->requestParameter['applicationId'];
         $objConfigurationFile = new ConfigurationFile();
         $objConfigurationFile->setApplicationId($applicationId);
         $objConfigurationFile->setConfigurationFile($_FILES["configFile"]["name"]);
         $this->objConfigurationFileManager->addConfigurationFile($objConfigurationFile);
         $this->manageFile($this->requestParameter['applicationId']);
         $this->smarty->assign('success', 'Added successfully ..');
         $this->viewConfigureApplication();
     }
 }
 public function findNewModules()
 {
     global $cms;
     global $parametersMod;
     $answer = '';
     $newModules = array();
     $newModuleGroups = $this->getFolders(PLUGIN_DIR);
     foreach ($newModuleGroups as $key => $newModuleGroup) {
         $newModuleGroups[$key] = self::getFolders(PLUGIN_DIR . $key . "/");
     }
     foreach ($newModuleGroups as $newModuleGroupKey => $newModuleGroup) {
         foreach ($newModuleGroup as $newModuleKey => $newModule) {
             $currentModule = \Db::getModule(null, $newModuleGroupKey, $newModuleKey);
             if (file_exists(BASE_DIR . PLUGIN_DIR . $newModuleGroupKey . '/' . $newModuleKey . '/install/plugin.ini')) {
                 $configuration = new ConfigurationFile(BASE_DIR . PLUGIN_DIR . $newModuleGroupKey . '/' . $newModuleKey . '/install/plugin.ini');
                 if (!$currentModule) {
                     $newModules[] = array('action' => 'insert', 'configuration' => $configuration, 'dependend' => false);
                 } else {
                     if ((double) $currentModule['version'] < (double) $configuration->getModuleVersion()) {
                         $newModules[] = array('action' => 'update', 'configuration' => $configuration, 'dependend' => false);
                     }
                 }
             } else {
                 $answer .= $parametersMod->getValue('developer', 'modules', 'admin_translations_install', 'error_ini_file_doesnt_exist') . '<b>' . $newModuleGroupKey . '/' . $newModuleKey . '/install/plugin.ini</b>';
             }
         }
     }
     if (sizeof($newModules) > 0) {
         $answer .= '<link media="screen" rel="stylesheet" type="text/css" href="' . BASE_URL . MODULE_DIR . 'developer/modules/style.css"/>';
     }
     foreach ($newModules as $key2 => &$newModule2) {
         //fill alreadyUsed array;
         $this->setDepend($newModules, $newModule2, 1);
     }
     foreach ($newModules as $key => $newModule) {
         if (!$newModule['dependend']) {
             $answer .= $this->printInstallBlock($newModules, $newModule, $alreadyUsed2, 1);
         }
     }
     return $answer;
 }
Exemple #5
0
 public static function getConfig()
 {
     if (!self::$mConfig) {
         self::$mConfig = ConfigurationFile::parse();
     }
     return self::$mConfig;
 }
Exemple #6
0
 public function __construct()
 {
     $config = new ConfigurationFile(ConfigurationConstants::MAIN_CONFIG);
     $this->title = $config->getParam("title", "")->getValue();
     $this->environment = $config->getParam("environment", "prod")->getValue();
     $this->ajaxEnabled = $config->getParam("ajax_enabled", "true")->getValue();
     $this->ajaxTimeout = $config->getParam("ajax_timeout", "3000")->getValue();
     $this->defaultUrl = $config->getParam("default_url", "index")->getValue();
     $this->errorPage = $config->getParam("error_page", "error")->getValue();
     $this->contextPath = $config->getParam("context_path", "/")->getValue();
     $this->locale = $config->getParam("locale", "en_US")->getValue();
     $this->timezone = $config->getParam("timezone", "Europe/Brussels")->getValue();
     $this->gmapsApiKey = $config->getParam("gmaps_api_key", "")->getValue();
     $this->viewCacheEnabled = $config->getParam("view_cache_enabled", "true")->getValue();
     $this->dbCacheEnabled = $config->getParam("db_cache_enabled", "true")->getValue();
     $this->showSql = $config->getParam("show_sql", "false")->getValue();
     $this->smtpHost = $config->getParam("smtp_host", "localhost")->getValue();
     $this->smtpPort = $config->getParam("smtp_port", "25")->getValue();
     $this->smtpUsername = $config->getParam("smtp_username", "")->getValue();
     $this->smtpPassword = $config->getParam("smtp_password", "")->getValue();
     $this->smtpDefaultFromEmail = $config->getParam("smtp_default_from_email", "")->getValue();
     $this->smtpDefaultFromName = $config->getParam("smtp_default_from_name", "")->getValue();
     $this->smtpAuth = $config->getParam("smtp_auth", "false")->getValue();
     $this->fileUploadDir = $config->getParam("file_upload_dir", "/uploads")->getValue();
 }