src/PuliTemplateLoader.php
/**
     * Returns true if the template is still fresh.
     *
     * @param string    $path The template name
     * @param timestamp $time The last modification time of the cached template
     *
     * @return Boolean true if the template is fresh, false otherwise
     *
     * @throws \Twig_Error_Loader When $path is not found
     */
Returns true if the template is still fresh.
@param string    $path The template name
@param timestamp $time The last modification time of the cached template

@return Boolean true if the template is fresh, false otherwise

@throws \Twig_Error_Loader When $path is not found
Returns true if the template is still fresh . @param string $path The template name @param timestamp $time The last modification time of the cached template @return Boolean true if the template is fresh false otherwise @throws \ Twig_Error_Loader When $path is not found
public function isFresh($path, $time)
    {
        try {
            $file = $this->repo->get($path);
            if (!$file instanceof FileResourceInterface) {
                throw new \Twig_Error_Loader(sprintf(
                    'Can only load file resources. Resource "%s" is of type %s.',
                    $path,
                    is_object($file) ? get_class($file) : gettype($file)
                ));
            }
            return $file->getLastModifiedAt() <= $time;
        } catch (ResourceNotFoundException $e) {
            throw new \Twig_Error_Loader($e->getMessage(), -1, null, $e);
        } catch (InvalidPathException $e) {
            throw new \Twig_Error_Loader($e->getMessage(), -1, null, $e);
        }
    }
public function isFresh ( $ path , $ time ) { try { $ file = $ this -> repo -> get ( $ path ) ; if ( ! $ file instanceof FileResourceInterface ) { throw new \ Twig_Error_Loader ( sprintf ( 'Can only load file resources. Resource "%s" is of type %s.' , $ path , is_object ( $ file ) ? get_class ( $ file ) : gettype ( $ file ) ) ) ; } return $ file -> getLastModifiedAt ( ) <= $ time ; } catch ( ResourceNotFoundException $ e ) { throw new \ Twig_Error_Loader ( $ e -> getMessage ( ) , - 1 , null , $ e ) ; } catch ( InvalidPathException $ e ) { throw new \ Twig_Error_Loader ( $ e -> getMessage ( ) , - 1 , null , $ e ) ; } }
Returns true if the template is still fresh.
Returns true if the template is still fresh .