本文整理汇总了PHP中parseDeliveryIniFile函数的典型用法代码示例。如果您正苦于以下问题:PHP parseDeliveryIniFile函数的具体用法?PHP parseDeliveryIniFile怎么用?PHP parseDeliveryIniFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parseDeliveryIniFile函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupDeliveryConfigVariables
/**
* A function to initialize the environmental constants and global
* variables required by delivery.
*/
function setupDeliveryConfigVariables()
{
if (!defined('MAX_PATH')) {
define('MAX_PATH', dirname(__FILE__));
}
if (!defined('MAD_PATH')) {
define('MAD_PATH', MAX_PATH);
}
// Ensure that the initialisation has not been run before
if (!isset($GLOBALS['_MAX']['CONF'])) {
// Parse the Max configuration file
$GLOBALS['_MAX']['CONF'] = parseDeliveryIniFile();
}
// Set up the common configuration variables
setupConfigVariables();
}
示例2: test_parseDeliveryIniFile
/**
* A method to test the getConfigVersion() method.
*/
function test_parseDeliveryIniFile()
{
$host = OX_getHostName();
copy(MAX_PATH . '/lib/OA/tests/data/test.demo.conf.php', MAX_PATH . '/var/' . $host . '.test.demo.conf.php');
copy(MAX_PATH . '/lib/OA/tests/data/test.real.conf.php', MAX_PATH . '/var/test.real.conf.php');
$result = parseDeliveryIniFile('', 'test.demo');
$this->assertIsA($result, 'array');
$this->assertTrue(isset($result['database']));
$this->assertEqual($result['database']['username'], 'demo_user');
$this->assertEqual($result['database']['password'], 'demo_pass');
$this->assertEqual($result['database']['name'], 'demo_name');
$this->assertTrue(isset($result['real']));
$this->assertEqual($result['real']['key1'], 'val1');
$this->assertEqual($result['real']['key2'], 'val2');
@unlink(MAX_PATH . '/var/' . $host . '.test.demo.conf.php');
@unlink(MAX_PATH . '/var/test.real.conf.php');
}
示例3: setupDeliveryConfigVariables
function setupDeliveryConfigVariables()
{
if (!defined('MAX_PATH')) {
define('MAX_PATH', dirname(__FILE__) . '/../..');
}
if (!defined('OX_PATH')) {
define('OX_PATH', MAX_PATH);
}
if (!defined('RV_PATH')) {
define('RV_PATH', MAX_PATH);
}
if (!defined('LIB_PATH')) {
define('LIB_PATH', MAX_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'OX');
}
if (!isset($GLOBALS['_MAX']['CONF'])) {
$GLOBALS['_MAX']['CONF'] = parseDeliveryIniFile();
}
setupConfigVariables();
}