freedomsex / photo-upload-bundle
Package info
github.com/freedomsex/photo-upload-bundle
Type:symfony-bundle
pkg:composer/freedomsex/photo-upload-bundle
1.1.8
2021-12-25 00:57 UTC
Requires
- php: ^7.4
- doctrine/doctrine-bundle: ^2.4
- doctrine/orm: ^2.10
- liip/imagine-bundle: ~2.1
- symfony/config: ^5.0
- symfony/console: ^5.0
- symfony/dependency-injection: ^5.0
- symfony/dotenv: ^5.0
- symfony/finder: ^5.0
- symfony/flex: ^1.17
- symfony/framework-bundle: ^5.0
- symfony/http-kernel: ^5.0
- symfony/runtime: ^5.0
- symfony/validator: ^5.0
- symfony/yaml: ^5.0
- vich/uploader-bundle: ~1.9
Requires (Dev)
- dama/doctrine-test-bundle: ^6.7
- deployer/deployer: ^6.8
- doctrine/doctrine-fixtures-bundle: ^3.4
- phpunit/phpunit: ^9.5
- symfony/browser-kit: ^5.0
- symfony/css-selector: ^5.0
- symfony/debug-bundle: ^5.0
- symfony/maker-bundle: ^1.36
- symfony/phpunit-bridge: ^6.0
- symfony/stopwatch: ^5.0
- symfony/web-profiler-bundle: ^5.0
- symfony/web-server-bundle: ^4.4
- zenstruck/foundry: ^1.14
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Component for projects FreedomSex.
Provides image file download service. The interface of the entity of the file. Presets path and file naming configurations. A usage strategy may turn out to be project specific.
Default configuration
photo_upload: width: 600 # max width height: 800 # max height quality: 80 # jpeg quality namer: 'upload_file_namer'
Basic usage
# PhotoController use FreedomSex\PhotoUploadBundle\Services\FileUploader; use FreedomSex\PhotoUploadBundle\Entity\FileInterface; public $fileUploader; public function __construct(FileUploader $fileUploader) { $this->fileUploader = $fileUploader; } public function upload(UploadedFile $file) { $entity = new Photo(); # implements FileInterface $this->fileUploader->upload($file, $entity); }