質問

これまでのところ私のパッケージをパッケージ主義に公開することができました。 私のリポジトリから、 http://github.com/pbalan/directory-parser

ライブラリを作成する方法作曲家のオートローローディングによって使用されますか?

Composerを使用して同じインストールしようとすると、そうすることができません。 作曲家は言っていない:

 Loading composer repositories with package information
 Reading composer.json of pbalan/directory-parser (0.0.1)
 Importing tag 0.0.1 (0.0.1.0)
 Reading composer.json of pbalan/directory-parser (master)
 Importing branch master (dev-master)
 Updating dependencies (including require-dev)
 Your requirements could not be resolved to an installable set of packages.

 Problem 1
  - The requested package pbalan/directory-parser 1.0.0 could not be found.

 Potential causes:
  - A typo in the package name
  - The package is not available in a stable-enough version according to your minimum-stability setting
.

これは私のgithubリポジトリに持っている私の作曲家です:

 {
    "name" : "pbalan/directory-parser",
    "description" : "DirectoryParser",
    "license": "MIT",
    "keywords" : ["DirectoryParser"],
    "homepage" : "https://github.com/pbalan/directory-parser",
    "authors" : [
    {
    "name" : "prashant"
    }
    ],
    "autoload" : {
    "psr-0" : {"src" : ""}
    },
    "require" : {
    "php": ">=5.3.3"
    }
 }
.

と私はこのcomposer.jsonを使って新鮮なディレクトリにインストールしようとしています:

 {
   "name" : "pbalan/directory-parser",
   "description" : "DirectoryParser",
   "license": "MIT",
   "keywords" : ["DirectoryParser"],
   "homepage" : "https://github.com/pbalan/directory-parser",
   "authors" : [
    {
        "name" : "prashant"
    }
   ],
   "repositories": [
    {
        "type": "vcs",
        "url": "http://github.com/pbalan/directory-parser.git"
    }
       ],
   "require" : {
    "php": ">=5.3.3",
    "pbalan/directory-parser": "dev-master"
    }
 }
.

composer.jsonを現在エラーがないポイントに変更しましたが、パッケージをインストールできず、オートローダファイルをインストールするだけです。

どのように私のパッケージをインストールすることができますか? 助けてください!

役に立ちましたか?

解決

問題は、2番目のcomposer.jsonであなたのパッケージの名前を再利用していることです。

空のディレクトリのcomposer.jsonとしてこれを使用するだけです。

{
    "require": {
        "php": ">=5.3.3",
        "pbalan/directory-parser": "dev-master"
    }
}
.

それはすべてです!Packagistで利用できる別のライブラリーを作成していない限り、名前、説明など、すべての追加情報は必要ありません。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top