Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set *Kernel in bundle configuration #138

Open
markitosgv opened this issue Mar 16, 2016 · 0 comments
Open

Allow to set *Kernel in bundle configuration #138

markitosgv opened this issue Mar 16, 2016 · 0 comments

Comments

@markitosgv
Copy link

Hi,

I have next problem, i've got an ApiKernel with minimum functionality (symfony microkernel), but i want a resque jobs runs over AppKernel.

In ContainerAwareJob class a createKernel method try to find one Symfony Kernel:

    /**
     * @return KernelInterface
     */
    protected function createKernel()
    {
        $finder = new Finder();
        $finder->name('*Kernel.php')->depth(0)->in($this->args['kernel.root_dir']);
        $results = iterator_to_array($finder);
        $file = current($results);
        $class = $file->getBasename('.php');

        require_once $file;

        return new $class(
            isset($this->args['kernel.environment']) ? $this->args['kernel.environment'] : 'dev',
            isset($this->args['kernel.debug']) ? $this->args['kernel.debug'] : true
        );
    }

I want to force to use AppKernel but finds first ApiKernel.
Do you think is good to add a bundle configuration property to allow change kernel file?

Or even better specify kernel for every job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant