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


PHP DupUtil::add_slash方法代码示例

本文整理汇总了PHP中DupUtil::add_slash方法的典型用法代码示例。如果您正苦于以下问题:PHP DupUtil::add_slash方法的具体用法?PHP DupUtil::add_slash怎么用?PHP DupUtil::add_slash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DupUtil的用法示例。


在下文中一共展示了DupUtil::add_slash方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Setup

    /** METHOD: ResetHTACCESS
     *  Resetst the .htaccess file
     */
    public static function Setup()
    {
        if (!isset($_POST['url_new'])) {
            return;
        }
        DUPX_Log::Info("\nWEB SERVER CONFIGURATION FILE BASIC SETUP:");
        $currdata = parse_url($_POST['url_old']);
        $newdata = parse_url($_POST['url_new']);
        $currpath = DupUtil::add_slash(isset($currdata['path']) ? $currdata['path'] : "");
        $newpath = DupUtil::add_slash(isset($newdata['path']) ? $newdata['path'] : "");
        $tmp_htaccess = <<<HTACCESS
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$newpath}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$newpath}index.php [L]
</IfModule>
# END WordPress
HTACCESS;
        file_put_contents('.htaccess', $tmp_htaccess);
        @chmod('.htaccess', 0644);
        DUPX_Log::Info("created basic .htaccess file.  If using IIS web.config this process will need to be done manually.");
    }
开发者ID:renztoygwapo,项目名称:lincoln,代码行数:29,代码来源:class.config.php

示例2: isPathNew

 private static function isPathNew()
 {
     $currdata = parse_url($_POST['url_old']);
     $newdata = parse_url($_POST['url_new']);
     $currpath = DupUtil::add_slash(isset($currdata['path']) ? $currdata['path'] : "");
     $newpath = DupUtil::add_slash(isset($newdata['path']) ? $newdata['path'] : "");
     return $currpath != $newpath;
 }
开发者ID:tlandn,项目名称:akvo-web,代码行数:8,代码来源:class.config.php

示例3: array

$patterns = array("/'WP_HOME',\\s*'.*?'/", "/'WP_SITEURL',\\s*'.*?'/");
$replace = array("'WP_HOME', " . '\'' . $_POST['url_new'] . '\'', "'WP_SITEURL', " . '\'' . $_POST['url_new'] . '\'');
$config_file = @file_get_contents('wp-config.php', true);
$config_file = preg_replace($patterns, $replace, $config_file);
file_put_contents('wp-config.php', $config_file);
//Create Snapshots directory
if (!file_exists(DUPLICATOR_SSDIR_NAME)) {
    mkdir(DUPLICATOR_SSDIR_NAME, 0755);
}
$fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w');
fclose($fp);
//WEB CONFIG FILE
$currdata = parse_url($_POST['url_old']);
$newdata = parse_url($_POST['url_new']);
$currpath = DupUtil::add_slash(isset($currdata['path']) ? $currdata['path'] : "");
$newpath = DupUtil::add_slash(isset($newdata['path']) ? $newdata['path'] : "");
if ($currpath != $newpath) {
    DupUtil::log("HTACCESS CHANGES:");
    @copy('.htaccess', '.htaccess.orig');
    @copy('web.config', 'web.config.orig');
    @unlink('.htaccess');
    @unlink('web.config');
    DupUtil::log("created backup of original .htaccess to htaccess.orig and web.config to web.config.orig");
    $tmp_htaccess = <<<HTACCESS

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$newpath}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
开发者ID:batruji,项目名称:metareading,代码行数:31,代码来源:ajax.step2.php

示例4: strrpos

<?php

$dbh = @mysqli_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
$all_tables = DupUtil::get_database_tables($dbh);
$active_plugins = DupUtil::get_active_plugins($dbh);
$old_path = $GLOBALS['FW_WPROOT'];
$new_path = DupUtil::set_safe_path($GLOBALS['CURRENT_ROOT_PATH']);
$new_path = strrpos($old_path, '/') + 1 == strlen($old_path) ? DupUtil::add_slash($new_path) : $new_path;
?>

<script type="text/javascript">
	/** **********************************************
	* METHOD:  
	* Timeout (10000000 = 166 minutes) */
	Duplicator.runUpdate = function() {
		
		//Validation
		var wp_username = $.trim($("#wp_username").val()).length || 0;
		var wp_password = $.trim($("#wp_password").val()).length || 0;
		
		if ( $.trim($("#url_new").val()) == "" )  {alert("The 'New URL' field is required!"); return false;}
		if ( $.trim($("#siteurl").val()) == "" )  {alert("The 'Site URL' field is required!"); return false;}
		if (wp_username >= 1 && wp_username < 4) {alert("The New Admin Account 'Username' must be four or more characters"); return false;}
		if (wp_username >= 4 && wp_password < 6) {alert("The New Admin Account 'Password' must be six or more characters"); return false;}

		$.ajax({
			type: "POST",
			timeout: 10000000,
			dataType: "json",			
			url: window.location.href,
			data: $('#dup-step2-input-form').serialize(),
开发者ID:tlandn,项目名称:akvo-web,代码行数:31,代码来源:view.step2.php


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