I already posted this in another sub forum, but realized that it was incorrect place for my question. Moved this thread from Contao Support -> Others
Hello,
First of all I'm pretty new to Contao so it might be just simple mistake somewhere, but I am unable to solve it for a few days now. I have created two bundles for Contao, one depends on another. I register bundles locally with "repositories" and "require" tags in Contao main composer.json
The bundles are found and being installed, but I get this error:
Code:
$ /usr/local/Cellar/php/7.2.9_2/bin/php '-q' '/Users/adomas/Sites/contao3/web/contao-manager.phar.php' 'composer' 'update' 'contao/manager-bundle' 'adomas/mini-bundle' 'contao/calendar-bundle' 'contao/comments-bundle' 'contao/faq-bundle' 'contao/listing-bundle' 'contao/news-bundle' 'contao/newsletter-bundle' 'test/skeleton-bundle' '--with-dependencies' '--prefer-dist' '--no-dev' '--no-progress' '--no-suggest' '--no-ansi' '--no-interaction' '--optimize-autoloader' 2>&1
Loading composer repositories with package information
Updating dependencies
Package operations: 2 installs, 0 updates, 0 removals
- Installing adomas/datahub-bundle (dev-master): Symlinking from ../contao-bundles/adomas/datahub-bundle
- Installing adomas/anychart-bundle (dev-master): Symlinking from ../contao-bundles/adomas/anychart-bundle
Writing lock file
Generating optimized autoload files
contao/manager-plugin: Generating plugin class...
PHP Fatal error: Cannot declare class adomas\DatahubBundle\Plugin, because the name is already in use in /Users/adomas/Sites/contao3/vendor/adomas/datahub-bundle/src/ContaoManager/Plugin.php on line 10
# Process terminated with exit code 255
# Result: Unknown error
I want to solve this PHP Fatal error. Bundles gets registered anyway, but I want to make it in a clean way. My bundles are based off skeleton-bundle ( https://github.com/contao/skeleton-bundle )
Plugin.php contents:
PHP Code:
<?php
namespace Adomas\DatahubBundle;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
class Plugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(AdomasDatahubBundle::class)
->setLoadAfter([ContaoCoreBundle::class])
->setReplace(['adomas-datahub-bundle'])
];
}
}
Maybe someone could give me a hint where from this problem comes?
Same problem with Contao 4.4.* and 4.6.*
Bookmarks