本文整理汇总了PHP中Zend_Config_Ini::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Ini::__construct方法的具体用法?PHP Zend_Config_Ini::__construct怎么用?PHP Zend_Config_Ini::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Config_Ini
的用法示例。
在下文中一共展示了Zend_Config_Ini::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct($filename, $section = null, $options = false)
{
$this->iniDataBackup = $this->iniData = $this->_parseRawIniFile($filename);
$this->configfilename = $filename;
//print_r( array_keys($this->iniData["development : production"]) );
parent::__construct($filename, $section, $options);
}
示例2: __construct
public function __construct($filePath)
{
if (!file_exists($filePath)) {
file_put_contents($filePath, '');
}
$this->filePath = $filePath;
parent::__construct($filePath, null, true);
}
示例3: __construct
/**
*
* Creates a new test configuration
* @param unknown_type $filePath
*/
public function __construct($filePath = null)
{
if (empty($filePath)) {
$this->_allowModifications = true;
return;
}
if (!file_exists($filePath)) {
KalturaLog::debug("Test configuration doesn't exists [{$filePath}] creating new ");
file_put_contents($filePath, '');
}
$this->filePath = $filePath;
parent::__construct($filePath, null, true);
}
示例4: __construct
public function __construct($configFileName, $workerName, $maxInstances)
{
parent::__construct($configFileName, $workerName, true);
$this->name = $workerName;
$this->maxInstances = $maxInstances;
if ($this->filter) {
$filter = new KalturaBatchJobFilter();
foreach ($this->filter as $attr => $value) {
$filter->{$attr} = $value;
}
$this->filter = $filter;
}
}
示例5: __construct
/**
* If $config['create'] = true the config will be create if he doesn't exist.
*
* @param string Path to config file
* @param string Section of config file
* @param array Configuration array
* @throw USVN_Exception
*/
public function __construct($filename, $section, $config = array())
{
$this->_filename = $filename;
if (!file_exists($filename)) {
if (isset($config['create']) && $config['create'] === true) {
if (@file_put_contents($filename, "[{$section}]\n") === false) {
throw new USVN_Exception("Can't write config file %s.", $filename);
}
} else {
throw new USVN_Exception("Can't open config file %s.", $filename);
}
}
try {
parent::__construct($filename, $section, true);
} catch (Exception $e) {
throw new USVN_Exception($e->getMessage());
}
}
示例6: __construct
public function __construct($filename, $section = null, $options = false)
{
$options['allowModifications'] = true;
try {
parent::__construct($filename, $section, $options);
} catch (Zend_Config_Exception $e) {
// Catch invalid Section exceptions here...
if (!count(sscanf($e->getMessage(), "Section '%s' cannot be found in %s"))) {
throw $e;
}
// ...and provide a better one we can use to show a friendly error
$validSections = array_keys($this->_loadIniFile($filename));
$superException = new Garp_Config_Ini_InvalidSectionException($e->getMessage());
$superException->setValidSections($validSections);
throw $superException;
}
if (isset($this->config)) {
$this->_mergeSubConfigs($section, $options);
}
}
示例7: load
public function load()
{
$this->configTimestamp = $this->calculateFileTimestamp();
$configFileName = $this->configFileName;
KalturaLog::log("loading configuration {$configFileName} at " . $this->configTimestamp);
if (is_dir($this->configFileName)) {
$configFileName = kEnvironment::get('cache_root_path') . DIRECTORY_SEPARATOR . 'batch' . DIRECTORY_SEPARATOR . 'config.ini';
$this->implodeDirectoryFiles($configFileName);
}
$hostname = self::getHostname();
parent::__construct($configFileName, $hostname, true);
$this->name = $hostname;
$this->hostName = $hostname;
$this->taskConfigList = array();
foreach ($this->enabledWorkers as $workerName => $maxInstances) {
if (!$maxInstances) {
continue;
}
$task = new KSchedularTaskConfig($configFileName, $workerName, $maxInstances);
$task->setPartnerId($this->getPartnerId());
$task->setSecret($this->getSecret());
$task->setCurlTimeout($this->getCurlTimeout());
$task->setSchedulerId($this->getId());
$task->setSchedulerName($this->getName());
$task->setServiceUrl($this->getServiceUrl());
$task->setDwhPath($this->getDwhPath());
$task->setDirectoryChmod($this->getDirectoryChmod());
$task->setChmod($this->getChmod());
$task->setDwhEnabled($this->getDwhEnabled());
$task->setTimezone($this->getTimezone());
$task->setInitOnly(false);
$task->setRemoteServerUrl($this->getRemoteServerUrl());
$task->setMaxIdleTime($this->getMaxIdleTime());
$this->taskConfigList[$workerName] = $task;
}
}
示例8: __construct
public function __construct()
{
$this->_fileConfig = FILE_PATH . DS . 'Configs' . DS . 'site.ini';
parent::__construct($this->_fileConfig, null, array('allowModifications' => true));
}
示例9: __construct
/**
* Loads the section $section from the array $config for
* access facilitated by nested object properties.
*
*
* @param array $config
* @param string|null $section
* @param boolean|array $options
* @throws Zend_Config_Exception
* @return void
*/
public function __construct(array $config, $section = null, $options = false)
{
parent::__construct($config, $section, $options);
}