Hi,
With a fresh install of Contao 4.2.4 standard-edition the composer autoloader doesn't work.
My basic structure for my moduletest :
Code:
vendor/addictic/
└── moduletest-bundle
├── composer.json
└── src
├── AddicticModuletestBundle.php
└── Resources
└── contao
├── classes
│ └── Moduletest.php
├── config
│ ├── autoload.ini
│ ├── autoload.php
│ ├── config.php
│ └── ide_compat.php
├── dca
│ └── tl_car.php
├── languages
│ └── fr
├── models
├── modules
└── templates
├── modules
└── views
14 directories, 8 files
vendor/addictic/moduletest-bundle/composer.json :
Code:
{
"name": "addictic/moduletest-bundle",
"type": "contao-bundle",
"description": "Addictic moduletest bundle",
"license": "LGPL-3.0+",
"authors": [
{
"name": "Addictic",
"homepage": "https://www.addictic.fr"
}
],
"autoload": {
"psr-4": {
"Addictic\\ModuletestBundle\\": "src/"
},
"classmap": [
"src/Resources/contao"
],
"exclude-from-classmap": [
"src/Resources/contao/config",
"src/Resources/contao/dca",
"src/Resources/contao/languages",
"src/Resources/contao/templates"
]
}
}
vendor/addictic/moduletest-bundle/src/AddicticModuletestBundle.php :
PHP Code:
<?php
/*
* This file is part of Contao.
*
* Copyright (c) 2016-2017 Addictic
*
* @license LGPL-3.0+
*/
namespace Addictic\ModuletestBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Configures the Addictic moduletest bundle.
*/
class AddicticModuletestBundle extends Bundle
{
}
app/appKernel.php add this line:
[PHP]
new Addictic\ModuletestBundle\AddicticModuletestBundle (),
[PHP]
When i launch i obtain the following :
Code:
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error: Class 'Addictic\ModuletestBundle\AddicticModuletestBundle' not found in /ha.0/contaofresh/www/app/AppKernel.php on line 40
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Class 'Addictic\ModuletestBundle\AddicticModuletestBundle' not found in /ha.0/contaofresh/www/app/AppKernel.php on line 40
Same error when i execute app_dev.php :
PHP Code:
ClassNotFoundException in AppKernel.php line 40: Attempted to load class "AddicticModuletestBundle" from namespace "Addictic\ModuletestBundle".
Did you forget a "use" statement for another namespace?
Any one i've an idea ?
Best regard
Bookmarks