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

Run Twig in degraded mode if cache is not available. #13227

Closed
wants to merge 1 commit into from
Closed

Run Twig in degraded mode if cache is not available. #13227

wants to merge 1 commit into from

Conversation

udan11
Copy link
Contributor

@udan11 udan11 commented Apr 29, 2017

Fixes #13225.

Signed-off-by: Dan Ungureanu udan1107@gmail.com

Before submitting pull request, please check that every commit:

  • Has proper Signed-Off-By
  • Has commit message which describes it
  • Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
  • Any new functionality is covered by tests

Fixes #13225.

Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
@codecov
Copy link

codecov bot commented Apr 29, 2017

Codecov Report

Merging #13227 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #13227      +/-   ##
==========================================
+ Coverage    54.4%    54.4%   +<.01%     
==========================================
  Files         470      470              
  Lines       69905    69906       +1     
==========================================
+ Hits        38034    38035       +1     
  Misses      31871    31871

Copy link
Contributor

@nijel nijel left a comment

Choose a reason for hiding this comment

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

I think it should also warn on the homepage about this in a similar way we warn for other configuration problems.

$this->twig = new Twig_Environment($loader, array(
'auto_reload' => true,
'cache' => CACHE_DIR . 'twig',
'cache' => is_writable($cache_dir) ? $cache_dir : false,
Copy link
Contributor

Choose a reason for hiding this comment

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

This will fail if the directory does not exist (what it always true on first run). It's probably better to try to create the dir if it does not exist (Twig would try to create it).

@nijel
Copy link
Contributor

nijel commented May 4, 2017

I've taken a bit more complex approach on this, it would be great if you could review #13237.

@nijel nijel self-assigned this May 5, 2017
@nijel
Copy link
Contributor

nijel commented May 5, 2017

Merged #13237 which addresses this in wider context.

@nijel nijel closed this May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Twig error on read only filesystem
2 participants