2013-02-07 17:37:16 +04:00
|
|
|
<?php
|
2013-04-28 11:33:36 +04:00
|
|
|
/*
|
2013-06-28 11:53:53 +04:00
|
|
|
* This file is part of Fenom.
|
2013-04-28 11:33:36 +04:00
|
|
|
*
|
|
|
|
* (c) 2013 Ivan Shalganov
|
|
|
|
*
|
2013-04-28 18:08:57 +04:00
|
|
|
* For the full copyright and license information, please view the license.md
|
2013-04-28 11:33:36 +04:00
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
2013-06-28 11:53:53 +04:00
|
|
|
namespace Fenom;
|
2013-02-07 17:37:16 +04:00
|
|
|
|
2013-07-04 01:28:10 +04:00
|
|
|
/**
|
2013-07-13 12:00:19 +04:00
|
|
|
* Interface of templates provider
|
2013-07-04 01:28:10 +04:00
|
|
|
* @package Fenom
|
|
|
|
* @author Ivan Shalganov <a.cobest@gmail.com>
|
|
|
|
*/
|
2013-07-29 14:58:14 +04:00
|
|
|
interface ProviderInterface
|
|
|
|
{
|
2013-02-07 17:37:16 +04:00
|
|
|
/**
|
|
|
|
* @param string $tpl
|
|
|
|
* @return bool
|
|
|
|
*/
|
2013-07-04 01:28:10 +04:00
|
|
|
public function templateExists($tpl);
|
2013-07-13 12:00:19 +04:00
|
|
|
|
2013-02-07 17:37:16 +04:00
|
|
|
/**
|
|
|
|
* @param string $tpl
|
2013-02-13 18:52:47 +04:00
|
|
|
* @param int $time
|
2013-02-07 17:37:16 +04:00
|
|
|
* @return string
|
|
|
|
*/
|
2013-02-13 18:52:47 +04:00
|
|
|
public function getSource($tpl, &$time);
|
2013-02-07 17:37:16 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $tpl
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getLastModified($tpl);
|
|
|
|
|
2013-02-21 22:51:24 +04:00
|
|
|
/**
|
2013-07-13 12:00:19 +04:00
|
|
|
* Verify templates (check mtime)
|
2013-02-21 22:51:24 +04:00
|
|
|
*
|
2013-07-13 12:00:19 +04:00
|
|
|
* @param array $templates [template_name => modified, ...] By conversation, you may trust the template's name
|
|
|
|
* @return bool if true - all templates are valid else some templates are invalid
|
2013-02-21 22:51:24 +04:00
|
|
|
*/
|
|
|
|
public function verify(array $templates);
|
2013-02-07 17:37:16 +04:00
|
|
|
|
|
|
|
/**
|
2013-07-13 12:00:19 +04:00
|
|
|
* Get all names of template from provider
|
|
|
|
* @return array|\Iterator
|
2013-02-07 17:37:16 +04:00
|
|
|
*/
|
2013-02-13 18:52:47 +04:00
|
|
|
public function getList();
|
2013-02-07 17:37:16 +04:00
|
|
|
}
|