当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Config_Ini类代码示例

本文整理汇总了PHP中Zend_Config_Ini的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Ini类的具体用法?PHP Zend_Config_Ini怎么用?PHP Zend_Config_Ini使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Zend_Config_Ini类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadApplicationConfig

function loadApplicationConfig()
{
    require_once 'Zend/Config/Ini.php';
    $default = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV, array('allowModifications' => true));
    $options = $default->toArray();
    return $options;
}
开发者ID:HuyTran0424,项目名称:noeavrsev345452dfgdfgsg,代码行数:7,代码来源:cron.php

示例2: _initConfig

 /**
  * Initialize module config options
  * 
  * @return void
  */
 protected function _initConfig()
 {
     // load ini file
     $config = new Zend_Config_Ini(MODULES_PATH . '/' . $this->_module['folder'] . '/configs/module.ini', APPLICATION_ENV);
     $this->setOptions($config->toArray());
     Zend_Registry::set($this->_module['folder'] . 'Config', $this->_config = $config);
 }
开发者ID:esironal,项目名称:kebab-project,代码行数:12,代码来源:Bootstrap.php

示例3: __construct

    private function __construct() {
        $pathToFile = APPLICATION_PATH . '/configs/xhprof.ini';

        if (file_exists($pathToFile)) {

            $xhprofIni = new Zend_Config_Ini($pathToFile);

            if (null == ($config = $xhprofIni->get(APPLICATION_ENV)) && null == ($config = $xhprofIni->get('default'))) {
                require_once 'Zend/Application/Exception.php';
                throw new Zend_Application_Exception("Błędne ustawienia dla XHprof w pliku xhprof.ini");
            }
            
            $this->_xhprofConfigData = $config;

            if (null !== $this->_xhprofConfigData && $this->_xhprofConfigData->count() >= 1) {
                $dbAdapter = new Zend_Db_Adapter_Pdo_Pgsql(array(
                    'host' => $this->_xhprofConfigData->get('xhprof')->db->host,
                    'username' => $this->_xhprofConfigData->get('xhprof')->db->username,
                    'password' => $this->_xhprofConfigData->get('xhprof')->db->password,
                    'dbname' => $this->_xhprofConfigData->get('xhprof')->db->dbname,
                    'port' => $this->_xhprofConfigData->get('xhprof')->db->port
                ));
                $this->_dbAdapter = $dbAdapter;
            }
        }
    }
开发者ID:knatorski,项目名称:SMS,代码行数:26,代码来源:XHProfConfigFile.php

