Commit Graph

10 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
9c576fcc9c
Refactor Twig extensions to use Twig's AttributeExtension
This allows to remove most extensions.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-07-08 13:23:34 -03:00
Maurício Meneghini Fauth
90ee00efd5
Create the 'pma' global variable for Twig templates
Creates the Twig\PmaGlobalVariable class to handle the 'pma' Twig global
variable.

The idea of this global variable is to automatically inject in all
templates some useful information.

For now it only includes `pma.version` to get the phpMyAdmin version
and `pma.text_dir` to get the text direction ('ltr' or 'rtl').

Adding new variables to the `pma` global variable should be done with
caution.

- https://twig.symfony.com/doc/3.x/advanced.html#globals

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-07-09 20:30:48 -03:00
Maurício Meneghini Fauth
64a8a9d779
Rename the FlashMessages class to FlashMessenger
This class handles the flash messages instead of being a collection
of flash messages, so FlashMessenger is a better name.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-05-15 19:42:35 -03:00
Maurício Meneghini Fauth
18ad00f7a5
Remove the phpmyadmin/twig-i18n-extension package
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-04-25 14:42:13 -03:00
Maurício Meneghini Fauth
e0d42d2862
Remove trigger_error from Template class
This will remove the error:

> Error while working with template cache: Unable to create the cache directory

This does not fix the cache issue, but removes the warning.

The current behavior is to disable the cache when there's an issue with
it. However this has bad performance.

The issue is that sometimes Twig generates a different cache key than
the warmed up one and tries to write a new cache, but that's not the
desired behavior.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-02-23 19:09:28 -03:00
Maurício Meneghini Fauth
c700a5bcdb
Remove Twig\TableExtension class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-02-14 20:39:54 -03:00
Maurício Meneghini Fauth
74054cb4d3
Extract container builder logic to ContainerBuilder class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-12-22 19:22:18 -03:00
Maurício Meneghini Fauth
7650464b61
Change Twig cache dir to app/cache/twig
Extracts Config instance from Template::getTwigEnvironment()

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-12-04 12:08:46 -03:00
Maurício Meneghini Fauth
b2b53c6e18
Move ./templates directory to ./resources/templates
- Related to https://github.com/phpmyadmin/phpmyadmin/issues/18512

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-10-17 13:57:07 -03:00
Maurício Meneghini Fauth
c2955cc2b2
Rename the directory libraries/classes/ to src/
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-08-30 15:59:28 -03:00