Skip to content

Commit

Permalink
Merge branch 'MDL-51530-master' of git://github.com/ryanwyllie/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Oct 6, 2015
2 parents 4ed45a1 + df09876 commit 1337160
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 97 deletions.
8 changes: 4 additions & 4 deletions lib/lessphp/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function Get( $less_files, $parser_options = array(), $modify_vars
self::ListFiles($list_file, $list, $cached_name);
$compiled_name = self::CompiledName($list);

// if $cached_name != $compiled_name, we know we need to recompile
// if $cached_name is the same as the $compiled name, don't regenerate
if( !$cached_name || $cached_name === $compiled_name ){

$output_file = self::OutputFile($compiled_name, $parser_options );
Expand Down Expand Up @@ -252,7 +252,7 @@ public static function CleanCache(){
continue;
}

$full_path = Less_Cache::$cache_dir.'/'.$file;
$full_path = Less_Cache::$cache_dir . $file;

// make sure the file still exists
// css files may have already been deleted
Expand Down Expand Up @@ -280,7 +280,7 @@ public static function CleanCache(){
if( $type === 'list' ){
self::ListFiles($full_path, $list, $css_file_name);
if( $css_file_name ){
$css_file = Less_Cache::$cache_dir.'/'.$css_file_name;
$css_file = Less_Cache::$cache_dir . $css_file_name;
if( file_exists($css_file) ){
unlink($css_file);
}
Expand Down Expand Up @@ -313,4 +313,4 @@ static function ListFiles($list_file, &$list, &$css_file_name ){

}

}
}
2 changes: 1 addition & 1 deletion lib/lessphp/Exception/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct($message = null, Exception $previous = null, $index

protected function getInput(){

if( !$this->input && $this->currentFile && $this->currentFile['filename'] ){
if( !$this->input && $this->currentFile && $this->currentFile['filename'] && file_exists($this->currentFile['filename']) ){
$this->input = file_get_contents( $this->currentFile['filename'] );
}
}
Expand Down
Loading

0 comments on commit 1337160

Please sign in to comment.