コード例 #1
0
ファイル: Resizer.php プロジェクト: frostiks25/rzwebsys7
 /**
  * Возвращает имя изображени для охранения
  * @param string $path путь к изображению
  * @param int $width ширина
  * @param int $height высота
  * @return string
  */
 public function getThumbName($path, $width, $height)
 {
     $md5 = md5($path . filectime($path) . $width . $height);
     $ext = FileHelper::getExtension($path);
     return $md5 . "." . $ext;
 }
コード例 #2
0
 /**
  * Разрешен ли файл к загрузке
  * @param $file UploadedFile
  * @return bool
  */
 protected function isAllowedToUpload($file)
 {
     $ext = FileHelper::getExtension($file->name);
     return in_array($ext, $this->allowed);
 }
コード例 #3
0
ファイル: File.php プロジェクト: frostiks25/rzwebsys7
 /**
  * Возвращает расширение файла
  * @return string
  */
 public function getExt()
 {
     return FileHelper::getExtension($this->path);
 }