소스 검색

Normalize package names

Jordi Boggiano 13 년 전
부모
커밋
3a2ba8e003
3개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      src/Packagist/WebBundle/Entity/Package.php
  2. 1 1
      src/Packagist/WebBundle/Entity/Requirement.php
  3. 2 2
      src/Packagist/WebBundle/Entity/Version.php

+ 1 - 1
src/Packagist/WebBundle/Entity/Package.php

@@ -104,7 +104,7 @@ class Package
             $maintainers[] = $maintainer->toArray();
         }
         $data = array(
-            'name' => $this->name,
+            'name' => mb_strtolower($this->name, 'UTF-8'),
             'description' => $this->description,
             'dist-tags' => array(),
             'maintainers' => $maintainers,

+ 1 - 1
src/Packagist/WebBundle/Entity/Requirement.php

@@ -46,7 +46,7 @@ class Requirement
 
     public function toArray()
     {
-        return array($this->packageName => $this->packageVersion);
+        return array(mb_strtolower($this->packageName, 'UTF-8') => $this->packageVersion);
     }
 
     public function setId($id)

+ 2 - 2
src/Packagist/WebBundle/Entity/Version.php

@@ -148,7 +148,7 @@ class Version
             $requirements[key($requirement)] = current($requirement);
         }
         return array(
-            'name' => $this->name,
+            'name' => mb_strtolower($this->name, 'UTF-8'),
             'description' => $this->description,
             'keywords' => $tags,
             'homepage' => $this->homepage,
@@ -159,7 +159,7 @@ class Version
             'source' => $this->getSource(),
             'time' => $this->releasedAt ? $this->releasedAt->format('Y-m-d\TH:i:sP') : null,
             'dist' => $this->getDist(),
-            'type' => $this->type,
+            'type' => mb_strtolower($this->type, 'UTF-8'),
             'extra' => $this->extra,
         );
     }