當前位置: 首頁>>代碼示例>>PHP>>正文


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怎麽用?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;
//.........這裏部分代碼省略.........
開發者ID:skinnard,項目名稱:FTL-2,代碼行數:101,代碼來源:class-jobtype-file.php


注:本文中的BackWPup_Job::get_folders_to_backup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。