2017-10-02 11 views
0

私はできるだけ簡潔で正確になるでしょう。私はすべての助けに感謝しています!作曲者のオートローダーが動作しない

私のシステム:Symfony 3.3.8、PHP 5.6.25。 IDE:

エラーがに遭遇しPhpStorm: Attempted to load class "GuzzleBundle" from namespace "EightPoints\Bundle\GuzzleBundle". Did you forget a "use" statement for another namespace?

私の他のサードパーティのバンドル、KnPMenuまたはFOSUser、完璧に動作します。

これらのバンドルはすべて、composer require(packagist)、composer updateでインストールされ、AppKernelで追加されています。

このエラーは、AppKernelにnew EightPoints\Bundle\GuzzleBundle\GuzzleBundle(),を追加するとすぐにウェブサイトのすべてのページでポップアップします。

私はこのプロセスの後にcomposer dump-autoloadにしようとしましたが、役に立たないです。また、app/confing/config.ymlにバンドル設定を追加しました。ここで

は、私のファイルは、以下のとおりです。

AppKernel.php

<?php 
use Symfony\Component\HttpKernel\Kernel; 
use Symfony\Component\Config\Loader\LoaderInterface; 
class AppKernel extends Kernel 
{ 
    public function registerBundles() 
    { 
     $bundles = [ 
      new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), 
      new Symfony\Bundle\SecurityBundle\SecurityBundle(), 
      new Symfony\Bundle\TwigBundle\TwigBundle(), 
      new Symfony\Bundle\MonologBundle\MonologBundle(), 
      new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), 
      new Symfony\Bundle\AsseticBundle\AsseticBundle(), 
      new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
      new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
      new EightPoints\Bundle\GuzzleBundle\GuzzleBundle(), 
      new Knp\Bundle\MenuBundle\KnpMenuBundle(), 
      new FOS\UserBundle\FOSUserBundle(), 
      new AppBundle\AppBundle(), 
      new BaseBundle\BaseBundle(), 
    ]; 
    if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { 
     $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 
     $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
     $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
     if ('dev' === $this->getEnvironment()) { 
      $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
      $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); 
     } 
    } 
    return $bundles; 
} 
public function getRootDir() 
{ 
    return __DIR__; 
} 
public function getCacheDir() 
{ 
    return dirname(__DIR__) . '/var/cache/' .$this->getEnvironment(); 
} 
public function getLogDir() 
{ 
    return dirname(__DIR__) . '/var/logs'; 
} 
public function registerContainerConfiguration(LoaderInterface $loader) 
{ 
    $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); 
} 
} 

composer.json

{ 
"name": "symfony/framework-standard-edition", 
"license": "MIT", 
"type": "project", 
"description": "The \"Symfony Standard Edition\" distribution", 
"autoload": { 
    "psr-4": { 
     "AppBundle\\": "src/AppBundle", 
     "BaseBundle\\": "src/BaseBundle" 
    }, 
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] 
}, 
"autoload-dev": { 
    "psr-4": { "Tests\\": "tests/" }, 
    "files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ] 
}, 
"require": { 
    "php": ">=5.5.9", 
    "components/jquery": "^3.1", 
    "doctrine/doctrine-bundle": "^1.6", 
    "doctrine/orm": "^2.5", 
    "eightpoints/guzzle-bundle": "^6.1", 
    "friendsofsymfony/user-bundle": "~2.0", 
    "incenteev/composer-parameter-handler": "^2.0", 
    "knplabs/knp-menu-bundle": "^2.0", 
    "oyejorge/less.php": "v1.7.0.14", 
    "sensio/distribution-bundle": "^5.0.19", 
    "sensio/framework-extra-bundle": "^3.0.2", 
    "symfony/assetic-bundle": "^2.8", 
    "symfony/monolog-bundle": "^3.1.0", 
    "symfony/polyfill-apcu": "^1.0", 
    "symfony/swiftmailer-bundle": "^2.3.10", 
    "symfony/symfony": "3.3.8", 
    "twbs/bootstrap": "^3.3", 
    "twig/twig": "^1.0||^2.0" 
}, 
"require-dev": { 
    "sensio/generator-bundle": "^3.0", 
    "symfony/phpunit-bridge": "^3.0" 
}, 
"scripts": { 
    "symfony-scripts": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
    ], 
    "post-install-cmd": [ 
     "@symfony-scripts" 
    ], 
    "post-update-cmd": [ 
     "@symfony-scripts" 
    ] 
}, 
"config": { 
    "platform": { 
     "php": "5.6.25" 
    }, 
    "sort-packages": true 
}, 
"extra": { 
    "symfony-app-dir": "app", 
    "symfony-bin-dir": "bin", 
    "symfony-var-dir": "var", 
    "symfony-web-dir": "web", 
    "symfony-tests-dir": "tests", 
    "symfony-assets-install": "relative", 
    "incenteev-parameters": { 
     "file": "app/config/parameters.yml" 
    }, 
    "branch-alias": { 
     "dev-master": "3.3-dev" 
    } 
} 

}

私が得る理由を私は知りませんこのエラーまたはこのバンドルを使用しようとすると、私を助けてください!

+0

guzzleバンドルコードがベンダの下に実際にインストールされていることを確認します。 8つのポイントバンドルのcomposer.jsonファイルには、psr-0では自動ロードセクションがありますが、psr-4では自動ロードセクションはありません。ちょっと変だ。タイプミスかもしれません。作者jsonにEightPointをベンダーのディレクトリに向けるための行を追加することができます。変更後に作者dumpautoloadを実行することを忘れないでください。 – Cerad

答えて

0

エラー解決。 PhpStorm除外ベンダーフォルダーのようです。

したがって、ベンダーはサーバー(wamp64/www)にアップロードされませんでした。 途中で私のローカルプロジェクトファイルにベンダーがいた。悲しいことに。 サーバーでベンダーをフルアップロードした後、すべてが機能しているようです。

正常ですか?私は初心者の間違いをしましたか?

ありがとうございました。

+0

アップロードはどのようにしましたか? –

+0

私はsipmply apacheサーバー上のベンダのディレクトリの下に新しいバンドルをアップロードしました。私はwamp:c:¥wamp64¥www¥project-name¥vendor –

+0

を使用しています。問題を修正するために行ったのではなく、プロジェクトのアップロードについて質問しています。 –

関連する問題