この質問で私を助けてもらえますか... 私は EasyAdminBundle で Symfont 2.8 を使用しています。このマニュアルを使用して-symfony2-admin-panel-in-30-secondsをインストールしました。
管理パネルは正常に動作しますが、(管理者ではない) クラスを作成しようとするとエラーが発生します: Cannot redeclare class Symfony\Component\DependencyInjection\ContainerAwareInterface in /var/www/html/Legendcorp/app/cache/dev/ 6568 行目の classes.php
例: /src/AppBundle/Controller/APIController.php にクラスを作成しました
namespace AppBundle\Controller;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class FormController extends BaseAdminController{
/**
* @Route("/form/save", name="save")
*/
public function formAction(Request $request){
}
}
しかし、このクラスに申し込もうとすると、エラーが発生します。-
Fatal error: Cannot redeclare class Symfony\Component\DependencyInjection\ContainerAwareInterface in /var/www/html/Legendcorp/app/cache/dev/classes.php on line 6568
キャッシュをクリアすると(rm -rf app/cache/*)、機能しますが、管理パネルに連絡しない限り機能します。
これは私の composer.json ファイルです:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": { "": "src/" },
"files": [ "app/AppKernel.php" ]
},
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "1.3@dev",
"vich/uploader-bundle": "^0.14.0"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"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.8-dev"
}
}
}
助けてくれますか?