Пример #1
0
 private function makeParameters($image)
 {
     self::makeHash($this->string_original = $image);
     if (file_exists($this->cache_folder . '/' . $this->hash)) {
         $this->load($this->hash);
     } else {
         $temp = explode('.', $image);
         $extension = end($temp);
         $parameters = explode('-', array_shift($temp));
         $file = array_shift($parameters) . '.' . $extension;
         foreach ($parameters as $value) {
             $tempA = explode(':', $value);
             $this->parameters[$tempA[0]] = $tempA[1];
         }
         if (file_exists(parent::getApplicationPath() . parent::getConfiguration()['images_folder'] . '/' . $file)) {
             $this->file_original = $file;
             \PHPicture\Core\PHPFactory::make($this->file_original, $this->hash, $this->parameters);
         } else {
             throw new PHPictureException('Image [' . $file . '] not exists!');
         }
     }
 }