Esempio n. 1
0
 /**
  * Run file system scan and retrieve ignored folders.
  *
  * Run a file system scan and retrieve an array with two indexes, the first
  * containing a list of ignored directory paths and their respective timestamps
  * of when they were added by an administrator user, and the second containing a
  * list of directories that are not being ignored.
  *
  * @return array List of ignored and not ignored directories.
  */
 public static function get_ignored_directories_live()
 {
     $response = array('is_ignored' => array(), 'is_not_ignored' => array());
     // Get the ignored directories from the cache.
     $ignored_directories = self::get_ignored_directories();
     if ($ignored_directories) {
         $response['is_ignored'] = $ignored_directories['raw'];
     }
     // Scan the project and file all directories.
     $file_info = new SucuriScanFileInfo();
     $file_info->ignore_files = true;
     $file_info->ignore_directories = true;
     $file_info->scan_interface = SucuriScanOption::get_option(':scan_interface');
     $directory_list = $file_info->get_diretories_only(ABSPATH);
     if ($directory_list) {
         $response['is_not_ignored'] = $directory_list;
     }
     return $response;
 }