FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Prepare for CakePHP 3.6 #485

Closed raul338 closed 6 years ago

raul338 commented 6 years ago

Update code to remove deprecations.

Maybe I should drop PHP 5.5 ?

josegonzalez commented 6 years ago

Dropping php5.5 seems reasonable.

raul338 commented 6 years ago

This should be ready to merge

raul338 commented 6 years ago

Done. What else should be done ?

josegonzalez commented 6 years ago

Seems reasonable. Can you smoke-test this in an app and verify everything works as you expect?

raul338 commented 6 years ago

As of now, Upload works. The code I used is based of the examples. KeepFilesOnDelete set false also works

$this->addBehavior('Josegonzalez/Upload.Upload', [
    'foto' => [
        'path' => 'webroot{DS}img{DS}uploads{DS}tickets{DS}{field-value:ticket_id}{DS}',
        'nameCallback' => function ($data, $settings) {
            return time() . '_' . $data['name'];
        },
    ],
]);
// ....
$validator->setProvider('upload', UploadValidation::class);
$validator->add('foto', 'fileFileUpload', [
    'rule' => 'isFileUpload',
    'message' => 'Debe cargar una foto',
    'provider' => 'upload',
    'on' => 'create',
]);
bmeclazcke commented 6 years ago

Hey all!

Any ETA on when is this going to be released?

Thanks!

josegonzalez commented 6 years ago

Now seems fine.

josegonzalez commented 6 years ago

Released 4.0.0.

Spriz commented 6 years ago

FYI:

It says in the release that Cake 3.6 is required ("This change requires at least CakePHP 3.6, and should support the upcoming 4.x release.")

But it only seems to require Cake 3.4 in the composer.json