From 94bbaa9afa4ce8b43e66c517a92569af3bfc5dfb Mon Sep 17 00:00:00 2001 From: Mike Pearce Date: Mon, 18 Aug 2014 10:09:07 +0100 Subject: [PATCH 1/2] Added support for CurlFile PHP Complains that the @ method of referencing a file is deprecated, this commit replaces that with a CurlFile() call instead --- phpFlickr.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpFlickr.php b/phpFlickr.php index 975371e..bfe096e 100644 --- a/phpFlickr.php +++ b/phpFlickr.php @@ -427,7 +427,7 @@ function sync_upload ($photo, $title = null, $description = null, $tags = null, } $photo = realpath($photo); - $args['photo'] = '@' . $photo; + $args['photo'] = new CurlFile($photo, 'image/png', $photo); $curl = curl_init($this->upload_endpoint); @@ -489,7 +489,7 @@ function async_upload ($photo, $title = null, $description = null, $tags = null, } $photo = realpath($photo); - $args['photo'] = '@' . $photo; + $args['photo'] = new CurlFile($photo, 'image/png', $photo); $curl = curl_init($this->upload_endpoint); @@ -550,7 +550,7 @@ function replace ($photo, $photo_id, $async = null) { } $photo = realpath($photo); - $args['photo'] = '@' . $photo; + $args['photo'] = new CurlFile($photo, 'image/png', $photo); $curl = curl_init($this->replace_endpoint); From 4e3488c982f6a7ac28970e875f85d2d478b353a3 Mon Sep 17 00:00:00 2001 From: Mike Pearce Date: Mon, 18 Aug 2014 10:16:07 +0100 Subject: [PATCH 2/2] Added a mimetype lookup --- phpFlickr.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpFlickr.php b/phpFlickr.php index bfe096e..ac7bfd4 100644 --- a/phpFlickr.php +++ b/phpFlickr.php @@ -427,7 +427,7 @@ function sync_upload ($photo, $title = null, $description = null, $tags = null, } $photo = realpath($photo); - $args['photo'] = new CurlFile($photo, 'image/png', $photo); + $args['photo'] = new CurlFile($photo, mime_content_type($photo), $photo); $curl = curl_init($this->upload_endpoint); @@ -489,7 +489,7 @@ function async_upload ($photo, $title = null, $description = null, $tags = null, } $photo = realpath($photo); - $args['photo'] = new CurlFile($photo, 'image/png', $photo); + $args['photo'] = new CurlFile($photo, mime_content_type($photo), $photo); $curl = curl_init($this->upload_endpoint); @@ -550,7 +550,7 @@ function replace ($photo, $photo_id, $async = null) { } $photo = realpath($photo); - $args['photo'] = new CurlFile($photo, 'image/png', $photo); + $args['photo'] = new CurlFile($photo, mime_content_type($photo), $photo); $curl = curl_init($this->replace_endpoint);