示例4: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(DICOMEXTRACTOR_DCM2XML_COMMAND_KEY, $config->get('dcm2xml', DICOMEXTRACTOR_DCM2XML_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMJ2PNM_COMMAND_KEY, $config->get('dcmj2pnm', DICOMEXTRACTOR_DCMJ2PNM_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMFTEST_COMMAND_KEY, $config->get('dcmftest', DICOMEXTRACTOR_DCMFTEST_COMMAND_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMDICTPATH_KEY, $config->get('dcmdictpath', DICOMEXTRACTOR_DCMDICTPATH_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->dcm2xml);
         unset($config->global->dcmj2pnm);
         unset($config->global->dcmftest);
         unset($config->global->dcmdictpath);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(DICOMEXTRACTOR_DCM2XML_COMMAND_KEY, DICOMEXTRACTOR_DCM2XML_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMJ2PNM_COMMAND_KEY, DICOMEXTRACTOR_DCMJ2PNM_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMFTEST_COMMAND_KEY, DICOMEXTRACTOR_DCMFTEST_COMMAND_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(DICOMEXTRACTOR_DCMDICTPATH_KEY, DICOMEXTRACTOR_DCMDICTPATH_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:28,代码来源:1.1.0.php

示例5: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var RandomComponent $randomComponent */
     $randomComponent = MidasLoader::loadComponent('Random');
     $securityKey = $randomComponent->generateString(32);
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SECURITY_KEY_KEY, $config->get('securitykey', $securityKey), $this->moduleName);
         $showButton = $config->get('showbutton');
         if ($showButton === 'true') {
             $showButton = 1;
         } elseif ($showButton === 'false') {
             $showButton = 0;
         } else {
             $showButton = MIDAS_REMOTEPROCESSING_SHOW_BUTTON_DEFAULT_VALUE;
         }
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SHOW_BUTTON_KEY, $showButton, $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->securitykey->securitykey);
         unset($config->showbutton->showbutton);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SECURITY_KEY_KEY, $securityKey, $this->moduleName);
         $settingModel->setConfig(MIDAS_REMOTEPROCESSING_SHOW_BUTTON_KEY, MIDAS_REMOTEPROCESSING_SHOW_BUTTON_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:33,代码来源:1.1.0.php

示例6: init_plugins

/**
 * Initialize plugins hook system
 */
function init_plugins()
{
    include APPPATH . 'config/cache.php';
    $feEngine = $config['plugins_frontend_engine'];
    $feOptions = $config['plugins_frontend'];
    $beEngine = $config['plugins_backend_engine'];
    $beOptions = $config['plugins_backend'];
    if (isset($beOptions['cache_dir']) && !file_exists($beOptions['cache_dir'])) {
        mkdir($beOptions['cache_dir']);
        chmod($beOptions['cache_dir'], 0777);
    }
    $cache = Zend_Cache::factory($feEngine, $beEngine, $feOptions, $beOptions);
    $pluginsConfigArray = $cache->load('pluginsConfig');
    if (!$pluginsConfigArray) {
        $pluginsConfigArray = array();
        $pluginConfDirHandler = opendir(APPPATH . 'config/plugins');
        while (false !== ($pluginConfigFile = readdir($pluginConfDirHandler))) {
            if (preg_match('~^.*?\\.ini$~si', $pluginConfigFile)) {
                try {
                    $pluginConfig = new Zend_Config_Ini(APPPATH . 'config/plugins/' . $pluginConfigFile, 'plugins');
                    $pluginsConfigArray = array_merge_recursive($pluginsConfigArray, $pluginConfig->toArray());
                } catch (Exception $e) {
                }
            }
        }
        closedir($pluginConfDirHandler);
        $cache->save($pluginsConfigArray, 'pluginsConfig');
    }
    Zend_Registry::getInstance()->set('pluginsConfig', new Zend_Config($pluginsConfigArray));
}
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:33,代码来源:init_plugins.php

示例7: loadErrors

 protected static function loadErrors()
 {
     if (!is_array(self::$errors)) {
         $config = new \Zend_Config_Ini(APPLICATION_PATH . '/configs/errors.ini');
         self::$errors = $config->get('errors')->toArray();
     }
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:7,代码来源:Error.php

示例8: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_PROVIDER_KEY, MIDAS_THUMBNAILCREATOR_PROVIDER_PHMAGICK, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_FORMAT_KEY, MIDAS_THUMBNAILCREATOR_FORMAT_JPG, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_KEY, $config->get('imagemagick', MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_KEY, $config->get('useThumbnailer', MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_DEFAULT_VALUE), $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_THUMBNAILER_KEY, $config->get('thumbnailer', MIDAS_THUMBNAILCREATOR_THUMBNAILER_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->imageFormats);
         unset($config->global->imagemagick);
         unset($config->global->thumbnailer);
         unset($config->global->useThumbnailer);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_PROVIDER_KEY, MIDAS_THUMBNAILCREATOR_PROVIDER_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_FORMAT_KEY, MIDAS_THUMBNAILCREATOR_FORMAT_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_KEY, MIDAS_THUMBNAILCREATOR_IMAGE_MAGICK_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_KEY, MIDAS_THUMBNAILCREATOR_USE_THUMBNAILER_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(MIDAS_THUMBNAILCREATOR_THUMBNAILER_KEY, MIDAS_THUMBNAILCREATOR_THUMBNAILER_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:30,代码来源:1.1.0.php

示例9: _initSession

 protected function _initSession()
 {
     $configSession = new Zend_Config_Ini(APPLICATION_PATH . '/configs/session.ini', APPLICATION_ENV);
     if (!$this->_request->isInstalling()) {
         $config = array('name' => 'session', 'primary' => 'session_id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime', 'lifetime' => $configSession->gc_maxlifetime);
         Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config));
     }
     if (!$this->_request->isInstalling() or is_writable(Core_Model_Directory::getSessionDirectory(true))) {
         $types = array();
         $options = $configSession->toArray();
         if (isset($options['types'])) {
             $types = $options['types'];
             unset($options['types']);
         }
         Zend_Session::start($options);
         $session_type = $this->_request->isApplication() ? 'mobile' : 'front';
         $session = new Core_Model_Session($session_type);
         foreach ($types as $type => $class) {
             $session->addType($type, $class);
         }
         $language_session = new Core_Model_Session('language');
         if (!$language_session->current_language) {
             $language_session->current_language = null;
         }
         Core_Model_Language::setSession($language_session);
         Core_View_Default::setSession($session);
         Core_Controller_Default::setSession($session);
     }
 }
开发者ID:BeamlabsTigre,项目名称:Webapp,代码行数:29,代码来源:Bootstrap.php

示例10: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $configPath = LOCAL_CONFIGS_PATH . DIRECTORY_SEPARATOR . $this->moduleName . '.local.ini';
     if (file_exists($configPath)) {
         $config = new Zend_Config_Ini($configPath, 'global');
         $piwikUrl = isset($config->piwik->url) ? $config->piwik->url : STATISTICS_PIWIK_URL_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_URL_KEY, $piwikUrl, $this->moduleName);
         $piwikId = isset($config->piwik->id) ? $config->piwik->id : STATISTICS_PIWIK_SITE_ID_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_SITE_ID_KEY, $piwikId, $this->moduleName);
         $piwikApiKey = isset($config->piwik->apikey) ? $config->piwik->apikey : STATISTICS_PIWIK_API_KEY_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_PIWIK_API_KEY_KEY, $piwikApiKey, $this->moduleName);
         $ipInfoDbApiKey = isset($config->ipinfodb->apikey) ? $config->ipinfodb->apikey : STATISTICS_IP_INFO_DB_API_KEY_DEFAULT_VALUE;
         $settingModel->setConfig(STATISTICS_IP_INFO_DB_API_KEY_KEY, $ipInfoDbApiKey, $this->moduleName);
         $settingModel->setConfig(STATISTICS_SEND_DAILY_REPORTS_KEY, $config->get('report', STATISTICS_SEND_DAILY_REPORTS_DEFAULT_VALUE), $this->moduleName);
         $config = new Zend_Config_Ini($configPath, null, true);
         unset($config->global->piwik->url);
         unset($config->global->piwik->id);
         unset($config->global->piwik->pikey);
         unset($config->global->ipinfodb->apikey);
         unset($config->global->report);
         $writer = new Zend_Config_Writer_Ini();
         $writer->setConfig($config);
         $writer->setFilename($configPath);
         $writer->write();
     } else {
         $settingModel->setConfig(STATISTICS_PIWIK_URL_KEY, STATISTICS_PIWIK_URL_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_PIWIK_SITE_ID_KEY, STATISTICS_PIWIK_SITE_ID_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_PIWIK_API_KEY_KEY, STATISTICS_PIWIK_API_KEY_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_IP_INFO_DB_API_KEY_KEY, STATISTICS_IP_INFO_DB_API_KEY_DEFAULT_VALUE, $this->moduleName);
         $settingModel->setConfig(STATISTICS_SEND_DAILY_REPORTS_KEY, STATISTICS_SEND_DAILY_REPORTS_DEFAULT_VALUE, $this->moduleName);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:35,代码来源:1.1.0.php

示例11: getApplication

 /**
  * 
  * @return Zend_Application
  */
 public static function getApplication()
 {
     $application = new Zend_Application(APPLICATION_ENV);
     $applicationini = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
     $options = $applicationini->toArray();
     foreach (self::$_ini as $value) {
         $iniFile = APPLICATION_PATH . self::$_pathConfig . $value;
         if (is_readable($iniFile)) {
             $config = new Zend_Config_Ini($iniFile);
             $options = $application->mergeOptions($options, $config->toArray());
         } else {
             throw new Zend_Exception('error en la configuracion de los .ini');
         }
     }
     //        foreach (self::$_ini as $value) {
     //            $iniFile = APPLICATION_PATH . self::$_pathConfig . $value;
     //
     //            if (is_readable($iniFile)) {
     //                $config = new Zend_Config_Ini($iniFile);
     //                $options = $application->mergeOptions($options,
     //                    $config->toArray());
     //            } else {
     //            throw new Zend_Exception('error en la configuracion de los .ini');
     //            }
     //        }
     Zend_Registry::set('config', $options);
     $a = $application->setOptions($options);
     return $application;
 }
开发者ID:josmel,项目名称:HosPot,代码行数:33,代码来源:index.php

示例12: _initSession

 protected function _initSession()
 {
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/sessions.ini', 'development');
     Zend_Session::setOptions($config->toArray());
     // start session
     Zend_Session::start();
 }
开发者ID:richistron,项目名称:Ofelia,代码行数:7,代码来源:Bootstrap.php

示例13: postUpgrade

 /** Post database upgrade. */
 public function postUpgrade()
 {
     /** @var SettingModel $settingModel */
     $settingModel = MidasLoader::loadModel('Setting');
     $config = new Zend_Config_Ini(APPLICATION_CONFIG, 'global');
     $settingModel->setConfig('address_verification', $config->get('verifyemail', 0), 'mail');
     if ($config->get('smtpfromaddress')) {
         $fromAddress = $config->get('smtpfromaddress');
     } elseif (ini_get('sendmail_from')) {
         $fromAddress = ini_get('sendmail_from');
     } else {
         $fromAddress = 'no-reply@example.org';
         // RFC2606
     }
     $settingModel->setConfig('from_address', $fromAddress, 'mail');
     if ($config->get('smtpserver')) {
         $components = parse_url($config->get('smtpserver'));
         if (isset($components['host'])) {
             $settingModel->setConfig('smtp_host', $components['host'], 'mail');
         }
         if (isset($components['port'])) {
             $settingModel->setConfig('smtp_port', $components['port'], 'mail');
             if ($components['port'] === 587) {
                 $settingModel->setConfig('smtp_use_ssl', 1, 'mail');
             }
         }
         if (isset($components['user'])) {
             $settingModel->setConfig('smtp_username', $components['user'], 'mail');
         }
         if (isset($components['pass'])) {
             $settingModel->setConfig('smtp_password', $components['pass'], 'mail');
         }
     }
     if ($config->get('smtpuser')) {
         $settingModel->setConfig('smtp_username', $config->get('smtpuser'), 'mail');
     }
     if ($config->get('smtppassword')) {
         $settingModel->setConfig('smtp_password', $config->get('smtppassword'), 'mail');
     }
     if ($settingModel->getValueByName('smtp_host', 'mail')) {
         $provider = 'smtp';
     } else {
         $provider = 'mail';
     }
     $settingModel->setConfig('provider', $provider, 'mail');
     /** @var UtilityComponent $utilityComponent */
     $utilityComponent = MidasLoader::loadComponent('Utility');
     $utilityComponent->installModule('mail');
     $config = new Zend_Config_Ini(APPLICATION_CONFIG, null, true);
     unset($config->global->smtpfromaddress);
     unset($config->global->smtpserver);
     unset($config->global->smtpuser);
     unset($config->global->smtppassword);
     unset($config->global->verifyemail);
     $writer = new Zend_Config_Writer_Ini();
     $writer->setConfig($config);
     $writer->setFilename(APPLICATION_CONFIG);
     $writer->write();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:60,代码来源:3.2.17.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     $config = new Zend_Config_Ini(dirname(__FILE__) . "/KAsyncCaptureThumbTest.ini");
     $testConfig = $config->get('config');
     $this->outputFolder = dirname(__FILE__) . '/' . $testConfig->outputFolder;
     $this->testsConfig = $config->get('tests');
 }
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:KAsyncCaptureThumbTest.php

示例15: getRecipients

 private static function getRecipients($docid, $rec_num = -1)
 {
     $db = Zend_Db_Table_Abstract::getDefaultAdapter();
     $sql = "select AV.VAL\r\nfrom V_ADD_VALUES AV\r\nwhere AV.NODEID = ?\r\nand AV.FIELDNAME = '_ADD_RECIPIENTS'";
     $rec = $db->fetchOne($sql, $docid);
     $rec = new Zend_Config_Ini('data://,' . $rec);
     return $rec->toArray();
 }
开发者ID:TDMU,项目名称:contingent5_statserver,代码行数:8,代码来源:Mail.php


注:本文中的Zend_Config_Ini类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。