2017-10-02 27 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)에 업로드되지 않았습니다. 그런데 내 로컬 프로젝트 파일에 공급 업체가있었습니다 ... 슬프게도. 서버에서 전체 공급 업체를 업로드 한 후 모든 것이 제대로 작동하는 것처럼 보입니다.

정상입니까? 나는 초보자의 실수를 했습니까?

4 명의 빠른 도움 주셔서 감사합니다.

+0

업로드를 어떻게하셨습니까? –

+0

아파치 서버의 공급 업체 디렉토리에 새 번들을 업로드했습니다. wamp : c : \ wamp64 \ www \ project-name \ vendor –

+0

프로젝트를 업로드 할 때 (문제가 발생했을 때) 문제를 해결하기 위해 무엇을했는지 묻는 것입니다. –