Skip to content

Commit

Permalink
bug #2043 Fix load cache (MaCroTux)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 1.x branch (closes #2043).

Discussion
----------

Fix load cache

In PHP7 @ do not works and it is resource expensive, switching to if statement.

Commits
-------

b5df3d1 Fix load cache
  • Loading branch information
fabpot committed Jun 21, 2016
2 parents 9abbf27 + b5df3d1 commit c561e89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Twig/Cache/Filesystem.php
Expand Up @@ -46,7 +46,7 @@ public function generateKey($name, $className)
*/
public function load($key)
{
@include_once $key;
if (file_exists($key)) @include_once $key;
}

/**
Expand Down

3 comments on commit c561e89

@joelpittet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the suppression needed anymore then?

@drzraf
Copy link

@drzraf drzraf commented on c561e89 Dec 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question: why was output suppression needed in the first place?
When a buggy template is generated, it just dies without transmitting any information (not even a bool).
#1837
#1836
#1840

@stof
Copy link
Member

@stof stof commented on c561e89 Dec 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error suppression is not about buggy templates, but about non existent file due to a race condition

Please sign in to comment.