0
votes

I am trying to clear cache of my application to prod environment. But all time that I run this line: app/console cache:clear --env=prod returns this error below:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "resource, type, prefix" under "core"

My routing file is like this:

//routing.yml
core:
    resource: "@CoreBundle/Controller/"
    type:     annotation
    prefix:   /

In this project I have a folder called CoreBundle and inside this folder have a folder DependencyInjection that have this 2 files:

//congiguration.php
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('core');

        return $treeBuilder;
    }
}
//CoreExtension.php
class CoreExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');
    }
}

I have no idea why symfony don't recognize this options... Could anyone help me please?

Thanks all

1
Are you sure the routing.yml is actually your routing file? Are you linking to it in your imports in app/config/config.yml rather than via the framework.router.resource config key? From the look of your error it is trying to register your route as the config for your core bundle, as opposed to a route.qooplmao
I thins so because if I delete the routing file from my project and run again the command above the console returns this error: [Symfony\Component\Config\Exception\FileLoaderLoadException] The file "routing.yml" does not existDaniel Morsoleto
Post your app/config/config.yml where it mentions routing.yml.qooplmao
thanks with your comment I have an idea and add the framework: router: resource: "%kernel.root_dir%/config/prod/routing.yml" strict_requirements: ~ to my config.yml form prod folder and work!!! Thanks so much!!Daniel Morsoleto

1 Answers

0
votes

Try debug your router with symfony console by app/console debug:router, check if your router is registered. if not, probably your annotation invalid.

SEE: http://symfony.com/doc/current/book/routing.html#including-external-routing-resources