本文整理匯總了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();
}