当前位置: 首页>>代码示例>>PHP>>正文


PHP DupUtil::preg_replacement_quote方法代码示例

本文整理汇总了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/");
开发者ID:DIESELOK,项目名称:GH-Frontend-5,代码行数:31,代码来源:ajax.step1.php

示例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);";
开发者ID:johnmanlove,项目名称:JMMC_Corp-Site,代码行数:31,代码来源:JMMC_5669f34bd4d9b2909151210214859_installer.php


注:本文中的DupUtil::preg_replacement_quote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。