// Get the contents of each comic image folder.
if ($comic_dir_list) {
    foreach ($comic_dir_list as $subdirectory) {
        $subdirectory = DIR_COMICS_IMG . '/' . $subdirectory;
        $this_dir = $fileops->get_dir_list($subdirectory);
        // Build full paths with the comic folder’s name, individual comic folders’ names, and filename.
        if ($this_dir) {
            foreach ($this_dir as $filename) {
                $filename = $milieu_list['directory']['value'] . substr($subdirectory, 2) . '/' . $filename;
                $filename_list[$filename] = $filename;
            }
        }
    }
}
// Get a list of all comic images in the database.
$reference_list = get_image_reference($db);
// Compare the two.
if ($filename_list) {
    // Look for images in FTP but not in MySQL.
    foreach ($filename_list as $key => $val) {
        if (!$reference_list[$key]) {
            $ftp_not_mysql[$key] = $val;
        }
    }
    // Look for images in MySQL but not in FTP.
    if ($reference_list) {
        foreach ($reference_list as $key => $val) {
            if (!$filename_list[$key] && substr($key, 0, 4) != 'http') {
                $mysql_not_ftp[$key] = $val;
            }
        }
Exemplo n.º 2
0
 /**
  * Get the names of images in the database that are missing from the comics directory
  *
  * @return array $list - list of names
  */
 public function missing_comic_image_list()
 {
     $file_list = $this->comics_dir_list();
     $reference_list = get_image_reference($this->db);
     foreach ($reference_list as $key => $val) {
         if (!$file_list[$key]) {
             $list[$key] = $val;
         }
     }
     return $list;
 }