當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。