Pārlūkot izejas kodu

Merge pull request #3978 from marc-mabe/hotfix/3976

fixes #3976: drop ext/ctype dependency
Jordi Boggiano 10 gadi atpakaļ
vecāks
revīzija
a811142ff2

+ 0 - 9
src/Composer/Command/DiagnoseCommand.php

@@ -369,10 +369,6 @@ EOT
             $errors['hash'] = true;
         }
 
-        if (!extension_loaded('ctype')) {
-            $errors['ctype'] = true;
-        }
-
         if (!ini_get('allow_url_fopen')) {
             $errors['allow_url_fopen'] = true;
         }
@@ -441,11 +437,6 @@ EOT
                         $text .= "Install it or recompile php without --disable-hash";
                         break;
 
-                    case 'ctype':
-                        $text = PHP_EOL."The ctype extension is missing.".PHP_EOL;
-                        $text .= "Install it or recompile php without --disable-ctype";
-                        break;
-
                     case 'unicode':
                         $text = PHP_EOL."The detect_unicode setting must be disabled.".PHP_EOL;
                         $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;

+ 1 - 1
src/Composer/Package/Loader/ArrayLoader.php

@@ -147,7 +147,7 @@ class ArrayLoader implements LoaderInterface
         }
 
         if (!empty($config['time'])) {
-            $time = ctype_digit($config['time']) ? '@'.$config['time'] : $config['time'];
+            $time = preg_match('/^\d+$/D', $config['time']) ? '@'.$config['time'] : $config['time'];
 
             try {
                 $date = new \DateTime($time, new \DateTimeZone('UTC'));