PHP Classes

File: engine/modules/core/image/image.hook.inc

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/image/image.hook.inc   Download  
File: engine/modules/core/image/image.hook.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 6 years ago
Size: 655 bytes
 

Contents

Class file image Download
<?php

/**
 * Implements hook_clear_cache().
 *
 * Clears all thumbnails.
 *
 * @param Environment $env
 * The Environment.
 * @param array $vars
 * An array of variables.
 */
function image_clear_cache($env, $vars) {
 
/** @var Doctor $doctor */
 
$doctor = $vars['doctor'];
 
$doctor->op('Deleting all thumbnails...');
 
array_map('unlink', glob($env->dir['thumbs'] . "/*"));
 
$doctor->ok('Done!');
}

/**
 * Implements hook_boot().
 *
 * React to robots.txt requests.
 *
 * @param Environment $env
 * The Environment.
 * @param array $vars
 * An array of variables.
 */
function image_boot($env, $vars) {
 
$env->tmpdir('thumbs', 'thumbs');
}