本文整理汇总了PHP中I2CE::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP I2CE::initialize方法的具体用法?PHP I2CE::initialize怎么用?PHP I2CE::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I2CE
的用法示例。
在下文中一共展示了I2CE::initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_shift
* as well as the path to I2CE which may not work right using the one
* from the config file.
* The ID for the User object should be valid in your user table.
* The $forms array is an associative array with the value being
* an array of forms that are required for the given form to work e.g.
* region needs country first since it uses country as a map for a field.
*/
$script = array_shift($argv);
if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pages/local' . DIRECTORY_SEPARATOR . 'config.values.php')) {
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pages/local' . DIRECTORY_SEPARATOR . 'config.values.php';
} else {
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pages/config.values.php';
}
$i2ce_site_i2ce_path = "../../I2CE";
require_once $i2ce_site_i2ce_path . DIRECTORY_SEPARATOR . 'I2CE_config.inc.php';
I2CE::initialize($i2ce_site_database_user, $i2ce_site_database_password, $i2ce_site_database, $i2ce_site_user_database, $i2ce_site_module_config);
global $maps, $forms, $user, $db, $form_factory;
$maps = array();
$user = new I2CE_User(1);
$db = MDB2::singleton();
$form_factory = I2CE_FormFactory::instance();
$forms = array("academic_level" => array(), "certificate" => array("academic_level"), "qualification" => array(), "cadre" => array("qualification"), "country" => array(), "region" => array("country"), "district" => array("region"), "county" => array("district"), "marital_status" => array(), "training_disruption_category" => array(), "training_disruption_reason" => array("training_disruption_category"), "facility_agent" => array(), "facility_type" => array(), "out_migration_reason" => array(), "tribe" => array(), "facility_status" => array(), "health_facility" => array("facility_agent", "facility_type", "facility_status"));
echo "Memory Limit: " . ini_get("memory_limit") . "\n";
echo "Execution Time: " . ini_get("max_execution_time") . "\n";
$cache_filename = "convert_maps.save";
if (file_exists($cache_filename)) {
echo "Reading saved maps file...";
$cache_file = fopen($cache_filename, "r");
$cache_content = fread($cache_file, filesize($cache_filename));
fclose($cache_file);
$maps = unserialize($cache_content);