You are here

function Smarty::_read_file in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/smarty/Smarty.class.php \Smarty::_read_file()

read in a file

Parameters

string $filename:

Return value

string

1 call to Smarty::_read_file()
Smarty::_fetch_resource_info in includes/moodle/lib/smarty/Smarty.class.php
fetch the template info. Gets timestamp, and source if get_source is true

File

includes/moodle/lib/smarty/Smarty.class.php, line 1707

Class

Smarty
@package Smarty

Code

function _read_file($filename) {
  if (file_exists($filename) && ($fd = @fopen($filename, 'rb'))) {
    $contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
    fclose($fd);
    return $contents;
  }
  else {
    return false;
  }
}