本文整理汇总了PHP中DupUtil::preg_replacement_quote方法的典型用法代码示例。如果您正苦于以下问题:PHP DupUtil::preg_replacement_quote方法的具体用法?PHP DupUtil::preg_replacement_quote怎么用?PHP DupUtil::preg_replacement_quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DupUtil
的用法示例。
在下文中一共展示了DupUtil::preg_replacement_quote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_r
$log = print_r($zip, true);
$close_response = $zip->close();
$log .= "COMPLETE: " . var_export($close_response, true);
DUPX_Log::Info($log);
} else {
DUPX_Log::Error(ERR_ZIPOPEN);
}
$zip = null;
}
//===============================
//WP-CONFIG: wp-config
//===============================
$wpconfig = @file_get_contents('wp-config.php', true);
$patterns = array("/'DB_NAME',\\s*'.*?'/", "/'DB_USER',\\s*'.*?'/", "/'DB_PASSWORD',\\s*'.*?'/", "/'DB_HOST',\\s*'.*?'/");
$db_host = $_POST['dbport'] == 3306 ? $_POST['dbhost'] : "{$_POST['dbhost']}:{$_POST['dbport']}";
$replace = array("'DB_NAME', " . '\'' . $_POST['dbname'] . '\'', "'DB_USER', " . '\'' . $_POST['dbuser'] . '\'', "'DB_PASSWORD', " . '\'' . DupUtil::preg_replacement_quote($_POST['dbpass']) . '\'', "'DB_HOST', " . '\'' . $db_host . '\'');
//SSL CHECKS
if ($_POST['ssl_admin']) {
if (!strstr($wpconfig, 'FORCE_SSL_ADMIN')) {
$wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_ADMIN', true);";
}
} else {
array_push($patterns, "/'FORCE_SSL_ADMIN',\\s*true/");
array_push($replace, "'FORCE_SSL_ADMIN', false");
}
if ($_POST['ssl_login']) {
if (!strstr($wpconfig, 'FORCE_SSL_LOGIN')) {
$wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_LOGIN', true);";
}
} else {
array_push($patterns, "/'FORCE_SSL_LOGIN',\\s*true/");
示例2: array
//WP-CONFIG: wp-config
//===============================
$wpconfig = @file_get_contents('wp-config.php', true);
$patterns = array(
"/'DB_NAME',\s*'.*?'/",
"/'DB_USER',\s*'.*?'/",
"/'DB_PASSWORD',\s*'.*?'/",
"/'DB_HOST',\s*'.*?'/");
$db_host = ($_POST['dbport'] == 3306) ? $_POST['dbhost'] : "{$_POST['dbhost']}:{$_POST['dbport']}";
$replace = array(
"'DB_NAME', " . '\'' . $_POST['dbname'] . '\'',
"'DB_USER', " . '\'' . $_POST['dbuser'] . '\'',
"'DB_PASSWORD', " . '\'' . DupUtil::preg_replacement_quote($_POST['dbpass']) . '\'',
"'DB_HOST', " . '\'' . $db_host . '\'');
//SSL CHECKS
if ($_POST['ssl_admin']) {
if (! strstr($wpconfig, 'FORCE_SSL_ADMIN')) {
$wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_ADMIN', true);";
}
} else {
array_push($patterns, "/'FORCE_SSL_ADMIN',\s*true/");
array_push($replace, "'FORCE_SSL_ADMIN', false");
}
if ($_POST['ssl_login']) {
if (! strstr($wpconfig, 'FORCE_SSL_LOGIN')) {
$wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_LOGIN', true);";