php-twig is psr-4 only since Bullseye
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
gitea/evoadmin-mail/pipeline/tag This commit looks good

This commit is contained in:
David Prevot 2024-02-13 10:09:16 +01:00
parent 2d312b605a
commit 0257f25e92
2 changed files with 6 additions and 16 deletions

View file

@ -1,18 +1,13 @@
<?php
if (file_exists(stream_resolve_include_path('/usr/share/php/Twig/autoload.php'))) {
require_once '/usr/share/php/Twig/autoload.php';
} elseif (stream_resolve_include_path(file_exists('/usr/share/php/Twig/Autoloader.php'))) {
require_once '/usr/share/php/Twig/Autoloader.php';
Twig_Autoloader::register();
}
require_once '/usr/share/php/Twig/autoload.php';
class MailNotify {
private static $twig, $adminmail;
public static function init() {
$loader = new Twig_Loader_Filesystem('tpl/mail');
self::$twig = new Twig_Environment($loader, array(
$loader = new Twig\Loader\FilesystemLoader('tpl/mail');
self::$twig = new Twig\Environment($loader, array(
'cache' => false
));

View file

@ -1,11 +1,6 @@
<?php
if (file_exists(stream_resolve_include_path('/usr/share/php/Twig/autoload.php'))) {
require_once '/usr/share/php/Twig/autoload.php';
} elseif (stream_resolve_include_path(file_exists('/usr/share/php/Twig/Autoloader.php'))) {
require_once '/usr/share/php/Twig/Autoloader.php';
Twig_Autoloader::register();
}
require_once '/usr/share/php/Twig/autoload.php';
class PageController {
public static $alerts=array();
@ -14,8 +9,8 @@ class PageController {
public static function init(LdapServer $server=NULL) {
self::$server = $server;
$loader = new Twig_Loader_Filesystem('tpl/page');
self::$twig = new Twig_Environment($loader, array(
$loader = new Twig\Loader\FilesystemLoader('tpl/page');
self::$twig = new Twig\Environment($loader, array(
'cache' => false
));