Cannot declare class ContaoManagerPlugin, because the name is already in use
Hallo Leute,
ich stehe vor dieser Problem und komme nicht mehr weiter:
PHP-Code:
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
contao/manager-plugin: Generating plugin class...
contao/manager-plugin: ...done generating plugin class
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
Fatal error: Cannot declare class ContaoManagerPlugin, because the name is already in use in /Applications/mampstack/apache2/htdocs/mytheme/src/ContaoManager/ContaoManagerPlugin.php on line 27
PHP Fatal error: Cannot declare class ContaoManagerPlugin, because the name is already in use in /Applications/mampstack/apache2/htdocs/mytheme/src/ContaoManager/ContaoManagerPlugin.php on line 27
Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception
In ScriptHandler.php line 89:
An error occurred while executing the "contao:install-web-dir" command: PHP Fatal error: Cannot declare class ContaoManagerPlugin, because the name is already in use in /Applications/mampstack/apache2/htdocs/mytheme/src/ContaoManager/ContaoManagerPlugin.php on line 27
Es handelt sich um einen lokalen installation.
Vorher war 4.8.x und habe es auf 4.9 aktualisiert.
Habe einige eigene Erweiterungen die ich über src/ContaoManager/ContaoManagerPlugin.php nach folgendem Muster hinzufüge:
PHP-Code:
use namespace\myBundle\namespaceMyBundle;
class ContaoManagerPlugin implements BundlePluginInterface
{
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(namespaceMyBundle::class)
->setLoadAfter([ContaoCoreBundle::class]),
BundleConfig::create(namespaceMyBundle::class)
->setLoadAfter([ContaoCoreBundle::class]),
...
];
}
}
Composer.json schaut so aus:
PHP-Code:
{
"name": "contao/managed-edition",
"type": "project",
"description": "Contao Open Source CMS",
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "Leo Feyer",
"homepage": "https://github.com/leofeyer"
}
],
"require": {
"php": "^7.1",
"cocur/slugify": "^3.2",
"contao/calendar-bundle": "^4.9",
"contao/comments-bundle": "^4.9",
"contao/conflicts": "@dev",
"contao/faq-bundle": "^4.9",
"contao/listing-bundle": "^4.9",
"contao/manager-bundle": "4.9.*",
"contao/news-bundle": "^4.9",
"contao/newsletter-bundle": "^4.9",
...
"madeyourday/contao-rocksolid-icon-picker": "^2.0",
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
"netzmacht/contao-leaflet-maps": "^3.1",
"symfony/intl": "^4.3",
"terminal42/contao-changelanguage": "^3.1"
},
"require-dev": {
"symfony/stopwatch": "^4.4"
},
"conflict": {
"contao-components/installer": "<1.3"
},
"extra": {
"contao-component-dir": "assets",
"symfony": {
"require": "^4.2"
}
},
"scripts": {
"post-install-cmd": [
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
],
"post-update-cmd": [
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
]
},
"autoload": {
"classmap": [
"src/ContaoManager/ContaoManagerPlugin.php",
"src/namespace/myBundle"
],
"psr-4": {
"App\\": "src/"
},
"exclude-from-classmap": [
]
}
}
Werden die Erweiterungen in Contao 4.9 anders eingebunden oder habe ich bei der Update was vergessen?
Vielen Dank im Voraus.
Wie ist es dann bei der Aktualisierung der Bundles über composer update?
OK. Dann habe ich dich richtig verstanden. Sorry für die Umstände. :cool:
Ich dachte der normale Weg eigene Bundles zu entwickeln wäre root/src/ geeignet und nicht der root/vendor/
Angenommen ich installiere die Bundles über require und setze mein repository path auf root/vendor/myNamespace/myBundle/...
Setze meine Änderungen um und commite es auf git.
eine letzte Frage (hoffe ich :D): Jetzt nach dem commit, wenn ich composer update ausführe, müsste dann composer meckern, weil sich geänderte Daten innerhalb der vendor befindet oder nicht?