akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Blade: bust OPcode cache when writing a compiled template file #687

Closed nikosdion closed 4 years ago

nikosdion commented 4 years ago

When Blade compiles a template it writes a .php file on disk. However, if opcode caching is enabled and we are overwriting an existing compiled template PHP will cache the contents of the previous incarnation of the view template, potentially leading to hard to identify problems.

The solution is to bust the opcode cache as soon as we write the template file, forcing PHP to read the compiled template afresh right away.