本文整理汇总了PHP中hmbkp_rmdirtree函数的典型用法代码示例。如果您正苦于以下问题:PHP hmbkp_rmdirtree函数的具体用法?PHP hmbkp_rmdirtree怎么用?PHP hmbkp_rmdirtree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hmbkp_rmdirtree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
*/
public function tearDown()
{
// Remove all backup paths that exist
foreach ($this->path->get_existing_paths() as $path) {
hmbkp_rmdirtree($path);
}
}
示例2: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
* @access public
*/
public function tearDown()
{
hmbkp_rmdirtree(hmbkp_path());
delete_option('hmbkp_path');
delete_option('hmbkp_default_path');
unset($this->backup);
}
示例3: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
*/
public function tearDown()
{
hmbkp_rmdirtree(hmbkp_path());
chmod($this->backup->get_root() . '/test-data.txt', 0664);
unset($this->backup);
HM\BackUpWordPress\Path::get_instance()->reset_path();
}
示例4: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
*/
public function tearDown()
{
hmbkp_rmdirtree(hmbkp_path());
unset($this->backup);
if (file_exists($this->symlink)) {
unlink($this->symlink);
}
HM\BackUpWordPress\Path::get_instance()->reset_path();
}
示例5: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
* @access public
*/
public function tearDown()
{
hmbkp_rmdirtree($this->backup->get_path());
hmbkp_rmdirtree(hmbkp_path());
delete_option('hmbkp_path');
delete_option('hmbkp_default_path');
chmod($this->backup->get_root() . '/test-data.txt', 0664);
unset($this->backup);
}
示例6: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
*/
public function tearDown()
{
if (!function_exists('symlink')) {
return;
}
hmbkp_rmdirtree(hmbkp_path());
unset($this->backup);
@unlink($this->symlink);
HM\BackUpWordPress\Path::get_instance()->reset_path();
}
示例7: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
* @access public
*/
public function tearDown()
{
hmbkp_rmdirtree($this->backup->get_path());
hmbkp_rmdirtree(hmbkp_path());
delete_option('hmbkp_path');
delete_option('hmbkp_default_path');
unset($this->backup);
if (file_exists($this->hidden)) {
unlink($this->hidden);
}
}
示例8: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
* @access public
*/
public function tearDown()
{
if (file_exists($this->custom_path)) {
chmod($this->custom_path, 0755);
}
hmbkp_rmdirtree($this->custom_path);
hmbkp_rmdirtree(hmbkp_path());
hmbkp_rmdirtree(hmbkp_path_default());
delete_option('hmbkp_path');
delete_option('hmbkp_default_path');
unset($this->backup);
}
示例9: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
* @access public
*/
public function tearDown()
{
if (!function_exists('symlink')) {
return;
}
hmbkp_rmdirtree($this->backup->get_path());
hmbkp_rmdirtree(hmbkp_path());
delete_option('hmbkp_path');
delete_option('hmbkp_default_path');
unset($this->backup);
@unlink($this->symlink);
}
示例10: tearDown
public function tearDown()
{
// Restore the is_apache global in-case it was messed with in the test
global $is_apache;
if (isset($this->is_apache)) {
$is_apache = $this->is_apache;
}
// Remove all backup paths that exist
foreach ($this->path->get_existing_paths() as $path) {
hmbkp_rmdirtree($path);
}
// Remove our custom path
hmbkp_rmdirtree($this->custom_path);
}
示例11: move_old_backups
/**
* Move backup files from an existing directory and the new
* location
*
* @param string $path The path to move the backups from
* @return void
*/
public function move_old_backups($from)
{
if (!is_readable($from)) {
return;
}
if (!wp_is_writable($this->get_path())) {
return;
}
// Move any existing backups
if ($handle = opendir($from)) {
// Loop through the backup directory
while (false !== ($file = readdir($handle))) {
// Find all zips
if ('zip' === pathinfo($file, PATHINFO_EXTENSION)) {
// Try to move them
if (!@rename(trailingslashit($from) . $file, trailingslashit($this->get_path()) . $file)) {
// If we can't move them then try to copy them
copy(trailingslashit($from) . $file, trailingslashit($this->get_path()) . $file);
}
}
}
closedir($handle);
}
// Delete the old directory if it's inside WP_CONTENT_DIR
if (false !== strpos($from, WP_CONTENT_DIR) && $from !== $this->get_path()) {
hmbkp_rmdirtree($from);
}
}
示例12: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*
*/
public function tearDown()
{
hmbkp_rmdirtree(hmbkp_path());
unset($this->backup);
HM\BackUpWordPress\Path::get_instance()->reset_path();
}
示例13: hmbkp_cleanup
/**
* Remove any non backup.zip files from the backups dir.
*
* @return void
*/
function hmbkp_cleanup()
{
if (defined('HMBKP_PATH') && HMBKP_PATH) {
return;
}
$hmbkp_path = hmbkp_path();
if (!is_dir($hmbkp_path)) {
return;
}
if ($handle = opendir($hmbkp_path)) {
while (false !== ($file = readdir($handle))) {
if (!in_array($file, array('.', '..', 'index.html')) && pathinfo($file, PATHINFO_EXTENSION) !== 'zip') {
hmbkp_rmdirtree(trailingslashit($hmbkp_path) . $file);
}
}
closedir($handle);
}
}
示例14: define
<?php
if (!defined('HMBKP_PLUGIN_PATH')) {
define('HMBKP_PLUGIN_PATH', plugin_dir_path(__FILE__));
}
// Load the schedules
require_once HMBKP_PLUGIN_PATH . 'hm-backup/hm-backup.php';
require_once HMBKP_PLUGIN_PATH . 'classes/class-services.php';
require_once HMBKP_PLUGIN_PATH . 'classes/class-schedule.php';
require_once HMBKP_PLUGIN_PATH . 'classes/class-schedules.php';
require_once HMBKP_PLUGIN_PATH . 'functions/core.php';
$schedules = HMBKP_Schedules::get_instance();
// Cancel all the schedules and delete all the backups
foreach ($schedules->get_schedules() as $schedule) {
$schedule->cancel(true);
}
// Remove the backups directory
hmbkp_rmdirtree(hmbkp_path());
// Remove all the options
foreach (array('hmbkp_enable_support', 'hmbkp_plugin_version', 'hmbkp_path', 'hmbkp_default_path', 'hmbkp_upsell') as $option) {
delete_option($option);
}
示例15: tearDown
/**
* Cleanup the backup file and tmp directory
* after every test
*/
public function tearDown()
{
hmbkp_rmdirtree(hmbkp_path());
@unlink($this->backup->get_root() . '/new.file');
HM\BackUpWordPress\Path::get_instance()->reset_path();
}