2013-04-30 29 views
13
Bir besteci projeyi test etmek için bir yerel deposunu oluşturmak çalışıyorum

amaBesteci

composer create-project --repository-url=/path/to/packages.json vendor/project-name 

[UnexpectedValueException] 

Unknown package has no name defined [...] 

ile başarısız Benim packages.json geçerli:

{ 
    "packages": { 
    "vendor/project-name": { 
     "dev-master": { 
     "name": "vendor/project-name", 
     "type": "project", 
     "version": "dev-master", 
     "source": { 
      "url": "/path/to/project/.git", 
      "type": "git" 
     } 
     } 
    } 
    } 
} 

composer's guide, bu yeterli olmalı.

Herhangi bir ipucu?

cevap

17

bu yürütün ve çok sizin için çalışıyorsa söyle: paketinizi oluşturun sonra

echo '{ "name": "test/test", "version": "1.0.0", "dist": { "url": "http://dummy.com/dummy.zip", "type": "zip" } }' > composer.json 

git add packages.json composer.json 
git commit -a -m "first commit" 

Ve:

mkdir /tmp/project-name 
cd /tmp/project-name 
git init 
vim (or whatever you like) packages.json 

Yapıştır ve kaydedin:

{ 
    "package": { 
     "name": "vendor/project-name", 
     "version": "1.0.0", 
     "source": { 
      "url": "/tmp/project-name/.git", 
      "type": "git", 
      "reference": "master" 
     } 
    } 
} 

Yürütme

composer create-project --repository-url=/tmp/project-name/packages.json vendor/project-name 
+0

Maalesef çok uzun sürdü, çok güzel çalıştı! Tek bir paket için alternatif sözdizimini nereden buldunuz? Ve bu arada, 'packages.json' kontrol etmese bile hala çalışıyor ve oluşturulan projede (ait olmadığı yerde) depo tanımını içermiyor. – Utaal

+0

Bununla birlikte, bu yalnızca tek bir paket için çalışır ve hala kılavuzda açıklanan biçimde çalışmaya devam edemem. – Utaal

+0

Tam anlamıyla deneme yanılma ile oldu. Sintaks'ı çok kazandıktan sonra jsonunuza geri döndüm, anladığım "paket adı" nı anlamaya çalıştım ve bir paketle daha küçük olan bir şeyleri silmeye başladım. Ve inan bana, "paket" (tekil) bir yazım hatasıydı, bu beni LOL yaptı. Ben Composer'daki insanlarla bir kelime paketi problemlerine biraz ışık verebilir, orada yanlış bir şey var. –