From 6f5d9085197223df90b5a50b23f2b16bad5ef916 Mon Sep 17 00:00:00 2001 From: Diego <143522008+diegocrombie@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:45:59 -0300 Subject: [PATCH] Feature/v2.0.1 (#10) * config autoloader * add namespace, rename files, remove class library init * remove iloveimg-php folder * add vendor folder with library iloveimg-php * update plugin to v2.0.1 --------- Co-authored-by: Diego Orellano --- .github/workflows/phpstan.yml | 10 +- .gitignore | 5 +- ...> Ilove_Img_Compress_Media_List_Table.php} | 6 +- ...ugin.php => Ilove_Img_Compress_Plugin.php} | 10 +- ...ess.php => Ilove_Img_Compress_Process.php} | 4 +- ...s.php => Ilove_Img_Compress_Resources.php} | 4 + ....php => Ilove_Img_Compress_Serializer.php} | 4 +- ...enu.php => Ilove_Img_Compress_Submenu.php} | 2 + ...hp => Ilove_Img_Compress_Submenu_Page.php} | 2 + admin/class-ilove-img-library-init.php | 18 - admin/views/compress.php | 3 + admin/views/media-bulk.php | 2 + admin/views/overview.php | 3 + composer.json | 32 +- ilove-img-compress.php | 15 +- phpcs.xml | 8 + phpstan.neon | 2 +- readme.md | 8 +- readme.txt | 8 +- vendor/autoload.php | 25 + vendor/composer/ClassLoader.php | 579 ++++++++++++++++++ vendor/composer/InstalledVersions.php | 359 +++++++++++ vendor/composer/LICENSE | 21 + vendor/composer/autoload_classmap.php | 10 + vendor/composer/autoload_namespaces.php | 9 + vendor/composer/autoload_psr4.php | 11 + vendor/composer/autoload_real.php | 38 ++ vendor/composer/autoload_static.php | 41 ++ vendor/composer/installed.json | 369 +++++++++++ vendor/composer/installed.php | 77 +++ vendor/composer/platform_check.php | 26 + .../ilovepdf/iloveimg-php}/.gitignore | 0 .../ilovepdf/iloveimg-php}/.travis.yml | 0 .../ilovepdf/iloveimg-php}/changelog.md | 0 .../ilovepdf/iloveimg-php}/circle.yml | 0 .../ilovepdf/iloveimg-php}/composer.json | 0 .../ilovepdf/iloveimg-php}/init.php | 0 .../iloveimg-php}/phpunit.no_autoload.xml | 0 .../ilovepdf/iloveimg-php}/phpunit.xml | 0 .../ilovepdf/iloveimg-php}/readme.md | 4 +- .../iloveimg-php}/samples/chained_task.php | 0 .../samples/compress_advanced.php | 0 .../iloveimg-php}/samples/compress_basic.php | 6 +- .../samples/get_remaining_files.php | 0 .../iloveimg-php}/samples/repair_advanced.php | 0 .../iloveimg-php}/samples/repair_basic.php | 0 .../iloveimg-php}/samples/resize_advanced.php | 0 .../iloveimg-php}/samples/resize_basic.php | 0 .../iloveimg-php}/samples/rotate_advanced.php | 0 .../iloveimg-php}/samples/rotate_basic.php | 0 .../samples/try_catch_errors.php | 0 .../samples/watermark_advanced.php | 0 .../iloveimg-php}/samples/watermark_basic.php | 0 .../iloveimg-php}/samples/webhook_listen.php | 0 .../iloveimg-php}/samples/webhook_send.php | 0 .../iloveimg-php}/src/CompressImageTask.php | 0 .../iloveimg-php}/src/ConvertImageTask.php | 0 .../iloveimg-php}/src/CropImageTask.php | 0 .../ilovepdf/iloveimg-php}/src/Element.php | 36 +- .../src/Exceptions/AuthException.php | 0 .../src/Exceptions/DownloadException.php | 0 .../src/Exceptions/ExtendedException.php | 0 .../src/Exceptions/PathException.php | 0 .../src/Exceptions/ProcessException.php | 0 .../src/Exceptions/StartException.php | 0 .../src/Exceptions/TaskException.php | 0 .../src/Exceptions/UploadException.php | 0 .../ilovepdf/iloveimg-php}/src/File.php | 0 .../ilovepdf/iloveimg-php}/src/Iloveimg.php | 14 +- .../iloveimg-php}/src/IloveimgTool.php | 0 .../ilovepdf/iloveimg-php}/src/ImageTask.php | 4 - .../ilovepdf/iloveimg-php}/src/Lib/JWT.php | 0 .../iloveimg-php}/src/RepairImageTask.php | 0 .../iloveimg-php}/src/Request/Body.php | 0 .../iloveimg-php}/src/Request/Method.php | 0 .../iloveimg-php}/src/Request/Request.php | 77 +-- .../iloveimg-php}/src/Request/Response.php | 0 .../iloveimg-php}/src/ResizeImageTask.php | 0 .../iloveimg-php}/src/RotateImageTask.php | 0 .../iloveimg-php}/src/WatermarkImageTask.php | 0 .../iloveimg-php}/tests/Iloveimg/FileTest.php | 0 .../tests/Iloveimg/IloveTest.php | 0 .../tests/Iloveimg/IloveimgTest.php | 0 .../tests/bootstrap.no_autoload.php | 0 .../iloveimg-php}/tests/bootstrap.php | 0 85 files changed, 1689 insertions(+), 163 deletions(-) rename admin/{class-ilove-img-compress-media-list-table.php => Ilove_Img_Compress_Media_List_Table.php} (98%) rename admin/{class-ilove-img-compress-plugin.php => Ilove_Img_Compress_Plugin.php} (98%) rename admin/{class-ilove-img-compress-process.php => Ilove_Img_Compress_Process.php} (99%) rename admin/{class-ilove-img-compress-resources.php => Ilove_Img_Compress_Resources.php} (99%) rename admin/{class-ilove-img-compress-serializer.php => Ilove_Img_Compress_Serializer.php} (99%) rename admin/{class-ilove-img-compress-submenu.php => Ilove_Img_Compress_Submenu.php} (98%) rename admin/{class-ilove-img-compress-submenu-page.php => Ilove_Img_Compress_Submenu_Page.php} (98%) delete mode 100644 admin/class-ilove-img-library-init.php create mode 100644 vendor/autoload.php create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/composer/installed.json create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/.gitignore (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/.travis.yml (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/changelog.md (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/circle.yml (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/composer.json (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/init.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/phpunit.no_autoload.xml (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/phpunit.xml (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/readme.md (97%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/chained_task.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/compress_advanced.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/compress_basic.php (81%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/get_remaining_files.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/repair_advanced.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/repair_basic.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/resize_advanced.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/resize_basic.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/rotate_advanced.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/rotate_basic.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/try_catch_errors.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/watermark_advanced.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/watermark_basic.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/webhook_listen.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/samples/webhook_send.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/CompressImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/ConvertImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/CropImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Element.php (89%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/AuthException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/DownloadException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/ExtendedException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/PathException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/ProcessException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/StartException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/TaskException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Exceptions/UploadException.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/File.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Iloveimg.php (96%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/IloveimgTool.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/ImageTask.php (99%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Lib/JWT.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/RepairImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Request/Body.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Request/Method.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Request/Request.php (87%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/Request/Response.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/ResizeImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/RotateImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/src/WatermarkImageTask.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/tests/Iloveimg/FileTest.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/tests/Iloveimg/IloveTest.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/tests/Iloveimg/IloveimgTest.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/tests/bootstrap.no_autoload.php (100%) rename {iloveimg-php => vendor/ilovepdf/iloveimg-php}/tests/bootstrap.php (100%) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 2956cf08..058cc8ed 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -6,11 +6,19 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 + - name: Check if vendor directory exists and remove it + run: | + if [ -d "vendor" ]; then + echo "Removing existing vendor directory" + rm -rf vendor + fi - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 7.4 - name: Install Composer Dependencies - run: composer install + run: | + composer install + composer dump-autoload - name: Run PHPStan run: vendor/bin/phpstan analyse diff --git a/.gitignore b/.gitignore index 7f3e30a4..37ddf812 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Node/composer artifact files node_modules/ -vendor/ +vendor/* +!/vendor/autoload.php +!/vendor/composer/ +!/vendor/ilovepdf/ composer.lock package-lock.json dev/package-lock.json diff --git a/admin/class-ilove-img-compress-media-list-table.php b/admin/Ilove_Img_Compress_Media_List_Table.php similarity index 98% rename from admin/class-ilove-img-compress-media-list-table.php rename to admin/Ilove_Img_Compress_Media_List_Table.php index 9a835337..38e3c806 100644 --- a/admin/class-ilove-img-compress-media-list-table.php +++ b/admin/Ilove_Img_Compress_Media_List_Table.php @@ -1,7 +1,7 @@

diff --git a/admin/views/media-bulk.php b/admin/views/media-bulk.php index d0f7aa8c..9e176b06 100644 --- a/admin/views/media-bulk.php +++ b/admin/views/media-bulk.php @@ -5,6 +5,8 @@ * @package iloveimgcompress */ +use Ilove_Img_Compress\Ilove_Img_Compress_Media_List_Table; + // Create an instance of our package class... $ilove_img_test_list_table = new Ilove_Img_Compress_Media_List_Table(); // Fetch, prepare, sort, and filter our data... diff --git a/admin/views/overview.php b/admin/views/overview.php index d9d2563a..df540ade 100644 --- a/admin/views/overview.php +++ b/admin/views/overview.php @@ -1,3 +1,6 @@ +

Overview

diff --git a/composer.json b/composer.json index 947cdf74..ee531088 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,9 @@ "email": "info@ilovepdf.com" } ], + "require": { + "ilovepdf/iloveimg-php": "^1.1" + }, "require-dev": { "phpstan/phpstan": "^1.10", "szepeviktor/phpstan-wordpress": "^1.3", @@ -21,23 +24,16 @@ } }, "scripts": { - "post-install-cmd": [ - "@stan", - "@phpcs", - "@phpcs-summary", - "@phpcbf" - ], - "stan": [ - "vendor/bin/phpstan analyse --memory-limit=-1 --error-format=table > ../../../phpstan-report-iloveimg.txt" - ], - "phpcs-summary": [ - "phpcs -s --report=summary --ignore=*/vendor/*,*/iloveimg-php/*,*/.github/*,*/assets/css/* --report-file=../../../condesniffer-report-summary-iloveimg.txt ./" - ], - "phpcs": [ - "phpcs -s --ignore=*/vendor/*,*/iloveimg-php/*,*/.github/*,*/assets/css/* --report-file=../../../condesniffer-report-iloveimg.txt ./" - ], - "phpcbf": [ - "phpcbf --ignore=vendor/,iloveimg-php/,.github/ ./" - ] + "stan": "vendor/bin/phpstan analyse --memory-limit=-1 --error-format=table > ../../../phpstan-report-iloveimg.txt", + "phpcs-summary": "phpcs -s --report=summary --ignore=*/vendor/*,*/iloveimg-php/*,*/.github/*,*/assets/css/* --report-file=../../../condesniffer-report-summary-iloveimg.txt ./", + "phpcs": "phpcs -s --ignore=*/vendor/*,*/iloveimg-php/*,*/.github/*,*/assets/css/* --report-file=../../../condesniffer-report-iloveimg.txt ./", + "phpcbf": "phpcbf --ignore=vendor/,iloveimg-php/,.github/ ./", + "autoload-dev": "composer dump-autoload", + "autoload-prod": "composer dump-autoload --no-dev" + }, + "autoload": { + "psr-4": { + "Ilove_Img_Compress\\": "admin" + } } } diff --git a/ilove-img-compress.php b/ilove-img-compress.php index f232c383..6451ed4b 100644 --- a/ilove-img-compress.php +++ b/ilove-img-compress.php @@ -15,7 +15,7 @@ * Plugin Name: Image Compressor & Optimizer - iLoveIMG * Plugin URI: https://developer.iloveimg.com/ * Description: Get your images delivered quickly. Now you can get a powerful, easy to use, and reliable image compression plugin for your image optimization needs. With full automation and powerful features, iLoveIMG makes it easy to speed up your website by lightening past and new images with just a click. Compress JPG, PNG and GIF images in your WordPress to improve the positioning of your site, boost visitor’s engagement and ultimately increase sales. - * Version: 2.0.0 + * Version: 2.0.1 * Requires at least: 5.3 * Requires PHP: 7.4 * Author: iLoveIMG @@ -30,13 +30,12 @@ die; } -require_once 'admin/class-ilove-img-compress-plugin.php'; -require_once 'admin/class-ilove-img-compress-process.php'; -require_once 'admin/class-ilove-img-compress-resources.php'; -require_once 'admin/class-ilove-img-compress-serializer.php'; -require_once 'admin/class-ilove-img-compress-submenu-page.php'; -require_once 'admin/class-ilove-img-compress-submenu.php'; -require_once 'admin/class-ilove-img-compress-media-list-table.php'; +require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php'; + +use Ilove_Img_Compress\Ilove_Img_Compress_Plugin; +use Ilove_Img_Compress\Ilove_Img_Compress_Serializer; +use Ilove_Img_Compress\Ilove_Img_Compress_Submenu; +use Ilove_Img_Compress\Ilove_Img_Compress_Submenu_Page; add_action( 'plugins_loaded', 'ilove_img_compress_custom_admin_settings' ); diff --git a/phpcs.xml b/phpcs.xml index 1fbb6094..2f98c5be 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -21,6 +21,14 @@ + + 0 + + + + + + 0 diff --git a/phpstan.neon b/phpstan.neon index 09254916..d0e647c2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,4 +7,4 @@ parameters: - vendor - node_modules analyse: - - iloveimg-php \ No newline at end of file + - vendor/ilovepdf/iloveimg-php \ No newline at end of file diff --git a/readme.md b/readme.md index 585003cd..b5e56242 100644 --- a/readme.md +++ b/readme.md @@ -1,13 +1,13 @@ === Image Compressor & Optimizer - iLoveIMG === Plugin Name: Image Compressor & Optimizer - iLoveIMG -Version: 2.0.0 +Version: 2.0.1 Author: iLovePDF Author URI: https://www.iloveimg.com/ Contributors: iLovePDF Tags: compress, image, optimize, performance, image optimizer Requires at least: 5.3 Tested up to: 6.4.1 -Stable tag: 2.0.0 +Stable tag: 2.0.1 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -81,6 +81,10 @@ Moreover, all processed files are automatically deleted from our servers after b == Changelog == +== 2.0.1 == +Added +* Improved class loading. + == 2.0.0 == Changed * Minimum Support WP Version to 5.3 diff --git a/readme.txt b/readme.txt index f57e6156..7038760c 100644 --- a/readme.txt +++ b/readme.txt @@ -1,13 +1,13 @@ === Image Compressor & Optimizer - iLoveIMG === Plugin Name: Image Compressor & Optimizer - iLoveIMG -Version: 2.0.0 +Version: 2.0.1 Author: iLovePDF Author URI: https://www.iloveimg.com/ Contributors: iLovePDF Tags: compress, image, optimize, performance, image optimizer Requires at least: 5.3 Tested up to: 6.4.1 -Stable tag: 2.0.0 +Stable tag: 2.0.1 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -80,6 +80,10 @@ Moreover, all processed files are automatically deleted from our servers after b == Changelog == +== 2.0.1 == +Added +* Improved class loading. + == 2.0.0 == Changed * Minimum Support WP Version to 5.3 diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 00000000..bf4570c7 --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,25 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..51e734a7 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..0fb0a2c1 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/ilovepdf/iloveimg-php/src'), + 'Ilove_Img_Compress\\' => array($baseDir . '/admin'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 00000000..ece45d67 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,38 @@ +register(true); + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 00000000..37834664 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,41 @@ + + array ( + 'Iloveimg\\' => 9, + 'Ilove_Img_Compress\\' => 19, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Iloveimg\\' => + array ( + 0 => __DIR__ . '/..' . '/ilovepdf/iloveimg-php/src', + ), + 'Ilove_Img_Compress\\' => + array ( + 0 => __DIR__ . '/../..' . '/admin', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit96ba3e56cd403440af21e22afd622759::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit96ba3e56cd403440af21e22afd622759::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit96ba3e56cd403440af21e22afd622759::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 00000000..b4addf84 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,369 @@ +{ + "packages": [ + { + "name": "ilovepdf/iloveimg-php", + "version": "v1.1.15", + "version_normalized": "1.1.15.0", + "source": { + "type": "git", + "url": "https://github.com/ilovepdf/iloveimg-php.git", + "reference": "e825be5c31c81971b52caebd372e54846528c7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ilovepdf/iloveimg-php/zipball/e825be5c31c81971b52caebd372e54846528c7f4", + "reference": "e825be5c31c81971b52caebd372e54846528c7f4", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "time": "2019-05-30T12:35:52+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Iloveimg\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "iloveimg", + "email": "info@iloveimg.com" + } + ], + "description": "iLoveIMG Php Api", + "homepage": "https://iloveimg.com/", + "support": { + "issues": "https://github.com/ilovepdf/iloveimg-php/issues", + "source": "https://github.com/ilovepdf/iloveimg-php/tree/v1.1.15" + }, + "install-path": "../ilovepdf/iloveimg-php" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.4.1", + "version_normalized": "6.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "6d6063cf9464a306ca2a0529705d41312b08500b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6d6063cf9464a306ca2a0529705d41312b08500b", + "reference": "6d6063cf9464a306ca2a0529705d41312b08500b", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0", + "php-stubs/generator": "^0.8.3", + "phpdocumentor/reflection-docblock": "^5.3", + "phpstan/phpstan": "^1.10.12", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "time": "2023-11-10T00:33:47+00:00", + "type": "library", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.4.1" + }, + "install-path": "../php-stubs/wordpress-stubs" + }, + { + "name": "phpstan/extension-installer", + "version": "1.3.1", + "version_normalized": "1.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "time": "2023-05-24T08:59:17+00:00", + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" + }, + "install-path": "../phpstan/extension-installer" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.41", + "version_normalized": "1.10.41.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c6174523c2a69231df55bdc65b61655e72876d76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6174523c2a69231df55bdc65b61655e72876d76", + "reference": "c6174523c2a69231df55bdc65b61655e72876d76", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "time": "2023-11-05T12:57:57+00:00", + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "install-path": "../phpstan/phpstan" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-26T09:26:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v1.3.2", + "version_normalized": "1.3.2.0", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/b8516ed6bab7ec50aae981698ce3f67f1be2e45a", + "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.30", + "symfony/polyfill-php73": "^1.12.0" + }, + "require-dev": { + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" + }, + "time": "2023-10-16T17:23:56+00:00", + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "SzepeViktor\\PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.2" + }, + "install-path": "../szepeviktor/phpstan-wordpress" + } + ], + "dev": true, + "dev-package-names": [ + "php-stubs/wordpress-stubs", + "phpstan/extension-installer", + "phpstan/phpstan", + "symfony/polyfill-php73", + "szepeviktor/phpstan-wordpress" + ] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 00000000..05baccc7 --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,77 @@ + array( + 'name' => 'ilovepdf/iloveimg-wp-compress', + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => '17537eb86b385e73f8853e3b2a9ab782b4e90462', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + 'ilovepdf/iloveimg-php' => array( + 'pretty_version' => 'v1.1.15', + 'version' => '1.1.15.0', + 'reference' => 'e825be5c31c81971b52caebd372e54846528c7f4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ilovepdf/iloveimg-php', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ilovepdf/iloveimg-wp-compress' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => '17537eb86b385e73f8853e3b2a9ab782b4e90462', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'php-stubs/wordpress-stubs' => array( + 'pretty_version' => 'v6.4.1', + 'version' => '6.4.1.0', + 'reference' => '6d6063cf9464a306ca2a0529705d41312b08500b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-stubs/wordpress-stubs', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpstan/extension-installer' => array( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'reference' => 'f45734bfb9984c6c56c4486b71230355f066a58a', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../phpstan/extension-installer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpstan/phpstan' => array( + 'pretty_version' => '1.10.41', + 'version' => '1.10.41.0', + 'reference' => 'c6174523c2a69231df55bdc65b61655e72876d76', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpstan/phpstan', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => 'fe2f306d1d9d346a7fee353d0d5012e401e984b5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'szepeviktor/phpstan-wordpress' => array( + 'pretty_version' => 'v1.3.2', + 'version' => '1.3.2.0', + 'reference' => 'b8516ed6bab7ec50aae981698ce3f67f1be2e45a', + 'type' => 'phpstan-extension', + 'install_path' => __DIR__ . '/../szepeviktor/phpstan-wordpress', + 'aliases' => array(), + 'dev_requirement' => true, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 00000000..6d3407db --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/iloveimg-php/.gitignore b/vendor/ilovepdf/iloveimg-php/.gitignore similarity index 100% rename from iloveimg-php/.gitignore rename to vendor/ilovepdf/iloveimg-php/.gitignore diff --git a/iloveimg-php/.travis.yml b/vendor/ilovepdf/iloveimg-php/.travis.yml similarity index 100% rename from iloveimg-php/.travis.yml rename to vendor/ilovepdf/iloveimg-php/.travis.yml diff --git a/iloveimg-php/changelog.md b/vendor/ilovepdf/iloveimg-php/changelog.md similarity index 100% rename from iloveimg-php/changelog.md rename to vendor/ilovepdf/iloveimg-php/changelog.md diff --git a/iloveimg-php/circle.yml b/vendor/ilovepdf/iloveimg-php/circle.yml similarity index 100% rename from iloveimg-php/circle.yml rename to vendor/ilovepdf/iloveimg-php/circle.yml diff --git a/iloveimg-php/composer.json b/vendor/ilovepdf/iloveimg-php/composer.json similarity index 100% rename from iloveimg-php/composer.json rename to vendor/ilovepdf/iloveimg-php/composer.json diff --git a/iloveimg-php/init.php b/vendor/ilovepdf/iloveimg-php/init.php similarity index 100% rename from iloveimg-php/init.php rename to vendor/ilovepdf/iloveimg-php/init.php diff --git a/iloveimg-php/phpunit.no_autoload.xml b/vendor/ilovepdf/iloveimg-php/phpunit.no_autoload.xml similarity index 100% rename from iloveimg-php/phpunit.no_autoload.xml rename to vendor/ilovepdf/iloveimg-php/phpunit.no_autoload.xml diff --git a/iloveimg-php/phpunit.xml b/vendor/ilovepdf/iloveimg-php/phpunit.xml similarity index 100% rename from iloveimg-php/phpunit.xml rename to vendor/ilovepdf/iloveimg-php/phpunit.xml diff --git a/iloveimg-php/readme.md b/vendor/ilovepdf/iloveimg-php/readme.md similarity index 97% rename from iloveimg-php/readme.md rename to vendor/ilovepdf/iloveimg-php/readme.md index 09a64e0c..d15d0cda 100644 --- a/iloveimg-php/readme.md +++ b/vendor/ilovepdf/iloveimg-php/readme.md @@ -23,7 +23,7 @@ PHP 7.1 and later. You can install the library via [Composer](http://getcomposer.org/). Run the following command: ```bash -composer require ilovepdf/iloveimg-php +composer require iloveimg/iloveimg-php ``` To use the library, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading): @@ -59,4 +59,4 @@ See samples folder. ## Documentation -Please see https://developer.iloveimg.com/docs for up-to-date documentation. +Please see https://developer.iloveimg.com/docs for up-to-date documentation. \ No newline at end of file diff --git a/iloveimg-php/samples/chained_task.php b/vendor/ilovepdf/iloveimg-php/samples/chained_task.php similarity index 100% rename from iloveimg-php/samples/chained_task.php rename to vendor/ilovepdf/iloveimg-php/samples/chained_task.php diff --git a/iloveimg-php/samples/compress_advanced.php b/vendor/ilovepdf/iloveimg-php/samples/compress_advanced.php similarity index 100% rename from iloveimg-php/samples/compress_advanced.php rename to vendor/ilovepdf/iloveimg-php/samples/compress_advanced.php diff --git a/iloveimg-php/samples/compress_basic.php b/vendor/ilovepdf/iloveimg-php/samples/compress_basic.php similarity index 81% rename from iloveimg-php/samples/compress_basic.php rename to vendor/ilovepdf/iloveimg-php/samples/compress_basic.php index 77ee90b8..142ee85e 100644 --- a/iloveimg-php/samples/compress_basic.php +++ b/vendor/ilovepdf/iloveimg-php/samples/compress_basic.php @@ -4,12 +4,12 @@ //if manual installation has been used comment line that requires the autoload and uncomment this line: //require_once('../init.php'); -use Iloveimg\CompressImageTask; +use Iloveimg\CompressimageImageTask; // you can call task class directly // to get your key pair, please visit https://developer.iloveimg.com/user/projects -$myTask = new CompresImageTask('project_public_id','project_secret_key'); +$myTask = new CompressimageImageTask('project_public_id','project_secret_key'); // file var keeps info about server file id, name... // it can be used latter to cancel file @@ -19,4 +19,4 @@ $myTask->execute(); // and finally download file. If no path is set, it will be downloaded on current folder -$myTask->download(); +$myTask->download(); \ No newline at end of file diff --git a/iloveimg-php/samples/get_remaining_files.php b/vendor/ilovepdf/iloveimg-php/samples/get_remaining_files.php similarity index 100% rename from iloveimg-php/samples/get_remaining_files.php rename to vendor/ilovepdf/iloveimg-php/samples/get_remaining_files.php diff --git a/iloveimg-php/samples/repair_advanced.php b/vendor/ilovepdf/iloveimg-php/samples/repair_advanced.php similarity index 100% rename from iloveimg-php/samples/repair_advanced.php rename to vendor/ilovepdf/iloveimg-php/samples/repair_advanced.php diff --git a/iloveimg-php/samples/repair_basic.php b/vendor/ilovepdf/iloveimg-php/samples/repair_basic.php similarity index 100% rename from iloveimg-php/samples/repair_basic.php rename to vendor/ilovepdf/iloveimg-php/samples/repair_basic.php diff --git a/iloveimg-php/samples/resize_advanced.php b/vendor/ilovepdf/iloveimg-php/samples/resize_advanced.php similarity index 100% rename from iloveimg-php/samples/resize_advanced.php rename to vendor/ilovepdf/iloveimg-php/samples/resize_advanced.php diff --git a/iloveimg-php/samples/resize_basic.php b/vendor/ilovepdf/iloveimg-php/samples/resize_basic.php similarity index 100% rename from iloveimg-php/samples/resize_basic.php rename to vendor/ilovepdf/iloveimg-php/samples/resize_basic.php diff --git a/iloveimg-php/samples/rotate_advanced.php b/vendor/ilovepdf/iloveimg-php/samples/rotate_advanced.php similarity index 100% rename from iloveimg-php/samples/rotate_advanced.php rename to vendor/ilovepdf/iloveimg-php/samples/rotate_advanced.php diff --git a/iloveimg-php/samples/rotate_basic.php b/vendor/ilovepdf/iloveimg-php/samples/rotate_basic.php similarity index 100% rename from iloveimg-php/samples/rotate_basic.php rename to vendor/ilovepdf/iloveimg-php/samples/rotate_basic.php diff --git a/iloveimg-php/samples/try_catch_errors.php b/vendor/ilovepdf/iloveimg-php/samples/try_catch_errors.php similarity index 100% rename from iloveimg-php/samples/try_catch_errors.php rename to vendor/ilovepdf/iloveimg-php/samples/try_catch_errors.php diff --git a/iloveimg-php/samples/watermark_advanced.php b/vendor/ilovepdf/iloveimg-php/samples/watermark_advanced.php similarity index 100% rename from iloveimg-php/samples/watermark_advanced.php rename to vendor/ilovepdf/iloveimg-php/samples/watermark_advanced.php diff --git a/iloveimg-php/samples/watermark_basic.php b/vendor/ilovepdf/iloveimg-php/samples/watermark_basic.php similarity index 100% rename from iloveimg-php/samples/watermark_basic.php rename to vendor/ilovepdf/iloveimg-php/samples/watermark_basic.php diff --git a/iloveimg-php/samples/webhook_listen.php b/vendor/ilovepdf/iloveimg-php/samples/webhook_listen.php similarity index 100% rename from iloveimg-php/samples/webhook_listen.php rename to vendor/ilovepdf/iloveimg-php/samples/webhook_listen.php diff --git a/iloveimg-php/samples/webhook_send.php b/vendor/ilovepdf/iloveimg-php/samples/webhook_send.php similarity index 100% rename from iloveimg-php/samples/webhook_send.php rename to vendor/ilovepdf/iloveimg-php/samples/webhook_send.php diff --git a/iloveimg-php/src/CompressImageTask.php b/vendor/ilovepdf/iloveimg-php/src/CompressImageTask.php similarity index 100% rename from iloveimg-php/src/CompressImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/CompressImageTask.php diff --git a/iloveimg-php/src/ConvertImageTask.php b/vendor/ilovepdf/iloveimg-php/src/ConvertImageTask.php similarity index 100% rename from iloveimg-php/src/ConvertImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/ConvertImageTask.php diff --git a/iloveimg-php/src/CropImageTask.php b/vendor/ilovepdf/iloveimg-php/src/CropImageTask.php similarity index 100% rename from iloveimg-php/src/CropImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/CropImageTask.php diff --git a/iloveimg-php/src/Element.php b/vendor/ilovepdf/iloveimg-php/src/Element.php similarity index 89% rename from iloveimg-php/src/Element.php rename to vendor/ilovepdf/iloveimg-php/src/Element.php index d631b1b7..afc49d09 100644 --- a/iloveimg-php/src/Element.php +++ b/vendor/ilovepdf/iloveimg-php/src/Element.php @@ -98,11 +98,6 @@ class Element */ public $font_style = 'Regular'; - /** - * @var string - */ - public $font_weight = null; - /** * @var string */ @@ -146,11 +141,7 @@ class Element public $layer; - /** - * @var bool - */ public $bold = false; - /** * string * @var @@ -233,15 +224,6 @@ public function setFontStyle($font_style) return $this; } - /** - * @param string $font_weight - */ - public function setFontWeight($font_weight) - { - $this->font_weight = $font_weight; - return $this; - } - /** * @param int $font_size */ @@ -313,7 +295,7 @@ public function setVerticalPositionAdjustment($vertical_position_adjustment) /** * @param int $horizontal_position_adjustment */ - public function setHorizontalAdjustmentPercent($horizontal_adjustment_percent): Element + public function setHorizontalAdjustmentPercent($horizontal_adjustment_percent) { $this->horizontal_adjustment_percent = $horizontal_adjustment_percent; return $this; @@ -323,7 +305,7 @@ public function setHorizontalAdjustmentPercent($horizontal_adjustment_percent): * @param $gravity * @return $this */ - public function setGravity($gravity): Element + public function setGravity($gravity) { $this->checkValues($gravity, $this->gravityValues); @@ -335,7 +317,7 @@ public function setGravity($gravity): Element * @param int $width_percent * @return $this */ - public function setWidthPercent(int $width_percent): Element + public function setWidthPercent(int $width_percent) { $this->width_percent = $width_percent; return $this; @@ -350,18 +332,8 @@ public function setWidthPercent(int $width_percent): Element public function checkValues($value, $allowedValues) { if (!in_array($value, $allowedValues)) { - throw new \InvalidArgumentException('Invalid value "' . $value . '". Must be one of: ' . implode(',', $allowedValues)); + throw new \InvalidArgumentException('Invalid ' . $this->tool . ' value "' . $value . '". Must be one of: ' . implode(',', $allowedValues)); } } - /** - * @param bool $mosaic - * @return Element - */ - public function setMosaic(bool $mosaic): Element - { - $this->mosaic = $mosaic; - return $this; - } - } \ No newline at end of file diff --git a/iloveimg-php/src/Exceptions/AuthException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/AuthException.php similarity index 100% rename from iloveimg-php/src/Exceptions/AuthException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/AuthException.php diff --git a/iloveimg-php/src/Exceptions/DownloadException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/DownloadException.php similarity index 100% rename from iloveimg-php/src/Exceptions/DownloadException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/DownloadException.php diff --git a/iloveimg-php/src/Exceptions/ExtendedException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/ExtendedException.php similarity index 100% rename from iloveimg-php/src/Exceptions/ExtendedException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/ExtendedException.php diff --git a/iloveimg-php/src/Exceptions/PathException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/PathException.php similarity index 100% rename from iloveimg-php/src/Exceptions/PathException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/PathException.php diff --git a/iloveimg-php/src/Exceptions/ProcessException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/ProcessException.php similarity index 100% rename from iloveimg-php/src/Exceptions/ProcessException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/ProcessException.php diff --git a/iloveimg-php/src/Exceptions/StartException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/StartException.php similarity index 100% rename from iloveimg-php/src/Exceptions/StartException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/StartException.php diff --git a/iloveimg-php/src/Exceptions/TaskException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/TaskException.php similarity index 100% rename from iloveimg-php/src/Exceptions/TaskException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/TaskException.php diff --git a/iloveimg-php/src/Exceptions/UploadException.php b/vendor/ilovepdf/iloveimg-php/src/Exceptions/UploadException.php similarity index 100% rename from iloveimg-php/src/Exceptions/UploadException.php rename to vendor/ilovepdf/iloveimg-php/src/Exceptions/UploadException.php diff --git a/iloveimg-php/src/File.php b/vendor/ilovepdf/iloveimg-php/src/File.php similarity index 100% rename from iloveimg-php/src/File.php rename to vendor/ilovepdf/iloveimg-php/src/File.php diff --git a/iloveimg-php/src/Iloveimg.php b/vendor/ilovepdf/iloveimg-php/src/Iloveimg.php similarity index 96% rename from iloveimg-php/src/Iloveimg.php rename to vendor/ilovepdf/iloveimg-php/src/Iloveimg.php index a4761798..b5f06ba0 100644 --- a/iloveimg-php/src/Iloveimg.php +++ b/vendor/ilovepdf/iloveimg-php/src/Iloveimg.php @@ -34,7 +34,7 @@ class Iloveimg // @var string|null The version of the Iloveimg API to use for requests. public static $apiVersion = 'v1'; - const VERSION = 'php.1.1.16'; + const VERSION = 'php.1.0.2'; public $token = null; @@ -187,9 +187,6 @@ public function sendRequest($method, $endpoint, $body = null, $start = false) throw new AuthException($response->body->name, $response->code, null, $response); } if ($endpoint == 'upload') { - if(is_string($response->body)){ - throw new UploadException("Upload error", $response->code, null, $response); - } throw new UploadException($response->body->error->message, $response->code, null, $response); } elseif ($endpoint == 'process') { throw new ProcessException($response->body->error->message, $response->code, null, $response); @@ -319,15 +316,6 @@ public function verifySsl($verify) Request::verifyHost($verify); } - - - /** - * @param $follow - */ - public function followLocation($follow){ - Request::followLocation($follow); - } - private function getUpdatedInfo() { $data = array('v' => self::VERSION); diff --git a/iloveimg-php/src/IloveimgTool.php b/vendor/ilovepdf/iloveimg-php/src/IloveimgTool.php similarity index 100% rename from iloveimg-php/src/IloveimgTool.php rename to vendor/ilovepdf/iloveimg-php/src/IloveimgTool.php diff --git a/iloveimg-php/src/ImageTask.php b/vendor/ilovepdf/iloveimg-php/src/ImageTask.php similarity index 99% rename from iloveimg-php/src/ImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/ImageTask.php index 548fc5af..cbc4fc86 100644 --- a/iloveimg-php/src/ImageTask.php +++ b/vendor/ilovepdf/iloveimg-php/src/ImageTask.php @@ -179,10 +179,6 @@ public function addFileFromUrl($url) */ public function uploadFile($task, $filepath) { - if(!file_exists($filepath)){ - throw new \InvalidArgumentException('File '.$filepath.' does not exists'); - } - $data = array('task' => $task, 'v' => self::VERSION); $files = array('file' => $filepath); $body = Request\Body::multipart($data, $files); diff --git a/iloveimg-php/src/Lib/JWT.php b/vendor/ilovepdf/iloveimg-php/src/Lib/JWT.php similarity index 100% rename from iloveimg-php/src/Lib/JWT.php rename to vendor/ilovepdf/iloveimg-php/src/Lib/JWT.php diff --git a/iloveimg-php/src/RepairImageTask.php b/vendor/ilovepdf/iloveimg-php/src/RepairImageTask.php similarity index 100% rename from iloveimg-php/src/RepairImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/RepairImageTask.php diff --git a/iloveimg-php/src/Request/Body.php b/vendor/ilovepdf/iloveimg-php/src/Request/Body.php similarity index 100% rename from iloveimg-php/src/Request/Body.php rename to vendor/ilovepdf/iloveimg-php/src/Request/Body.php diff --git a/iloveimg-php/src/Request/Method.php b/vendor/ilovepdf/iloveimg-php/src/Request/Method.php similarity index 100% rename from iloveimg-php/src/Request/Method.php rename to vendor/ilovepdf/iloveimg-php/src/Request/Method.php diff --git a/iloveimg-php/src/Request/Request.php b/vendor/ilovepdf/iloveimg-php/src/Request/Request.php similarity index 87% rename from iloveimg-php/src/Request/Request.php rename to vendor/ilovepdf/iloveimg-php/src/Request/Request.php index 6675e97b..9a631ac9 100644 --- a/iloveimg-php/src/Request/Request.php +++ b/vendor/ilovepdf/iloveimg-php/src/Request/Request.php @@ -13,9 +13,8 @@ class Request private static $socketTimeout = null; private static $verifyPeer = true; private static $verifyHost = true; - private static $followLocation = true; - private static $auth = array( + private static $auth = array ( 'user' => '', 'pass' => '', 'method' => CURLAUTH_BASIC @@ -26,7 +25,7 @@ class Request 'tunnel' => false, 'address' => false, 'type' => CURLPROXY_HTTP, - 'auth' => array( + 'auth' => array ( 'user' => '', 'pass' => '', 'method' => CURLAUTH_BASIC @@ -68,17 +67,6 @@ public static function verifyHost($enabled) return self::$verifyHost = $enabled; } - /** - * Follow location option - * - * @param bool $enabled enable follow location, by default is true - * @return bool - */ - public static function followLocation($enabled) - { - return self::$followLocation = $enabled; - } - /** * Set a timeout * @@ -314,25 +302,25 @@ public static function buildHTTPCurlQuery($data, $parent = false) /** * Send a cURL request - * @param \Ilovepdf\Method|string $method HTTP method to use + * @param \Iloveimg\Method|string $method HTTP method to use * @param string $url URL to send the request to * @param mixed $body request body * @param array $headers additional headers to send * @param string $username Authentication username (deprecated) * @param string $password Authentication password (deprecated) + * @throws \Iloveimg\Exception if a cURL error occurs * @return Response - * @throws \Ilovepdf\Exception if a cURL error occurs */ public static function send($method, $url, $body = null, $headers = array(), $username = null, $password = null) { self::$handle = curl_init(); if ($method !== Method::GET) { - if ($method === Method::POST) { - curl_setopt(self::$handle, CURLOPT_POST, true); - } else { - curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method); - } + if ($method === Method::POST) { + curl_setopt(self::$handle, CURLOPT_POST, true); + } else { + curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method); + } curl_setopt(self::$handle, CURLOPT_POSTFIELDS, $body); } elseif (is_array($body)) { @@ -348,6 +336,7 @@ public static function send($method, $url, $body = null, $headers = array(), $us $curl_base_options = [ CURLOPT_URL => self::encodeUrl($url), CURLOPT_RETURNTRANSFER => true, + CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 10, CURLOPT_HTTPHEADER => self::getFormattedHeaders($headers), CURLOPT_HEADER => true, @@ -360,10 +349,6 @@ public static function send($method, $url, $body = null, $headers = array(), $us curl_setopt_array(self::$handle, self::mergeCurlOptions($curl_base_options, self::$curlOpts)); - if (self::$followLocation == true) { - @curl_setopt(self::$handle, CURLOPT_FOLLOWLOCATION, true); - } - if (self::$socketTimeout !== null) { curl_setopt(self::$handle, CURLOPT_TIMEOUT, self::$socketTimeout); } @@ -387,38 +372,38 @@ public static function send($method, $url, $body = null, $headers = array(), $us if (!empty(self::$auth['user'])) { curl_setopt_array(self::$handle, array( - CURLOPT_HTTPAUTH => self::$auth['method'], - CURLOPT_USERPWD => self::$auth['user'] . ':' . self::$auth['pass'] + CURLOPT_HTTPAUTH => self::$auth['method'], + CURLOPT_USERPWD => self::$auth['user'] . ':' . self::$auth['pass'] )); } if (self::$proxy['address'] !== false) { curl_setopt_array(self::$handle, array( - CURLOPT_PROXYTYPE => self::$proxy['type'], - CURLOPT_PROXY => self::$proxy['address'], - CURLOPT_PROXYPORT => self::$proxy['port'], + CURLOPT_PROXYTYPE => self::$proxy['type'], + CURLOPT_PROXY => self::$proxy['address'], + CURLOPT_PROXYPORT => self::$proxy['port'], CURLOPT_HTTPPROXYTUNNEL => self::$proxy['tunnel'], - CURLOPT_PROXYAUTH => self::$proxy['auth']['method'], - CURLOPT_PROXYUSERPWD => self::$proxy['auth']['user'] . ':' . self::$proxy['auth']['pass'] + CURLOPT_PROXYAUTH => self::$proxy['auth']['method'], + CURLOPT_PROXYUSERPWD => self::$proxy['auth']['user'] . ':' . self::$proxy['auth']['pass'] )); } - $response = curl_exec(self::$handle); - $error = curl_error(self::$handle); - $info = self::getInfo(); + $response = curl_exec(self::$handle); + $error = curl_error(self::$handle); + $info = self::getInfo(); if ($error) { - if (strpos($error, 'SSL certificate problem')) { - throw new \Exception($error . ' Try using method verifySsl to false: "$ilovepdf->verifySsl(false)"'); + if(strpos($error,'SSL certificate problem')){ + throw new \Exception($error.' Try using method verifySsl to false: "$iloveimg->verifySsl(false)"'); } throw new \Exception($error); } // Split the full response in its headers and body $header_size = $info['header_size']; - $header = substr($response, 0, $header_size); - $body = substr($response, $header_size); - $httpCode = $info['http_code']; + $header = substr($response, 0, $header_size); + $body = substr($response, $header_size); + $httpCode = $info['http_code']; return new Response($httpCode, $body, $header, self::$jsonOpts); } @@ -443,7 +428,7 @@ public static function getFormattedHeaders($headers) { $formattedHeaders = array(); - $combinedHeaders = array_change_key_case(array_merge(self::$defaultHeaders, (array)$headers)); + $combinedHeaders = array_change_key_case(array_merge(self::$defaultHeaders, (array) $headers)); foreach ($combinedHeaders as $key => $val) { $formattedHeaders[] = self::getHeaderString($key, $val); @@ -473,7 +458,7 @@ private static function getArrayFromQuerystring($query) /** * Ensure that a URL is encoded and safe to use with cURL - * @param string $url URL to encode + * @param string $url URL to encode * @return string */ private static function encodeUrl($url) @@ -481,10 +466,10 @@ private static function encodeUrl($url) $url_parsed = parse_url($url); $scheme = $url_parsed['scheme'] . '://'; - $host = $url_parsed['host']; - $port = (isset($url_parsed['port']) ? $url_parsed['port'] : null); - $path = (isset($url_parsed['path']) ? $url_parsed['path'] : null); - $query = (isset($url_parsed['query']) ? $url_parsed['query'] : null); + $host = $url_parsed['host']; + $port = (isset($url_parsed['port']) ? $url_parsed['port'] : null); + $path = (isset($url_parsed['path']) ? $url_parsed['path'] : null); + $query = (isset($url_parsed['query']) ? $url_parsed['query'] : null); if ($query !== null) { $query = '?' . http_build_query(self::getArrayFromQuerystring($query)); diff --git a/iloveimg-php/src/Request/Response.php b/vendor/ilovepdf/iloveimg-php/src/Request/Response.php similarity index 100% rename from iloveimg-php/src/Request/Response.php rename to vendor/ilovepdf/iloveimg-php/src/Request/Response.php diff --git a/iloveimg-php/src/ResizeImageTask.php b/vendor/ilovepdf/iloveimg-php/src/ResizeImageTask.php similarity index 100% rename from iloveimg-php/src/ResizeImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/ResizeImageTask.php diff --git a/iloveimg-php/src/RotateImageTask.php b/vendor/ilovepdf/iloveimg-php/src/RotateImageTask.php similarity index 100% rename from iloveimg-php/src/RotateImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/RotateImageTask.php diff --git a/iloveimg-php/src/WatermarkImageTask.php b/vendor/ilovepdf/iloveimg-php/src/WatermarkImageTask.php similarity index 100% rename from iloveimg-php/src/WatermarkImageTask.php rename to vendor/ilovepdf/iloveimg-php/src/WatermarkImageTask.php diff --git a/iloveimg-php/tests/Iloveimg/FileTest.php b/vendor/ilovepdf/iloveimg-php/tests/Iloveimg/FileTest.php similarity index 100% rename from iloveimg-php/tests/Iloveimg/FileTest.php rename to vendor/ilovepdf/iloveimg-php/tests/Iloveimg/FileTest.php diff --git a/iloveimg-php/tests/Iloveimg/IloveTest.php b/vendor/ilovepdf/iloveimg-php/tests/Iloveimg/IloveTest.php similarity index 100% rename from iloveimg-php/tests/Iloveimg/IloveTest.php rename to vendor/ilovepdf/iloveimg-php/tests/Iloveimg/IloveTest.php diff --git a/iloveimg-php/tests/Iloveimg/IloveimgTest.php b/vendor/ilovepdf/iloveimg-php/tests/Iloveimg/IloveimgTest.php similarity index 100% rename from iloveimg-php/tests/Iloveimg/IloveimgTest.php rename to vendor/ilovepdf/iloveimg-php/tests/Iloveimg/IloveimgTest.php diff --git a/iloveimg-php/tests/bootstrap.no_autoload.php b/vendor/ilovepdf/iloveimg-php/tests/bootstrap.no_autoload.php similarity index 100% rename from iloveimg-php/tests/bootstrap.no_autoload.php rename to vendor/ilovepdf/iloveimg-php/tests/bootstrap.no_autoload.php diff --git a/iloveimg-php/tests/bootstrap.php b/vendor/ilovepdf/iloveimg-php/tests/bootstrap.php similarity index 100% rename from iloveimg-php/tests/bootstrap.php rename to vendor/ilovepdf/iloveimg-php/tests/bootstrap.php