0

このhttps://github.com/Exercise/FOQElasticaBundle#readmeに従って FOQElasticaBundle をセットアップ し、Git サブモジュールを使用して Elastica と FOQElasticaBundle をインストールしました。

アプリ/コンソールを試すと、エラーが発生しますThe autoloader expected class "Elastica_Client" to be defined in file "/path/to/project/../vendor/elastica/lib/Elastica/Client.php". The file was found but the class was not in it, the class name or namespace probably has a typo.

FOQ が vendor/elastica/lib/Elastica/Client.php 内で Elastica_Client クラスを読み込もうとしていることがわかりましたが、Client という名前のクラス以降は何も見つかりませんでした。

Elastica リポジトリhttps://github.com/ruflin/Elastica/blob/v0.18.6.0/lib/Elastica/Client.phpをランダムに閲覧したところ、以前は Elastica_Client という名前のクラスが見つかりました。

質問は

  1. 現在の Elastica ライブラリに対して、FOQElasticaBundle は時代遅れですか?
  2. または、オートロードで何か問題が発生していますか。ps: コンポーザ オートローダを使用していますか?

アプリ/autoload.php

$loader->add('Elastica', __DIR__.'/../vendor/elastica/lib');
$loader->add('FOQ', __DIR__.'/../vendor/bundles');
4

1 に答える 1

1

そのFOQElasticaBundleインストール手順は Symfony 2.0 用です

SF2.1 では、composer を使用してバンドルをインストールする必要があるため、これをcomposer.jsonファイルに追加するだけです。

"ruflin/elastica": "0.19.8"ここに例

次に、次のコマンドを実行します。

composer update

そして最後のステップは次のとおりです。

composer dumpautoload

最後のステップで autoloads ファイルが生成されます

于 2013-01-23T03:43:42.057 に答える