$mimeinfo = & get_mimetypes_array();
if (!array_key_exists($mimetype, $cached)) {
- $cached[$mimetype] = null;
+ $cached[$mimetype] = null;
foreach($mimeinfo as $filetype => $values) {
if ($values['type'] == $mimetype) {
if ($cached[$mimetype] === null) {
* @return string cached file path
*/
public static function create_from_url($ref, $url, $options = array()) {
- global $CFG;
$instance = self::get_instance($options);
$cachedfilepath = $instance->generate_filepath($ref);
$fp = fopen($cachedfilepath, 'w');
* @return string cached file path
*/
public static function create_from_string($ref, $string, $options = array()) {
- global $CFG;
$instance = self::get_instance($options);
$cachedfilepath = $instance->generate_filepath($ref);
$fp = fopen($cachedfilepath, 'w');