$value){ #var_dump($value); // loading basic info for the file $id = intval($value['id']); $file = Factory::getFileByID($id); $data = $file->getData(); if ($data['deleted'] == 't') { // deleted, delete the thumbnails and original // save the status for that file #echo "file ".$value['id']." was found\n"; #$query = "update file set renderprocess = 'allfilesremoved' where id = " . $value['id']; echo "thumbnails for ".$value['id']." were physically deleted\n"; var_dump($value['setupaccountid']); var_dump($value['id']); $deletionarray = array("id" => $value['id'], "setupaccountid" => $value['setupaccountid'], "currentaccountid" => $value['setupaccountid']); // delete thumbnails File::deleteFilesFromDisk($deletionarray); // delete original $deletionarray['directory'] = "originals"; File::deleteFilesFromDisk($deletionarray); $query = "update file set renderprocess = 'thumbnailsdeleted' where id = " . $id; $results = query($query); } else { // not deleted, render the thumbnails // run through all file dimensions foreach ($filedimensions as $filedimension) { // and fetch the images via curl to render them $url = $file->getFileURL($filedimension); getURL($url); } // save the status for that file echo "thumbnails for #".$value['id']." were created\n"; $query = "update file set renderprocess = 'thumbnailsrendered' where id = " . $id; $results = query($query); } #var_dump($id); /* $header_size = $curl_info[header_size]; $header = substr($buffer, 0, $header_size); echo $header; */ /* #$data = $file->getData(); $idtrippletpath = substr(id2triplet_path($id), 1); #$original = '/var/data/dev/files/originals/' . $idtrippletpath . $id . $fileextension; $original = $GLOBALS['file']['original_path'] . $idtrippletpath . $id . $fileextension; $uploaddirthumbs =$GLOBALS['file']['thumbnail_path']; // check if file path exists, creating it recursively if not if (!is_dir($GLOBALS['file']['thumbnail_path'] . $idtrippletpath)) { mkdir($GLOBALS['file']['thumbnail_path'] . $idtrippletpath, 0775, true); } $updatefile = array(); // override session checking $updatefile['currentaccount']['accountid'] = 26; $updatefile['currentaccount']['accountservices'] = "admin"; $file = Factory::getFileByID($id); $dooley = $file->updateData($updatefile); if (file_exists($GLOBALS['file']['original_path'] . $trippleid)) { // original is there echo "file ".$value['id']." was found\n"; $query = "update file set temporigmissingrowprocessed = TRUE, temporigmissingfromdisk = FALSE where id = " . $value['id']; $results = query($query); } else { echo "file ".$value['id']." is **missing**\n"; // original is not there $query = "update file set temporigmissingrowprocessed = TRUE, temporigmissingfromdisk = TRUE where id = " . $value['id']; $results = query($query); } */ } ?>