FatalErrorException: Error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found
Bonsoir,j'arrive pas à installer mon bundle doctrine/doctrine-fixtures-bundle avec Composer.voici comment j'ai procédé:
je suis parti sur ce site:"https://packagist.org/packages/doctrine/doctrine-fixtures-bundle", j'ai choisi la version dev-master / 2.2.x-dev parce qu'elle est la plus recente.Pour information j'utilise Symfony_Standard_Vendors_2.3.4 et php 5.3.10 ,mais j'ai un sérieux problème quant au choix des dépendances à inscrire dans mon fichier Composer.json,voici comment je l'ai rempli:
"require": {
"php": ">=5.3.3",
"doctrine/doctrine-fixtures-bundle": "2.2.*@dev",
"doctrine/doctrine-bundle": "~1.0",
"symfony/doctrine-bridge": "~2.1",
"doctrine/data-fixtures": "~1.0"
}
je ne sais pas si toutes les dépendances ont été prises en compte ou si j'en ai trop mis.Le cours que j'ai ne détaille pas beaucoup comment cherché les dépendances afin de les inscrire dans le fichier.json.
Après cela, j'ai tenté de mettre à jour les dépendances par la commande:
php ../composer.phar update et voici ce que ça affiche comme message d'erreur:
C:\wamp\www\Symfony>php ../composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/symfony (v2.3.5)
- Installing symfony/symfony (v2.3.6)
Downloading: 100%
Writing lock file
Generating autoload files
Updating the "app/config/parameters.yml" file.
Citation:
PHP Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle'
not found in C:\wamp\www\Symfony\app\AppKernel.php on line 27
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Symfony\app\console:0
PHP 2. Symfony\Component\Console\Application->run() C:\wamp\www\Symfony\app\console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:121
PHP 4. Symfony\Component\HttpKernel\Kernel->boot() C:\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:70
PHP 5. Symfony\Component\HttpKernel\Kernel->initializeBundles() C:\wamp\www\Symfony\app\bootstrap.php.cache:2215
PHP 6. AppKernel->registerBundles() C:\wamp\www\Symfony\app\bootstrap.php.cache:2385
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
Citation:
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command.
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
[--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|v
vv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
C:\wamp\www\Symfony>
je me suis dit qu'il fallait peut-être éffacer le cache,je reçois toujours le même message d'erreur:
Citation:
C:\wamp\www\Symfony>php app/console cache:clear
PHP Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle'
not found in C:\wamp\www\Symfony\app\AppKernel.php on line 27
Je me suis quand même entêté à enregistré mon bundle dans le Kernel comme ceci:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
.
.
.
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
.
.
.
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
} |
Quand je lance l'URL :http://localhost/Symfony/web/app_dev.php/blog j'optiens ce message d'erreur:
Citation:
FatalErrorException: Error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found in C:\wamp\www\Symfony\app\AppKernel.php line 27
je me dis dis que j'ai certainement pas bien créer mon fichier composer.json avec les dépendances qu'il faut.
Vraiment j'ai besoin de vos expériences pour décanter cette situation afin de comprendre ce qui ne tourne pas rond et de continuer dans mon autoformation.Merci d'avance.
atalErrorException: Error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found
salut lexunivers, dois-je remplacer mon fichier composer.json par le tien et enregistrer le Bundle dans le fichier appkernel.php seulement pour ne plus voir apparaître le message d'erreur? sur quel site à tu trouvé ces dépendances là? et comment as tu fais le choix,peux tu m’éclairer?
FatalErrorException: Error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found
salut papajoker,je crois avoir compris ton message mais j'ai toujours le meme message d'erreur,pourquoi.?
J'ai mis la seule ligne dans mon fichier composer.json la voici:
Code:
1 2 3 4
| "require": {
"php": ">=5.3.3",
"doctrine/doctrine-fixtures-bundle": "dev-master"
} |
et j'ai ajouté cette ligne dans mon fichier appkernel.php
Code:
$bundles = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
mais j'ai toujours la même erreur,qu'est ce qui pourrait ne pas bien marcher ?
Code:
1 2 3
| Updating the "app/config/parameters.yml" file.
PHP Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle'
not found in C:\wamp\www\Symfony\app\AppKernel.php on line 29 |