andheiberg / vzaar

A little cleanup and repackaging of the official Vzaar PHP wrapper.
4 stars 4 forks source link

Upload error #5

Open RoffeDH opened 9 years ago

RoffeDH commented 9 years ago

Here's the error message I get when trying to upload a video:

curl_setopt(): The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead

And here's the code where the error is given from:

switch (strtoupper($this->method)) {
            case 'POST':
                curl_setopt($this->c, CURLOPT_POST, true);
                if ($data != null)
                    curl_setopt($this->c, CURLOPT_POSTFIELDS, $data);
                break;

It's highlighting the second to last line:

curl_setopt($this->c, CURLOPT_POSTFIELDS, $data);

Seems to me like the model is using the correct class, so what's the issue here?

andheiberg commented 9 years ago

I feel like I've fixed this issue before, but maybe never pushed it :( idk

Basically as the error says the current implementation is using a deprecated API.

I would say the ideal solution would be to change it to use Guzzle as this will take care of using different API's to maintain compatibility with multiple versions of PHP. I know I had a work in progress branch locally for that on my old computer, but it's been lost in the migration to my new machine.

Feel free to submit a pull request that fixes this issue though. At this point in time I won't be able to fix it.

RoffeDH commented 9 years ago

I'm fairly new to Git so don't know how to do it or what that would mean.

andheiberg commented 9 years ago

You would fork my repo, make the necessary changes to your fork and send a pull request.

Sorry I don't know exactly what to tell you.

Hope you found a solution :-)