commit
						236904087b
					
				| @ -223,10 +223,10 @@ class CronUploader extends Extension | |||||||
|      */ |      */ | ||||||
|     public function scan_dir(string $path): array |     public function scan_dir(string $path): array | ||||||
|     { |     { | ||||||
|         $ite=new RecursiveDirectoryIterator($path); |  | ||||||
|      |  | ||||||
|         $bytestotal=0; |         $bytestotal=0; | ||||||
|         $nbfiles=0; |         $nbfiles=0; | ||||||
|  | 
 | ||||||
|  |         $ite=new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS); | ||||||
|         foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) { |         foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) { | ||||||
|             $filesize = $cur->getSize(); |             $filesize = $cur->getSize(); | ||||||
|             $bytestotal += $filesize; |             $bytestotal += $filesize; | ||||||
| @ -264,7 +264,7 @@ class CronUploader extends Extension | |||||||
|         shuffle($this->image_queue); |         shuffle($this->image_queue); | ||||||
| 
 | 
 | ||||||
|         // Upload the file(s)
 |         // Upload the file(s)
 | ||||||
|         for ($i = 0; $i < $upload_count; $i++) { |         for ($i = 0; $i < $upload_count && $i < sizeof($this->image_queue); $i++) { | ||||||
|             $img = $this->image_queue[$i]; |             $img = $this->image_queue[$i]; | ||||||
|              |              | ||||||
|             try { |             try { | ||||||
| @ -340,26 +340,18 @@ class CronUploader extends Extension | |||||||
|         $img->set_tags(Tag::explode($tags)); |         $img->set_tags(Tag::explode($tags)); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     private function generate_image_queue(string $base = "", string $subdir = ""): void |     private function generate_image_queue(): void | ||||||
|     { |     { | ||||||
|         if ($base == "") { |         $base = $this->root_dir . "/queue"; | ||||||
|             $base = $this->root_dir . "/queue"; |  | ||||||
|         } |  | ||||||
|          |          | ||||||
|         if (! is_dir($base)) { |         if (! is_dir($base)) { | ||||||
|             $this->add_upload_info("Image Queue Directory could not be found at \"$base\".");
 |             $this->add_upload_info("Image Queue Directory could not be found at \"$base\".");
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         foreach (glob("$base/$subdir/*") as $fullpath) { |         $ite=new RecursiveDirectoryIterator($base, FilesystemIterator::SKIP_DOTS); | ||||||
|             $fullpath = str_replace("//", "/", $fullpath); |         foreach (new RecursiveIteratorIterator($ite) as $fullpath=>$cur) { | ||||||
|             //$shortpath = str_replace ( $base, "", $fullpath );
 |             if (!is_link($fullpath) && !is_dir($fullpath)) { | ||||||
|              |  | ||||||
|             if (is_link($fullpath)) { |  | ||||||
|                 // ignore
 |  | ||||||
|             } elseif (is_dir($fullpath)) { |  | ||||||
|                 $this->generate_image_queue($base, str_replace($base, "", $fullpath)); |  | ||||||
|             } else { |  | ||||||
|                 $pathinfo = pathinfo($fullpath); |                 $pathinfo = pathinfo($fullpath); | ||||||
|                 $matches = []; |                 $matches = []; | ||||||
|                  |                  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user