コード例 #1
0
 public function storeImageToTempPath(AlvineImage $image, $skipIdExists = true)
 {
     $destination = $this->imageTempDir . $image->getName();
     if ($skipIdExists && is_file($destination)) {
         return filesize($destination);
     }
     $imageContent = @file_get_contents($image->getUrl());
     if ($imageContent === false) {
         throw new Exception("unable to fetch image " . $image->getUrl());
     }
     return file_put_contents($destination, $imageContent);
 }
コード例 #2
0
 public static function detailImage(AlvineImage $image)
 {
     return ['disabled' => 0, 'position' => 99, 'label' => $image->getName(), 'filename' => $image->getName(), 'url' => $image->getUrl()];
 }