From e661de60b15cc81460e06b4a5ba02a26806a5635 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 9 Sep 2018 04:59:45 +0200 Subject: [PATCH 1/2] Improving the fix for support of custom commands with accentuated names --- composer.json | 1 + src/Intervention/Image/AbstractDriver.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d7df4a23..ddc3bdf7 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "require": { "php": ">=5.4.0", "ext-fileinfo": "*", + "ext-mbstring": "*", "guzzlehttp/psr7": "~1.1" }, "require-dev": { diff --git a/src/Intervention/Image/AbstractDriver.php b/src/Intervention/Image/AbstractDriver.php index 29ad9d59..5ece0a1c 100644 --- a/src/Intervention/Image/AbstractDriver.php +++ b/src/Intervention/Image/AbstractDriver.php @@ -102,11 +102,11 @@ abstract class AbstractDriver */ private function getCommandClassName($name) { - $name = mb_convert_case($name[0], MB_CASE_UPPER, 'utf-8') . mb_substr($name, 1, mb_strlen($name)); + $name = mb_strtoupper(mb_substr($name, 0, 1)) . mb_substr($name, 1); $drivername = $this->getDriverName(); - $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, ucfirst($name)); - $classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', ucfirst($name)); + $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, $name); + $classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', $name); if (class_exists($classnameLocal)) { return $classnameLocal; From 87f24c63fa9aa760d65732f862b003967bbcd4dc Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 9 Sep 2018 08:11:36 +0200 Subject: [PATCH 2/2] Use Symfony polyfill instead of requiring mbstring extension --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ddc3bdf7..7e8f3adc 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,8 @@ "require": { "php": ">=5.4.0", "ext-fileinfo": "*", - "ext-mbstring": "*", - "guzzlehttp/psr7": "~1.1" + "guzzlehttp/psr7": "~1.1", + "symfony/polyfill-mbstring": ">=1.0" }, "require-dev": { "phpunit/phpunit": "^4.8 || ^5.7",