本文整理汇总了PHP中PEAR_Installer_Role::initializeConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Installer_Role::initializeConfig方法的具体用法?PHP PEAR_Installer_Role::initializeConfig怎么用?PHP PEAR_Installer_Role::initializeConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_Installer_Role
的用法示例。
在下文中一共展示了PEAR_Installer_Role::initializeConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PEAR_Config
/**
* Constructor.
*
* @param string file to read user-defined options from
* @param string file to read system-wide defaults from
* @param bool determines whether a registry object "follows"
* the value of php_dir (is automatically created
* and moved when php_dir is changed)
* @param bool if true, fails if configuration files cannot be loaded
*
* @access public
*
* @see PEAR_Config::singleton
*/
function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false, $strict = true)
{
$this->PEAR();
PEAR_Installer_Role::initializeConfig($this);
$sl = DIRECTORY_SEPARATOR;
if (empty($user_file)) {
if (OS_WINDOWS) {
$user_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.ini';
} else {
$user_file = getenv('HOME') . $sl . '.pearrc';
}
}
if (empty($system_file)) {
$system_file = PEAR_CONFIG_SYSCONFDIR . $sl;
if (OS_WINDOWS) {
$system_file .= 'pearsys.ini';
} else {
$system_file .= 'pear.conf';
}
}
$this->layers = array_keys($this->configuration);
$this->files['user'] = $user_file;
$this->files['system'] = $system_file;
if ($user_file && file_exists($user_file)) {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$this->readConfigFile($user_file, 'user', $strict);
$this->popErrorHandling();
if ($this->_errorsFound > 0) {
return;
}
}
if ($system_file && @file_exists($system_file)) {
$this->mergeConfigFile($system_file, false, 'system', $strict);
if ($this->_errorsFound > 0) {
return;
}
}
if (!$ftp_file) {
$ftp_file = $this->get('remote_config');
}
if ($ftp_file && defined('PEAR_REMOTEINSTALL_OK')) {
$this->readFTPConfigFile($ftp_file);
}
foreach ($this->configuration_info as $key => $info) {
$this->configuration['default'][$key] = $info['default'];
}
$this->_registry['default'] =& new PEAR_Registry($this->configuration['default']['php_dir'], false, false, $this->configuration['default']['metadata_dir']);
$this->_registry['default']->setConfig($this, false);
$this->_regInitialized['default'] = false;
//$GLOBALS['_PEAR_Config_instance'] = &$this;
}
示例2: PEAR_Config
/**
* Constructor.
*
* @param string file to read user-defined options from
* @param string file to read system-wide defaults from
* @param bool determines whether a registry object "follows"
* the value of php_dir (is automatically created
* and moved when php_dir is changed)
*
* @access public
*
* @see PEAR_Config::singleton
*/
function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false)
{
$this->PEAR();
PEAR_Installer_Role::initializeConfig($this);
$sl = DIRECTORY_SEPARATOR;
if (empty($user_file)) {
if (OS_WINDOWS) {
$user_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.ini';
} else {
$user_file = getenv('HOME') . $sl . '.pearrc';
}
}
if (empty($system_file)) {
if (OS_WINDOWS) {
$system_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pearsys.ini';
} else {
$system_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.conf';
}
}
$this->layers = array_keys($this->configuration);
$this->files['user'] = $user_file;
$this->files['system'] = $system_file;
if ($user_file && @file_exists($user_file)) {
$this->readConfigFile($user_file);
}
if ($system_file && @file_exists($system_file)) {
$this->mergeConfigFile($system_file, false, 'system');
}
if (!$ftp_file) {
$ftp_file = $this->get('remote_config');
}
if ($ftp_file) {
$this->readFTPConfigFile($ftp_file);
}
foreach ($this->configuration_info as $key => $info) {
$this->configuration['default'][$key] = $info['default'];
}
$this->_registry['default'] =& new PEAR_Registry($this->configuration['default']['php_dir']);
$this->_registry['default']->setConfig($this);
$this->_regInitialized['default'] = false;
//$GLOBALS['_PEAR_Config_instance'] = &$this;
}