本文整理匯總了PHP中iPHP::domain方法的典型用法代碼示例。如果您正苦於以下問題:PHP iPHP::domain方法的具體用法?PHP iPHP::domain怎麽用?PHP iPHP::domain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iPHP
的用法示例。
在下文中一共展示了iPHP::domain方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: preg_replace
} else {
iDB::connect();
}
iDB::pre_set();
iDB::select_db(true) or iPHP::alert("不能鏈接到數據庫" . iPHP_DB_NAME, 'js:top.callback("#DB_NAME");');
$config = iPATH . 'config.php';
$content = iFS::read($config, false);
$content = preg_replace("/define\\(\\'iPHP_DB_HOST\\',\\'.*?\\'\\)/is", "define('iPHP_DB_HOST','" . iPHP_DB_HOST . "')", $content);
$content = preg_replace("/define\\(\\'iPHP_DB_USER\\',\\'.*?\\'\\)/is", "define('iPHP_DB_USER','" . iPHP_DB_USER . "')", $content);
$content = preg_replace("/define\\(\\'iPHP_DB_PASSWORD\\',\\'.*?\\'\\)/is", "define('iPHP_DB_PASSWORD','" . iPHP_DB_PASSWORD . "')", $content);
$content = preg_replace("/define\\(\\'iPHP_DB_NAME\\',\\'.*?\\'\\)/is", "define('iPHP_DB_NAME','" . iPHP_DB_NAME . "')", $content);
$content = preg_replace("/define\\(\\'iPHP_DB_PREFIX\\',\\'.*?\\'\\)/is", "define('iPHP_DB_PREFIX','" . iPHP_DB_PREFIX . "')", $content);
$content = preg_replace("/define\\(\\'iPHP_KEY\\',\\'.*?\\'\\)/is", "define('iPHP_KEY','" . random(32) . "')", $content);
$parse_url = parse_url($router_url);
$host = $parse_url['host'];
$COOKIE_DOMAIN = '.' . iPHP::domain($host);
preg_match("/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\$/", $host) && ($COOKIE_DOMAIN = '');
$content = preg_replace("/define\\(\\'iPHP_COOKIE_DOMAIN\\',\\s*\\'.*?\\'\\)/is", "define('iPHP_COOKIE_DOMAIN','{$COOKIE_DOMAIN}')", $content);
iFS::write($config, $content, false);
//開始安裝 數據庫
$sql_file = dirname(strtr(__FILE__, '\\', '/')) . '/iCMS.V6.sql';
is_readable($sql_file) or iPHP::alert('數據庫文件不存在或者讀取失敗', 'js:top.callback();');
//require_once ($config);
$sql = iFS::read($sql_file);
// $sql = str_replace('#iCMS@__',$db_prefix,$sql);
//
//
run_query($sql);
//設置超級管理員
$admin_password = md5($admin_password);
iDB::query("\n\t\tUPDATE `#iCMS@__members`\n\t\tSET `username` = '{$admin_name}', `password` = '{$admin_password}'\n\t\tWHERE `uid` = '1';\n\t");