File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,18 +389,35 @@ private function isCacheUpToDate(&$path, $input = null)
389389 return file_exists ($ path );
390390 }
391391
392- private function getCacheDirectory ()
392+ private function readCacheDirectoryFromOptions ()
393393 {
394394 $ cacheFolder = $ this ->hasOption ('cache_dir ' )
395395 ? $ this ->getOption ('cache_dir ' )
396396 : null ;
397+
397398 if (!$ cacheFolder && $ cacheFolder !== false ) {
398399 $ cacheFolder = $ this ->getRenderer ()->hasOption ('cache_dir ' )
399400 ? $ this ->getRenderer ()->getOption ('cache_dir ' )
400401 : null ;
401402 }
403+
402404 if ($ cacheFolder === true ) {
403- $ cacheFolder = $ this ->getOption ('tmp_dir ' );
405+ return $ this ->getOption ('tmp_dir ' );
406+ }
407+
408+ return $ cacheFolder ;
409+ }
410+
411+ private function getCacheDirectory ()
412+ {
413+ $ cacheFolder = $ this ->readCacheDirectoryFromOptions ();
414+
415+ if ($ cacheFolder === null ) {
416+ throw new RuntimeException (
417+ 'You need to set "cache_dir" option to a writable location in order ' .
418+ 'to use cache feature. ' ,
419+ 7
420+ );
404421 }
405422
406423 if (!is_dir ($ cacheFolder ) && !@mkdir ($ cacheFolder , 0777 , true )) {
You can’t perform that action at this time.
0 commit comments