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


PHP Path::get_home_path方法代码示例

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


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

示例1: test_standard_install_in_subdirectory_2

 /**
  * In this scenario, WordPress is installed in a subdirectory with index.php in root and wp-config.php in the subdirectory.
  */
 function test_standard_install_in_subdirectory_2()
 {
     $abspath = $this->test_data . '/exclude';
     $this->wp_config_in($abspath);
     $this->index_in(dirname($abspath));
     $path = Path::get_home_path($abspath);
     $this->assertEquals(dirname($abspath), $path);
 }
开发者ID:Webikon,项目名称:backupwordpress,代码行数:11,代码来源:test-get-home-path.php

示例2: request_download_backup

/**
 * Send the download file to the browser and then redirect back to the backups page
 */
function request_download_backup()
{
    check_admin_referer('hmbkp_download_backup', 'hmbkp_download_backup_nonce');
    if (!file_exists(sanitize_text_field(base64_decode($_GET['hmbkp_backup_archive'])))) {
        return;
    }
    $url = str_replace(wp_normalize_path(Path::get_home_path()), home_url('/'), trailingslashit(dirname(sanitize_text_field(base64_decode($_GET['hmbkp_backup_archive']))))) . urlencode(pathinfo(sanitize_text_field(base64_decode($_GET['hmbkp_backup_archive'])), PATHINFO_BASENAME));
    global $is_apache;
    if ($is_apache) {
        Path::get_instance()->protect_path('reset');
        $url = add_query_arg('key', HMBKP_SECURE_KEY, $url);
    }
    wp_safe_redirect($url, 303);
    die;
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:18,代码来源:actions.php

示例3: test_standard_install_in_subdirectory

 /**
  * In this scenario, WordPress is installed in a subdirectory with index.php and wp-config both in root.
  */
 function test_standard_install_in_subdirectory()
 {
     $home = get_option('home');
     $siteurl = get_option('siteurl');
     $sfn = $_SERVER['SCRIPT_FILENAME'];
     $this->assertEquals(wp_normalize_path(untrailingslashit(ABSPATH)), Path::get_home_path());
     update_option('home', 'http://localhost');
     update_option('siteurl', 'http://localhost/wp');
     $_SERVER['SCRIPT_FILENAME'] = 'D:\\root\\vhosts\\site\\httpdocs\\wp\\wp-admin\\options-permalink.php';
     $this->assertEquals('D:/root/vhosts/site/httpdocs/', trailingslashit(Path::get_home_path()));
     $_SERVER['SCRIPT_FILENAME'] = '/Users/foo/public_html/trunk/wp/wp-admin/options-permalink.php';
     $this->assertEquals('/Users/foo/public_html/trunk/', trailingslashit(Path::get_home_path()));
     $_SERVER['SCRIPT_FILENAME'] = 'S:/home/wordpress/trunk/wp/wp-admin/options-permalink.php';
     $this->assertEquals('S:/home/wordpress/trunk/', trailingslashit(Path::get_home_path()));
     update_option('home', $home);
     update_option('siteurl', $siteurl);
     $_SERVER['SCRIPT_FILENAME'] = $sfn;
 }
开发者ID:humanmade,项目名称:backupwordpress,代码行数:21,代码来源:test-get-home-path.php

示例4: printf

			<td>

				<?php 
if (defined('HMBKP_ROOT')) {
    ?>
					<p><?php 
    printf(__('You\'ve set it to: %s', 'backupwordpress'), '<code>' . esc_html(HMBKP_ROOT) . '</code>');
    ?>
</p>
				<?php 
}
?>

				<p><?php 
printf(__('The root directory that is backed up. Defaults to %s.', 'backupwordpress'), '<code>' . Path::get_home_path() . '</code>');
?>
 <?php 
_e('e.g.', 'backupwordpress');
?>
 <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p>

			</td>

		</tr>

		<tr<?php 
if (defined('HMBKP_SCHEDULE_TIME') && HMBKP_SCHEDULE_TIME !== '11pm') {
    ?>
 class="hmbkp_active"<?php 
}
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:30,代码来源:constants.php

示例5: sprintf

        $reoccurrence = sprintf(__('weekly on %1$s at %2$s', 'backupwordpress'), '<span ' . $next_backup . '>' . esc_html($day) . '</span>', '<span>' . esc_html(date_i18n(get_option('time_format'), $schedule->get_next_occurrence(false))) . '</span>');
        break;
    case 'fortnightly':
        $reoccurrence = sprintf(__('every two weeks on %1$s at %2$s', 'backupwordpress'), '<span ' . $next_backup . '>' . $day . '</span>', '<span>' . esc_html(date_i18n(get_option('time_format'), $schedule->get_next_occurrence(false))) . '</span>');
        break;
    case 'monthly':
        $reoccurrence = sprintf(__('on the %1$s of each month at %2$s', 'backupwordpress'), '<span ' . $next_backup . '>' . esc_html(date_i18n('jS', $schedule->get_next_occurrence(false))) . '</span>', '<span>' . esc_html(date_i18n(get_option('time_format'), $schedule->get_next_occurrence(false))) . '</span>');
        break;
    case 'manually':
        $reoccurrence = __('manually', 'backupwordpress');
        break;
    default:
        $reoccurrence = __('manually', 'backupwordpress');
        $schedule->set_reoccurrence('manually');
}
$server = '<code title="' . __('Check the help tab to learn how to change where your backups are stored.', 'backupwordpress') . '">' . esc_attr(str_replace(Path::get_home_path(), '', Path::get_path())) . '</code>';
// Backup to keep
switch ($schedule->get_max_backups()) {
    case 1:
        $backup_to_keep = sprintf(__('store the most recent backup in %s', 'backupwordpress'), $server);
        break;
    case 0:
        $backup_to_keep = sprintf(__('don\'t store any backups in on this server', 'backupwordpress'), Path::get_path());
        break;
    default:
        $backup_to_keep = sprintf(__('store the last %1$s backups in %2$s', 'backupwordpress'), esc_html($schedule->get_max_backups()), $server);
}
$email_msg = '';
$services = array();
foreach (Services::get_services($schedule) as $file => $service) {
    if (is_wp_error($service)) {
开发者ID:humanmade,项目名称:backupwordpress,代码行数:31,代码来源:schedule-sentence.php

示例6: is_path_accessible

function is_path_accessible($dir)
{
    // Path is inaccessible
    if (strpos($dir, Path::get_home_path()) === false) {
        return false;
    }
    return true;
}
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:8,代码来源:core.php

示例7: sprintf

        break;
    case 'fortnightly':
        $reoccurrence = sprintf(__('every two weeks on %1$s at %2$s', 'backupwordpress'), '<span ' . $next_backup . '>' . $day . '</span>', '<span>' . esc_html(date_i18n(get_option('time_format'), $schedule->get_next_occurrence(false))) . '</span>');
        break;
    case 'monthly':
        $reoccurrence = sprintf(__('on the %1$s of each month at %2$s', 'backupwordpress'), '<span ' . $next_backup . '>' . esc_html(date_i18n('jS', $schedule->get_next_occurrence(false))) . '</span>', '<span>' . esc_html(date_i18n(get_option('time_format'), $schedule->get_next_occurrence(false))) . '</span>');
        break;
    case 'manually':
        $reoccurrence = __('manually', 'backupwordpress');
        break;
    default:
        $reoccurrence = __('manually', 'backupwordpress');
        $schedule->set_reoccurrence('manually');
}
$server = '<span title="' . esc_attr(Path::get_path()) . '">' . __('this server', 'backupwordpress') . '</span>';
$server = '<code>' . esc_attr(str_replace(Path::get_home_path(), '', Path::get_path())) . '</code>';
// Backup to keep
switch ($schedule->get_max_backups()) {
    case 1:
        $backup_to_keep = sprintf(__('store the most recent backup in %s', 'backupwordpress'), $server);
        break;
    case 0:
        $backup_to_keep = sprintf(__('don\'t store any backups in on this server', 'backupwordpress'), Path::get_path());
        break;
    default:
        $backup_to_keep = sprintf(__('store the last %1$s backups in %2$s', 'backupwordpress'), esc_html($schedule->get_max_backups()), $server);
}
$email_msg = '';
$services = array();
foreach (Services::get_services($schedule) as $file => $service) {
    if (is_wp_error($service)) {
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:31,代码来源:schedule-sentence.php


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