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

Not compatible with Sf 5.2 #103

Open
zogs opened this issue Sep 2, 2021 · 0 comments
Open

Not compatible with Sf 5.2 #103

zogs opened this issue Sep 2, 2021 · 0 comments

Comments

@zogs
Copy link
Contributor

zogs commented Sep 2, 2021

Hello,

It seems v5.0 is not compatible with symfony 5.2.
I get multiple errors :
Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /var/www/civc/meteoback/vendor/bcc/cron-manager-bundle/BCC/CronManagerBundle/DependencyInjection/Configuration.php on line 20 and at least 1 expected

This could be fix by:
BCC\CronManagerBundle\DependencyInjection\Configuration

$treeBuilder = new TreeBuilder('bcc_cron_manager');

        if (method_exists($treeBuilder, 'getRootNode')) {
            $rootNode = $treeBuilder->getRootNode();
        } else {
            // BC for symfony/config < 4.2
            $rootNode = $treeBuilder->root('bcc_cron_manager');
        }

Then there is a problem with the Twig extension:

Attempted to load class "Twig_Extension" from the global namespace.
Did you forget a "use" statement?
in vendor/bcc/cron-manager-bundle/BCC/CronManagerBundle/Twig/TwigExtension.php (line 5)

This could be fix by (not not tested) :

<?php

namespace BCC\CronManagerBundle\Twig;

use Twig\Extension\AbstractExtension;
use Twig\Extension\GlobalsInterface;

class TwigExtension extends AbstractExtension implements GlobalsInterface
{
    /**
     * @var array
     */
    protected $wwwUser;

    /**
     * @var string
     */
    protected $logDir;

    /**
     * @var string
     */
    protected $symfonyCommand;

    public function __construct($logDir, $projectDir)
    {
        if (function_exists('posix_getpwuid')) {
            $this->wwwUser = posix_getpwuid(posix_geteuid());
        }
        else {
            $this->wwwUser = array(
                'name' => get_current_user(),
                'dir'  => '-',
            );
        }
        $this->logDir = $logDir;
        $this->symfonyCommand = 'php '.$projectDir.'/bin/console';
    }

    public function getGlobals():array
    {
        return array(
            'wwwUser'        => $this->wwwUser,
            'logDir'         => $this->logDir,
            'symfonyCommand' => $this->symfonyCommand,
        );
    }

}

Then i get some errors with the controller, but i stop my investigation here...

The controller for URI "/admin/cron-manager/" is not callable: Controller "BCCCronManagerBundle:Default:index" does neither exist as service nor as class.

Are you sure your v5.0 version is compatible with sf5 at all ?

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