PopulatorData
2 months ago
AccessControl.php
2 years ago
Activator.php
2 months ago
AssetsLoader.php
2 weeks ago
Capabilities.php
2 months ago
Changelog.php
2 months ago
DeactivationPoll.php
3 years ago
DeferredAdminNotices.php
2 months ago
Env.php
6 months ago
Hooks.php
1 month ago
HooksWooCommerce.php
1 month ago
Initializer.php
1 month ago
Installer.php
10 months ago
Localizer.php
3 years ago
Menu.php
1 month ago
PersonalDataErasers.php
1 month ago
PersonalDataExporters.php
1 month ago
PluginActivatedHook.php
3 years ago
Populator.php
2 weeks ago
PrivacyPolicy.php
1 month ago
Renderer.php
1 year ago
RendererFactory.php
3 years ago
RequirementsChecker.php
2 months ago
Router.php
2 months ago
ServicesChecker.php
3 years ago
Shortcodes.php
1 month ago
SilentUpgraderSkin.php
3 years ago
SubscriberChangesNotifier.php
2 months ago
TranslationUpdater.php
3 months ago
TwigEnvironment.php
1 year ago
TwigFileSystemCache.php
3 years ago
Updater.php
5 days ago
index.php
3 years ago
TwigFileSystemCache.php
30 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Config; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | class TwigFileSystemCache extends \MailPoetVendor\Twig\Cache\FilesystemCache { |
| 9 | |
| 10 | private $directory; |
| 11 | |
| 12 | public function __construct( |
| 13 | string $directory, |
| 14 | int $options = 0 |
| 15 | ) { |
| 16 | $this->directory = \rtrim($directory, '\\/') . '/'; |
| 17 | parent::__construct($directory, $options); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * The original FileSystemCache of twig generates the key depending on PHP_VERSION. |
| 22 | * We need to produce the same key regardless of PHP_VERSION. Therefore, we |
| 23 | * overwrite this method. |
| 24 | **/ |
| 25 | public function generateKey(string $name, string $className): string { |
| 26 | $hash = \hash('sha256', $className); |
| 27 | return $this->directory . $hash[0] . $hash[1] . '/' . $hash . '.php'; |
| 28 | } |
| 29 | } |
| 30 |