src/Adapter/FileCache.php
public function clearExpired()
    {
        if (! $this->enabled) {
            return;
        }
        $error = false;

        set_error_handler(function () use (&$error) {
            $error = true;
        }, E_WARNING);
        foreach (glob($this->getPath() . '/*.dat') as $file) {
            if (filemtime($file) < time()) {
                unlink($file);
            }
        }
        restore_error_handler();

        return ! $error;
    }
public function clearExpired()
    {
        if (! $this->enabled) {
            return;
        }
        $error = false;

        set_error_handler(function () use (&$error) {
            $error = true;
        }, E_WARNING);
        foreach (glob($this->getPath() . '/*.dat') as $file) {
            if (filemtime($file) < time()) {
                unlink($file);
            }
        }
        restore_error_handler();

        return ! $error;
    }
public function clearExpired ( ) { if ( ! $ this -> enabled ) { return ; } $ error = false ; set_error_handler ( function ( ) use ( & $ error ) { $ error = true ; } , E_WARNING ) ; foreach ( glob ( $ this -> getPath ( ) . '/*.dat' ) as $ file ) { if ( filemtime ( $ file ) < time ( ) ) { unlink ( $ file ) ; } } restore_error_handler ( ) ; return ! $ error ; }
Cleans all expired variables.

It is recommended not to use this method directly.
This method is called from the destructor if necessary.

@return null|bool Returns null if adapter is disabled, true on success,
false otherwise
Cleans all expired variables .