-2

使用したい: https://github.com/mikealmond/MusicBrainz lib を myapp->vendor フォルダーにコピーしました。composer と更新された composer を使用して Guzzle をインストールしました。

use GuzzleHttp\Client;
use MusicBrainz\Filters\ArtistFilter;
use MusicBrainz\Filters\RecordingFilter;
use MusicBrainz\HttpAdapters\GuzzleHttpAdapter;
use MusicBrainz\MusicBrainz;

require __DIR__ . '/vendor/autoload.php';

オートロードが機能しません。私は多くのことを試しましたが、composer.json に何を書くべきかわかりません。

Error: Class 'MusicBrainz\MusicBrainz' not found 

私が電話するとき:

$brainz = new MusicBrainz(new GuzzleHttpAdapter(new Client()));

composer.json で試しました

"require-dev": {
     "vendor/MusicBrainz": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "https://github.com/mikealmond/MusicBrainz.git"
        }
    ],

それから作曲家の更新...そして私は得る:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package src/musicbrainz could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
4

1 に答える 1