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

Symfony 5 support #98

Open
oldy777 opened this issue Dec 13, 2021 · 1 comment
Open

Symfony 5 support #98

oldy777 opened this issue Dec 13, 2021 · 1 comment

Comments

@oldy777
Copy link

oldy777 commented Dec 13, 2021

@vitorbrandao Hi! Do you have plans to add sf5 support?
I faced some problems trying to adopt it for sf5.

  1. There is no tempting section in framework config, so you need use SmartyEngin directly
- templating:
-     engines: ['smarty']
  1. There is not kernel.root_dir var. Now we have kernel.project_dir. And default folder is templates
  2. Small change we need in \NoiseLabs\Bundle\SmartyBundle\Extension\SecurityExtension
- return $this->authorizationChecker->isGranted($role, $object);
+ try {
+            return $this->authorizationChecker->isGranted($role, $object);
+       } catch (AuthenticationCredentialsNotFoundException $e) {
+            return false;
+        }
  1. EngineInterface namespace changed;
- use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
+ use Symfony\Component\Templating\EngineInterface;
  1. Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface removed without replacement
  2. The biggest problem FileLocator interface changed. Now we can't inject anything in FileLocator except $kernel
class FileLocatorFactory
{
    /**
     * @param KernelInterface $kernel A KernelInterface instance
     * @param null|string     $path   The path the global resource directory
     * @param array           $paths  An array of paths where to look for resources
     */
    public static function createFileLocator(KernelInterface $kernel, ?string $path, array $paths, array $extraTemplatePaths): FileLocator
    {
        return new FileLocator($kernel, /**$path, array_merge($paths, $extraTemplatePaths)*/);
    }
}
  1. Small problems with tests. They can be easily solved except this problem with FileLocator
@vitorbrandao
Copy link
Member

Hi, @oldy777. I've started working on sf5 in this PR but it's not a trivial task as they have dropped the built-in support for multiple templating engines. I'll get in touch with the core team.

My plan is to release a stable 4.0 SmartyBundle release this month then have the master branch free for sf5 support work.

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

2 participants