本文整理汇总了PHP中BackWPup_Job::get_folders_to_backup方法的典型用法代码示例。如果您正苦于以下问题:PHP BackWPup_Job::get_folders_to_backup方法的具体用法?PHP BackWPup_Job::get_folders_to_backup怎么用?PHP BackWPup_Job::get_folders_to_backup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackWPup_Job
的用法示例。
在下文中一共展示了BackWPup_Job::get_folders_to_backup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: job_run
/**
* @param $job_object
* @return bool
*/
public function job_run(BackWPup_Job $job_object)
{
if ($job_object->steps_data[$job_object->step_working]['SAVE_STEP_TRY'] != $job_object->steps_data[$job_object->step_working]['STEP_TRY']) {
$job_object->log(sprintf(__('%d. Trying to make a list of folders to back up …', 'backwpup'), $job_object->steps_data[$job_object->step_working]['STEP_TRY']));
}
$job_object->substeps_todo = 8;
$abs_path = realpath(ABSPATH);
if ($job_object->job['backupabsfolderup']) {
$abs_path = dirname($abs_path);
}
$abs_path = trailingslashit(str_replace('\\', '/', $abs_path));
$job_object->temp['folders_to_backup'] = array();
$folders_already_in = $job_object->get_folders_to_backup();
//Folder lists for blog folders
if ($job_object->substeps_done === 0) {
if ($abs_path && !empty($job_object->job['backuproot'])) {
$abs_path = trailingslashit(str_replace('\\', '/', $abs_path));
$excludes = $this->get_exclude_dirs($abs_path, $folders_already_in);
foreach ($job_object->job['backuprootexcludedirs'] as $folder) {
$excludes[] = trailingslashit($abs_path . $folder);
}
$this->get_folder_list($job_object, $abs_path, $excludes);
}
$job_object->substeps_done = 1;
$job_object->update_working_data();
$job_object->do_restart_time();
}
if ($job_object->substeps_done === 1) {
$wp_content_dir = realpath(WP_CONTENT_DIR);
if ($wp_content_dir && !empty($job_object->job['backupcontent'])) {
$wp_content_dir = trailingslashit(str_replace('\\', '/', $wp_content_dir));
$excludes = $this->get_exclude_dirs($wp_content_dir, $folders_already_in);
foreach ($job_object->job['backupcontentexcludedirs'] as $folder) {
$excludes[] = trailingslashit($wp_content_dir . $folder);
}
$this->get_folder_list($job_object, $wp_content_dir, $excludes);
}
$job_object->substeps_done = 2;
$job_object->update_working_data();
$job_object->do_restart_time();
}
if ($job_object->substeps_done === 2) {
$wp_plugin_dir = realpath(WP_PLUGIN_DIR);
if ($wp_plugin_dir && !empty($job_object->job['backupplugins'])) {
$wp_plugin_dir = trailingslashit(str_replace('\\', '/', $wp_plugin_dir));
$excludes = $this->get_exclude_dirs($wp_plugin_dir, $folders_already_in);
foreach ($job_object->job['backuppluginsexcludedirs'] as $folder) {
$excludes[] = trailingslashit($wp_plugin_dir . $folder);
}
$this->get_folder_list($job_object, $wp_plugin_dir, $excludes);
}
$job_object->substeps_done = 3;
$job_object->update_working_data();
$job_object->do_restart_time();
}
if ($job_object->substeps_done === 3) {
$theme_root = realpath(get_theme_root());
if ($theme_root && !empty($job_object->job['backupthemes'])) {
$theme_root = trailingslashit(str_replace('\\', '/', $theme_root));
$excludes = $this->get_exclude_dirs($theme_root, $folders_already_in);
foreach ($job_object->job['backupthemesexcludedirs'] as $folder) {
$excludes[] = trailingslashit($theme_root . $folder);
}
$this->get_folder_list($job_object, $theme_root, $excludes);
}
$job_object->substeps_done = 4;
$job_object->update_working_data();
$job_object->do_restart_time();
}
if ($job_object->substeps_done === 4) {
$upload_dir = realpath(BackWPup_File::get_upload_dir());
if ($upload_dir && !empty($job_object->job['backupuploads'])) {
$upload_dir = trailingslashit(str_replace('\\', '/', $upload_dir));
$excludes = $this->get_exclude_dirs($upload_dir, $folders_already_in);
foreach ($job_object->job['backupuploadsexcludedirs'] as $folder) {
$excludes[] = trailingslashit($upload_dir . $folder);
}
$this->get_folder_list($job_object, $upload_dir, $excludes);
}
$job_object->substeps_done = 5;
$job_object->update_working_data();
$job_object->do_restart_time();
}
if ($job_object->substeps_done === 5) {
//include dirs
if ($job_object->job['dirinclude']) {
$dirinclude = explode(',', $job_object->job['dirinclude']);
$dirinclude = array_unique($dirinclude);
//Crate file list for includes
foreach ($dirinclude as $dirincludevalue) {
if (is_dir($dirincludevalue)) {
$this->get_folder_list($job_object, $dirincludevalue);
}
}
}
$job_object->substeps_done = 6;
//.........这里部分代码省略.........