Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached templates that no longer exist #186

rkocman opened this issue Dec 18, 2018 · 1 comment

Cached templates that no longer exist #186

rkocman opened this issue Dec 18, 2018 · 1 comment


Copy link

@rkocman rkocman commented Dec 18, 2018

Version: 2.4.8

Bug Description

I am not really sure if this is a bug or a feature, but if you render some template with cache enabled and then you remove the source file, the cached version is still being used. I think that this depends on your interpretation of what it means for a cached template to be expired.

Steps To Reproduce

  1. render some template with cache enabled
  2. remove the source file
  3. render the same path again

Expected Behavior

Exception 'missing template file'

Possible Solution

The function isExpired in Latte\Loaders\FileLoader is already being called, however, it only checks the modification time of the source file and not its existence. I can use my own FileLoader that fixes this, but why this isn't somehow possible in default?


This comment has been minimized.

Copy link

@milo milo commented Jan 8, 2019

Verified. When source.latte is removed and cached PHP file still exists, it is used even with $autoRefresh enabled.

In this case, FileLoader::isExpired() returns false, because filemtime() results to false which is always less than given timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.