を使用してgeocoder-php composer パッケージをインストールしましたphp composer.phar install
。私はPHPフレームワークLaravelで実行しています。
Loading composer repositories with package information
Installing dependencies
- Installing willdurand/geocoder (1.0.10)
Downloading: 100%
- Installing kriswallsmith/buzz (v0.7)
Downloading: 100%
willdurand/geocoder suggests installing guzzle/guzzle (Enabling Guzzle allows you to use the GuzzleHttpAdapter.)
willdurand/geocoder suggests installing zendframework/zend-http (Enabling Zend_Http allows you to use the ZendHttpAdapter)
Writing lock file
Generating autoload files
パス.php
// --------------------------------------------------------------
// The path to the composer vendors directory.
// --------------------------------------------------------------
$paths['composer'] = 'vendor';
public/index.php
// --------------------------------------------------------------
// Autoload composer vendors.
// --------------------------------------------------------------
require path('composer').DS.'autoload.php';
composer.json
{
"require": {
"willdurand/geocoder": "@stable",
"kriswallsmith/buzz": "@stable"
}
}
問題: Geocoder-php のホームページで例を実行しようとすると、次のエラーが発生します。
エラー:
Class 'Geocoder\HttpAdapter\BuzzHttpAdapter' not found
発生場所:
$adapter = new \Geocoder\HttpAdapter\BuzzHttpAdapter();
ディレクトリ構造
すでに Buzz をインストールしています。