Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on PHP 7.3/7.4 #369

Merged
merged 3 commits into from Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,8 @@ language: php
php:
- 7.1
- 7.2
- 7.3
- 7.4

env:
- SYMFONY_VERSION=^3.4
Expand Down
18 changes: 14 additions & 4 deletions Uploader/Chunk/Storage/GaufretteStorage.php
Expand Up @@ -3,6 +3,7 @@
namespace Oneup\UploaderBundle\Uploader\Chunk\Storage;

use Gaufrette\Adapter\StreamFactory;
use Gaufrette\Exception\FileNotFound;
use Gaufrette\Filesystem;
use Gaufrette\FilesystemInterface;
use Oneup\UploaderBundle\Uploader\File\FilesystemFile;
Expand Down Expand Up @@ -62,15 +63,24 @@ public function clear($maxAge, $prefix = null)
// but after the files are deleted the dirs
// would remain
foreach ($matches['dirs'] as $key) {
if ($maxAge <= $now - $this->filesystem->mtime($key)) {
$toDelete[] = $key;
try {
if ($maxAge <= $now - $this->filesystem->mtime($key)) {
$toDelete[] = $key;
}
} catch (FileNotFound $exception) {
// ignore
}
}
// The same directory is returned for every file it contains
array_unique($toDelete);

foreach ($matches['keys'] as $key) {
if ($maxAge <= $now - $this->filesystem->mtime($key)) {
$this->filesystem->delete($key);
try {
if ($maxAge <= $now - $this->filesystem->mtime($key)) {
$this->filesystem->delete($key);
}
} catch (FileNotFound $exception) {
// ignore
}
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -33,7 +33,7 @@

"require-dev": {
"amazonwebservices/aws-sdk-for-php": "1.5.*",
"knplabs/gaufrette": "0.2.*@dev",
"knplabs/gaufrette": "^0.9",
"oneup/flysystem-bundle": "^1.2|^2.0|^3.0",
"phpunit/phpunit": "^7.5",
"sensio/framework-extra-bundle": "^5.0",
Expand Down