本文整理汇总了PHP中Smarty::clear_all_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::clear_all_cache方法的具体用法?PHP Smarty::clear_all_cache怎么用?PHP Smarty::clear_all_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::clear_all_cache方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSmarty
function getSmarty()
{
if ($this->smarty === NULL) {
require_once 'Smarty/Smarty.class.php';
$this->smarty = new Smarty();
$this->smarty->template_dir = './templates';
$this->smarty->plugins_dir = $this->smartyPluginDirs;
$this->smarty->compile_dir = $this->getCompileDir();
$this->smarty->clear_all_cache();
}
return $this->smarty;
}
示例2: createSmarty
/**
* Create a Smarty instance.
*
* @return \Smarty
*/
public function createSmarty()
{
$base = dirname(dirname(dirname(dirname(__DIR__))));
require_once 'Smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = "{$base}/xml/templates";
$smarty->plugins_dir = array("{$base}/packages/Smarty/plugins", "{$base}/CRM/Core/Smarty/plugins");
$smarty->compile_dir = $this->getCompileDir();
$smarty->clear_all_cache();
// CRM-5308 / CRM-3507 - we need {localize} to work in the templates
require_once 'CRM/Core/Smarty/plugins/block.localize.php';
$smarty->register_block('localize', 'smarty_block_localize');
return $smarty;
}
示例3: __construct
public function __construct($templateS, $formName = '', $viewerModuleName, $fieldData = array(), $invalidFields = array())
{
global $cfg;
$this->template = new Smarty();
$this->viewerModuleName = $viewerModuleName;
if (isset($cfg['smarty']['debug']) && $cfg['smarty']['debug'] == true) {
$this->template->clear_all_cache();
$this->template->caching = false;
$this->template->force_compile = true;
}
$this->template->compile_dir = $cfg['smarty']['compiledir'];
//$this->template->template_dir = $cfg['smarty']['tplRoot'];
$this->templateIDStack = $templateS;
$this->formName = $formName;
$this->fieldData = $fieldData;
$this->invalidFields = $invalidFields;
$this->templateFileName = MVCUtils::findTemplate(end($this->templateIDStack));
//echo "#" . $this->templateFileName . "#<br>";
if ($this->templateFileName === false) {
throw new LoggedException("The template with ID " . end($this->templateIDStack) . " could not be found", 0, self::module, 'error');
}
$this->setupTemplate();
}
示例4: clear_all_cache
/**
* Override the parent's clear_all_cache method to check if caching is on to begin with. We do this to prevent the
* cache/MAKETHISDIRWRITABLE.txt from being deleted during test runs; this file needs to exist in order for the
* cache directory to remain in the git repository.
* @param int $expire_time
*/
public function clear_all_cache($exp_time = null)
{
if ($this->caching == 1) {
parent::clear_all_cache($exp_time);
}
}
示例5: ClearCacheAll
public function ClearCacheAll($exp_time = null)
{
return parent::clear_all_cache($exp_time);
}
示例6: smarty_block_dynamic
$temp_variaveis = explode("/", $_SERVER['PHP_SELF']);
$_SESSION['pastaAmbiente'] = $temp_variaveis[2];
$_SESSION['sistema'] = "Peladinha";
$_SESSION['sistemaInterface'] = "Peladinha";
// configuracao do smarty
require 'bibliotecas/smarty/libs/Smarty.class.php';
$smarty = new Smarty();
function smarty_block_dynamic($param, $content, &$smarty)
{
return $content;
}
$smarty->compile_dir = "./html/tmp";
$smarty->caching = true;
$smarty->cache_lifetime = 86400;
$smarty->allow_php_tag = true;
$smarty->clear_all_cache();
$smarty->register_block('dynamic', 'smarty_block_dynamic', false);
$smarty->template_dir = dirname(__FILE__) . '/html/';
// adicionando as variaveis globais para usar nos templates
$smarty->assign('globals', $GLOBALS);
$_POST["d"] = "index";
$_POST["a"] = "index";
$_POST["f"] = "logado";
// criando as variaveis, atribuindo $_GET para uma $var apenas para nao ficar usando o $_GET toda hora
$d = isset($_REQUEST["d"]) ? $_REQUEST["d"] : $_POST["d"];
$a = isset($_REQUEST["a"]) ? $_REQUEST["a"] : $_POST["a"];
$f = isset($_REQUEST["f"]) ? $_REQUEST["f"] : $_POST["f"];
// se nao estiver com as variaveis requeridas, ele redireciona
if (!isset($d) && !isset($a) && !isset($f)) {
require_once 'redirect.php';
}
示例7: realpath
require_once "classes/Generator.php";
require_once "projectGenUtils.inc";
require_once "smarty/Smarty.class.php";
//
// Initialization
//
$g_cwd = realpath(dirname($_SERVER['PHP_SELF']));
echo " CWD = " . $g_cwd . "\n";
//
// Load, instantiate, and configure the smarty template engine.
//
echo " - Loading Smarty...\n";
$tpl = new Smarty();
$tpl->template_dir = $g_cwd . "/templates";
$tpl->compile_dir = $g_cwd . "/templates_c";
$tpl->clear_all_cache();
// By default we assume that the root of the Torque SDK
// is located two folders up from the CWD. That is unless
// another path is passed in the command line.
$torqueRoot = "../..";
if ($argc >= 3) {
$torqueRoot = str_replace("\\", "/", $argv[2]);
}
// Kick off the generator
T3D_Generator::init($torqueRoot);
// Ready to read our config file.
echo " - Loading config file " . realpath($argv[1]) . "\n";
require $argv[1];
// Generate all projects
T3D_Generator::generateProjects($tpl);
// Now the solutions (if any)
示例8: getTemplate
$createSmarty->cache_lifetime = 5;
// seconds; 3600= 1 hr, 86400=24 hours
$createSmarty->use_sub_dirs = true;
$createSmarty->clear_all_cache();
}
if (defined('IN_EVENTS')) {
$eventSmarty = new Smarty();
$eventSmarty->template_dir = FILE_PATH . '/templates/' . CURRENT_TEMPLATE . '/events/';
$eventSmarty->compile_dir = PATH_TO_LIBS . '/smarty/templates_c/events/';
$eventSmarty->config_dir = PATH_TO_LIBS . '/smarty/configs/events/';
$eventSmarty->cache_dir = PATH_TO_LIBS . '/smarty/cache/events/';
$eventSmarty->caching = 0;
$eventSmarty->cache_lifetime = 5;
// seconds; 3600= 1 hr, 86400=24 hours
$eventSmarty->use_sub_dirs = true;
$eventSmarty->clear_all_cache();
}
// Session stuff
session_name(SESSION_NAME);
session_start();
// Other important functions
function getTemplate($thisPageName)
{
$pageNameArray = explode('.', $thisPageName);
return $pageNameArray[0] . '.tpl';
}
function __autoload($classname)
{
$path = FILE_PATH . '/core/';
$classPath = $path . 'class.' . $classname . '.php';
require_once $classPath;
示例9: clearSmartyCaches
/**
* Clears both the end-user and admin template caches.
*/
function clearSmartyCaches()
{
global $templates_compiledir;
$smarty = new Smarty();
$smarty->compile_dir = $templates_compiledir;
$smarty->clear_all_cache();
$smarty->clear_compiled_tpl();
$src = "<?php\r\nheader(\"Location: ../index.php\");";
file_put_contents($templates_compiledir . "/index.php", $src);
unset($src);
}