/**
 * Clear thumbnails (cron task function).
 *
 * @param vivvo_lite_site	$sm
 */
function auto_clear_thumbnails($sm = null)
{
    clear_directory(VIVVO_FS_INSTALL_ROOT . VIVVO_FS_FILES_DIR . 'thumbnail/');
    if (defined('VIVVO_CRONJOB_MODE')) {
        echo 'auto_clear_thumbnails: Finished.' . PHP_EOL;
    }
}
Esempio n. 2
0
function force_remove_directory($path)
{
    if (clear_directory($path)) {
        if (rmdir($path)) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
Esempio n. 3
0
function clear_directory($directory)
{
    $iterator = new \DirectoryIterator($directory);
    foreach ($iterator as $file) {
        if (!$file->isDot()) {
            if ($file->isDir()) {
                clear_directory($file->getPathname());
            } else {
                unlink($file->getPathname());
            }
        }
    }
}
Esempio n. 4
0
 function clearCache()
 {
     $cache_dir = BASEPATH . '/cache/output/';
     clear_directory($cache_dir);
 }