2017-02-12 5 views
1

내 번들이 등록되어 찾을 수없는,하지만, 난 여전히이 라인에서 'AppKernel.php' 이 오류가 발생합니다 : new HWI\Bundle\OAuthBundle\HWIOAuthBundle() 내 오류 :HWIOAuthBundle AppKernel에 등록 된,하지만 여전히

ClassNotFoundException in AppKernel.php line 13: Attempted to load class "HWIOAuthBundle" from namespace "HWI\Bundle\OAuthBundle". Did you forget a "use" statement for another namespace?

나는 또한 수행 : composer require hwi/oauth-bundle 어디에요 수 있었다 내 실수 야?

use Symfony\Component\HttpKernel\Kernel; 
    use Symfony\Component\Config\Loader\LoaderInterface; 
    use HWI\Bundle\OAuthBundle; 

    class AppKernel extends Kernel 
    { 
     public function registerBundles() 
     { 
      $bundles = array(

       new HWI\Bundle\OAuthBundle\HWIOAuthBundle(), 
       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 AppBundle\AppBundle(), 
       new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(), 
      ); 

      if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { 
       $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 
       $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
       $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
       $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
      } 

      return $bundles; 
     } 

     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": { "": "src/" } 
    }, 
    "require": { 
     "php": ">=5.3.9", 
     "symfony/symfony": "2.7.*", 
     "doctrine/orm": "^2.4.8", 
     "doctrine/doctrine-bundle": "~1.4", 
     "symfony/assetic-bundle": "~2.3", 
     "symfony/swiftmailer-bundle": "~2.3", 
     "symfony/monolog-bundle": "~2.4", 
     "sensio/distribution-bundle": "~4.0", 
     "sensio/framework-extra-bundle": "^3.0.2", 
     "incenteev/composer-parameter-handler": "~2.0", 
     "hwi/oauth-bundle": "^0.5.3", 
     "sensio/generator-bundle": "^3.1" 
    }, 
    "require-dev": { 
     "symfony/phpunit-bridge": "~2.7" 
    }, 
    "scripts": { 
     "post-install-cmd": [ 
      "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-update-cmd": [ 
      "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" 
     ] 
    }, 
    "config": { 
     "bin-dir": "bin" 
    }, 
    "extra": { 
     "symfony-app-dir": "app", 
     "symfony-web-dir": "web", 
     "symfony-assets-install": "relative", 
     "incenteev-parameters": { 
      "file": "app/config/parameters.yml" 
     }, 
     "branch-alias": { 
      "dev-master": "2.7-dev" 
     } 
    } 
} 
+0

'HWI \ Bundle \ OAuthBundle; 사용을 제거하고'새로운 HWI \ Bundle \ OAuthBundle \ HWIOAuthBundle() '을 앞쪽이 아닌 끝으로 이동 시키십시오. 그런 다음 캐쉬를 수행하십시오 : clear – gskema

+0

다른 줄에있는 것과 똑같은 오류'AppKernel.php의 ClassNotFoundException 24 행 : ' – Darius92

+0

설치에 대한 확신이 있습니까? '벤더 (vendor) '에'hwi'라는 디렉토리가 있습니까? – n3k

답변

1

는이 프로세스를 따를 수 있습니다,이 캐시 문제가되지 않습니다 있는지 확인하기 바랍니다?

  • 제거/공급 업체 디렉토리
  • 제거/응용 프로그램/캐시 내용
  • 실행 명령 작곡가 자동으로 업데이트 & & 작곡가 /app/bootstrap.php.cache
  • 제거 composer.lock 제거 업데이트 -vvv

의견을 보내 주셔서 감사합니다.

+0

이제는'bootstrap.php.cache)를 잃었습니다 : 스트림을 열지 못했습니다 : 해당 파일이나 디렉토리가 없습니다' – Darius92

+0

composer.json을 복사 할 수 있습니까? bootstrap.php.cache를 빌드하려면 새로운 HWI \ Bundle \ OAuthBundle \ HWIOAuthBundle(), 을 주석 처리하십시오. 그러나 문제가 해결되지는 않습니다. 이것은 프로젝트 레벨이나 작곡가 레벨에서의 구성 문제입니다. –

+0

또한 "use HWI \ Bundle \ OAuthBundle;"을 제거 할 수 있습니다. AppKernel.php에서 –