src/PhpSigep/Cache/Storage/Adapter/FileSystem.php
protected function internalHasItem(& $normalizedKey)
    {
        $file = $this->getFileSpec($normalizedKey) . '.dat';
        if (!file_exists($file)) {
            return false;
        }

        $ttl = $this->getOptions()->getTtl();
        if ($ttl) {
            ErrorHandler::start();
            $mtime = filemtime($file);
            $error = ErrorHandler::stop();
            if (!$mtime) {
                throw new Exception\RuntimeException(
                    "Error getting mtime of file '{$file}'", 0, $error
                );
            }

            if (time() >= ($mtime + $ttl)) {
                return false;
            }
        }

        return true;
    }
protected function internalHasItem(& $normalizedKey)
    {
        $file = $this->getFileSpec($normalizedKey) . '.dat';
        if (!file_exists($file)) {
            return false;
        }

        $ttl = $this->getOptions()->getTtl();
        if ($ttl) {
            ErrorHandler::start();
            $mtime = filemtime($file);
            $error = ErrorHandler::stop();
            if (!$mtime) {
                throw new Exception\RuntimeException(
                    "Error getting mtime of file '{$file}'", 0, $error
                );
            }

            if (time() >= ($mtime + $ttl)) {
                return false;
            }
        }

        return true;
    }
protected function internalHasItem ( & $ normalizedKey ) { $ file = $ this -> getFileSpec ( $ normalizedKey ) . '.dat' ; if ( ! file_exists ( $ file ) ) { return false ; } $ ttl = $ this -> getOptions ( ) -> getTtl ( ) ; if ( $ ttl ) { ErrorHandler :: start ( ) ; $ mtime = filemtime ( $ file ) ; $ error = ErrorHandler :: stop ( ) ; if ( ! $ mtime ) { throw new Exception \ RuntimeException ( "Error getting mtime of file '{$file}'" , 0 , $ error ) ; } if ( time ( ) >= ( $ mtime + $ ttl ) ) { return false ; } } return true ; }
Internal method to test if an item exists.

@param  string $normalizedKey
@throws Exception\RuntimeException
@return bool
Internal method to test if an item exists .