本文整理汇总了PHP中Zend_Config_Ini::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Ini::get方法的具体用法?PHP Zend_Config_Ini::get怎么用?PHP Zend_Config_Ini::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Config_Ini
的用法示例。
在下文中一共展示了Zend_Config_Ini::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: __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;
}
}
}
示例5: 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');
}
示例6: 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();
}
示例7: init
public function init()
{
$this->addElement('text', 'first_name', array('label' => 'First Name', 'filters' => array('stringTrim')));
$this->addElement('text', 'last_name', array('label' => 'Last Name', 'filters' => array('stringTrim')));
$this->addElement('text', 'email', array('label' => 'Email', 'required' => true, 'filters' => array('stringTrim')));
$this->addElement('select', 'subject', array('label' => 'Subject', 'registerInArrayValidator' => FALSE));
$this->addElement('textarea', 'message', array('label' => 'Message', 'required' => true));
$secretConfigFile = APPLICATION_PATH . '/configs/secret.ini';
if (file_exists($secretConfigFile)) {
$config = new \Zend_Config_Ini($secretConfigFile, APPLICATION_ENV);
$this->addElement('captcha', 'captcha', array('label' => "Please verify you're a human", 'captcha' => array('ReCaptcha')));
$this->captcha->getCaptcha()->setPubkey($config->get('recaptcha')->get('public_key'));
$this->captcha->getCaptcha()->setPrivkey($config->get('recaptcha')->get('private_key'));
}
$this->addElement('submit', 'submit', array('label' => 'Send', 'ignore' => true));
}
示例8: 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();
}
}
示例9: 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);
}
}
示例10: array
function __construct()
{
$config = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini");
$class = $config->get(APPLICATION_ENV)->toArray();
$conf = $class['mail']['conf'];
$smtp = $class['mail']['smtpServer'];
$this->_transport = new Zend_Mail_Transport_Smtp($smtp, $conf);
$this->setFrom($class['mail']['from']['email'], $class['mail']['from']['nameEmail']);
$this->_destinatario = array();
}
示例11: _initLog
protected function _initLog()
{
$this->bootstrap('config');
$this->bootstrap('autoloaders');
$this->bootstrap('timezone');
$loggerConfigPath = realpath(APPLICATION_PATH . '/../configurations/logger.ini');
$loggerConfig = new Zend_Config_Ini($loggerConfigPath);
$configSettings = Zend_Registry::get('config')->settings;
$loggerName = $configSettings->loggerName;
$appLogger = $loggerConfig->get($loggerName);
KalturaLog::initLog($appLogger);
KalturaLog::debug('starting request');
}
示例12: __construct
protected function __construct()
{
$this->config = Zend_Registry::get('config');
$res = $this->config->get('site');
if (!$res) {
return;
}
$res = $res->get('resource');
if (!$res) {
return;
}
$res = $res->get('aggregator');
if (!$res) {
return;
}
$this->config = $res;
foreach ($this->config as $item) {
$modelClass = $item->model;
if (class_exists($modelClass) && method_exists($modelClass, 'ZGetLinks')) {
$this->models[$modelClass] = new $modelClass();
}
}
}
示例13: 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(OAI_REPOSITORY_IDENTIFIER_KEY, $config->get('repositoryidentifier', OAI_REPOSITORY_IDENTIFIER_DEFAULT_VALUE), $this->moduleName);
$settingModel->setConfig(OAI_REPOSITORY_NAME_KEY, $config->get('repositoryname', OAI_REPOSITORY_NAME_DEFAULT_VALUE), $this->moduleName);
$settingModel->setConfig(OAI_ADMIN_EMAIL_KEY, $config->get('adminemail', OAI_ADMIN_EMAIL_DEFAULT_VALUE), $this->moduleName);
$config = new Zend_Config_Ini($configPath, null, true);
unset($config->global->repositoryidentifier);
unset($config->global->repositoryname);
unset($config->global->adminemail);
$writer = new Zend_Config_Writer_Ini();
$writer->setConfig($config);
$writer->setFilename($configPath);
$writer->write();
} else {
$settingModel->setConfig(OAI_REPOSITORY_IDENTIFIER_KEY, OAI_REPOSITORY_IDENTIFIER_DEFAULT_VALUE, $this->moduleName);
$settingModel->setConfig(OAI_REPOSITORY_NAME_KEY, OAI_REPOSITORY_NAME_DEFAULT_VALUE, $this->moduleName);
$settingModel->setConfig(OAI_ADMIN_EMAIL_KEY, OAI_ADMIN_EMAIL_DEFAULT_VALUE, $this->moduleName);
}
}
示例14: setUp
public function setUp()
{
parent::setUp();
$config = new \Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', null, true);
$system_ini = new \Zend_Config_Ini('/var/yujiaqu.ini');
$config->merge($system_ini);
$application = new Zend_Application(APPLICATION_ENV, $config->get(APPLICATION_ENV));
$application->bootstrap();
$this->_bootstrap = $application->getBootstrap();
// manually init Zend_Controller_Front, otherwise, it is not inited in testing environment
$this->_bootstrap->getResource('FrontController')->setParam('bootstrap', $this->_bootstrap);
$this->_angel_bootstrap = $this->_bootstrap->getResource('modules')->offsetGet('angel');
$this->_container = $this->_bootstrap->getResource('serviceContainer');
$this->_documentManager = $this->_angel_bootstrap->getResource('mongoDocumentManager');
$this->_logger = $this->_bootstrap->getResource('logger');
}
示例15: _initLog
protected function _initLog()
{
$this->bootstrap('autoloaders');
$this->bootstrap('timezone');
$config = $this->getConfig();
$configSettings = $config->settings;
$loggerConfigPath = null;
if (isset($configSettings->loggerConfigPath)) {
$loggerConfigPath = $configSettings->loggerConfigPath;
} else {
$loggerConfigPath = realpath(APPLICATION_PATH . '/../configurations/logger.ini');
}
$loggerConfig = new Zend_Config_Ini($loggerConfigPath);
$loggerName = $configSettings->applicationName;
$appLogger = $loggerConfig->get($loggerName);
KalturaLog::initLog($appLogger);
}