-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add symfony 5 support. Drop symfony 2 and 3 support. Change minimum p…
…hp version to 7.2.5
- Loading branch information
Showing
19 changed files
with
114 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/.idea | ||
/composer.lock | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,8 @@ | |
use Glavweb\UploaderBundle\Response\Response as UploaderResponse; | ||
use Glavweb\UploaderBundle\Response\ResponseInterface; | ||
use Glavweb\UploaderBundle\UploadEvents; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
use Symfony\Component\HttpFoundation\File\Exception\UploadException; | ||
use Symfony\Component\HttpFoundation\File\File; | ||
use Symfony\Component\HttpFoundation\File\UploadedFile; | ||
|
@@ -41,7 +41,7 @@ | |
* @package Glavweb\UploaderBundle | ||
* @author Andrey Nilov <[email protected]> | ||
*/ | ||
class UploadController extends Controller | ||
class UploadController extends AbstractController | ||
{ | ||
/** | ||
* @var array | ||
|
@@ -114,7 +114,7 @@ public function uploadLinkAction(Request $request, $context) | |
*/ | ||
public function progressAction(Request $request) | ||
{ | ||
$session = $this->container->get('session'); | ||
$session = $this->get('session'); | ||
|
||
$prefix = ini_get('session.upload_progress.prefix'); | ||
$name = ini_get('session.upload_progress.name'); | ||
|
@@ -135,7 +135,7 @@ public function progressAction(Request $request) | |
*/ | ||
public function cancelAction(Request $request) | ||
{ | ||
$session = $this->container->get('session'); | ||
$session = $this->get('session'); | ||
|
||
$prefix = ini_get('session.upload_progress.prefix'); | ||
$name = ini_get('session.upload_progress.name'); | ||
|
@@ -284,7 +284,7 @@ protected function getFiles(FileBag $bag) | |
protected function doUpload(File $file, ResponseInterface $response, Request $request, $context) | ||
{ | ||
/** @var UploaderManager $uploaderManager */ | ||
$uploaderManager = $this->container->get('glavweb_uploader.uploader_manager'); | ||
$uploaderManager = $this->get('glavweb_uploader.uploader_manager'); | ||
$mediaStructure = $this->get('glavweb_uploader.util.media_structure'); | ||
$config = $this->getConfig(); | ||
|
||
|
@@ -382,7 +382,7 @@ protected function dispatchPreUploadEvent(UploaderManager $uploaderManager, | |
$context) | ||
{ | ||
$configContext = $uploaderManager->getContextConfig($context); | ||
$dispatcher = $this->container->get('event_dispatcher'); | ||
$dispatcher = $this->get('event_dispatcher'); | ||
|
||
// dispatch pre upload event (both the specific and the general) | ||
$event = new PreUploadEvent($uploadedFile, $response, $request, $context, $configContext); | ||
|
@@ -409,7 +409,7 @@ protected function dispatchPostEvents(UploaderManager $uploaderManager, | |
$context) | ||
{ | ||
$configContext = $uploaderManager->getContextConfig($context); | ||
$dispatcher = $this->container->get('event_dispatcher'); | ||
$dispatcher = $this->get('event_dispatcher'); | ||
|
||
// dispatch post upload event (both the specific and the general) | ||
$event = new PostUploadEvent($uploadedFile, $media, $response, $request, $context, $configContext); | ||
|
@@ -426,7 +426,7 @@ protected function dispatchPostEvents(UploaderManager $uploaderManager, | |
protected function validate(UploaderManager $uploaderManager, FileInterface $file, Request $request, $context) | ||
{ | ||
$configContext = $uploaderManager->getContextConfig($context); | ||
$dispatcher = $this->container->get('event_dispatcher'); | ||
$dispatcher = $this->get('event_dispatcher'); | ||
|
||
// dispatch validation event (both the specific and the general) | ||
$event = new ValidationEvent($file, $request, $configContext, $context); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM php:7.2.5-cli | ||
|
||
ARG BUNDLE_VERSION | ||
ARG PACKAGE_NAME | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
unzip \ | ||
libzip-dev \ | ||
libpq-dev \ | ||
&& docker-php-ext-install zip pdo_pgsql | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
WORKDIR /usr/src/ | ||
|
||
RUN composer create-project symfony/skeleton:"^5.3" app | ||
|
||
COPY scripts/ scripts/ | ||
RUN chmod +x scripts/* | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN composer require --dev phpunit/phpunit symfony/test-pack | ||
|
||
COPY environment . | ||
|
||
RUN composer config repositories.glavweb "{\"type\": \"path\", \"url\": \"../bundle\", \"options\": {\"versions\": { \"$PACKAGE_NAME\": \"$BUNDLE_VERSION\" }}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
return [ | ||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], | ||
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], | ||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], | ||
Glavweb\UploaderBundle\GlavwebUploaderBundle::class => ['all' => true], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -x | ||
set -e | ||
|
||
cd `dirname "$0"` | ||
|
||
export BUNDLE_VENDOR=glavweb | ||
export BUNDLE_NAME=uploader-bundle | ||
export BUNDLE_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
export PACKAGE_NAME="$BUNDLE_VENDOR/$BUNDLE_NAME" | ||
export IMAGE_NAME="$BUNDLE_VENDOR-$BUNDLE_NAME-test" | ||
|
||
docker build -t $IMAGE_NAME --build-arg BUNDLE_VERSION=$BUNDLE_VERSION --build-arg PACKAGE_NAME=$PACKAGE_NAME . | ||
|
||
docker run --tty -i --rm \ | ||
-v `pwd`/../../:/usr/src/bundle \ | ||
-v `pwd`/../../build/test:/usr/src/build \ | ||
-e PACKAGE_NAME="$PACKAGE_NAME" \ | ||
$IMAGE_NAME \ | ||
../scripts/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
cd .. | ||
|
||
rm -rf build/* | ||
cp -r app/. build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -x | ||
set -e | ||
|
||
composer require -n $PACKAGE_NAME | ||
|
||
php bin/phpunit | ||
|
||
../scripts/copy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters