本文整理汇总了PHP中Smarty::unmuteExpectedErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::unmuteExpectedErrors方法的具体用法?PHP Smarty::unmuteExpectedErrors怎么用?PHP Smarty::unmuteExpectedErrors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::unmuteExpectedErrors方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _unmuteErrors
protected function _unmuteErrors()
{
if ($this->nMuteErrorsCnt > 0) {
$this->oSmarty->unmuteExpectedErrors();
$this->nMuteErrorsCnt--;
}
}
示例2: populateTimestamp
/**
* populate Source Object with timestamp and exists from Resource
*
* @param Smarty_Template_Source $source source object
* @return void
*/
public function populateTimestamp(Smarty_Template_Source $source)
{
Smarty::muteExpectedErrors();
$source->timestamp = @filemtime($source->filepath);
Smarty::unmuteExpectedErrors();
$source->exists = !!$source->timestamp;
}
示例3: populateTimestamp
/**
* populate Cached Object with timestamp and exists from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @return void
*/
public function populateTimestamp(Smarty_Template_Cached $cached)
{
Smarty::muteExpectedErrors();
$cached->timestamp = @filemtime($cached->filepath);
Smarty::unmuteExpectedErrors();
$cached->exists = !!$cached->timestamp;
}
示例4: testMutedCaching
public function testMutedCaching()
{
$this->_errors = array();
set_error_handler(array($this, 'error_handler'));
Smarty::muteExpectedErrors();
$this->smarty->caching = true;
$this->smarty->clearCache('default.tpl');
$this->smarty->clearCompiledTemplate('default.tpl');
$this->smarty->fetch('default.tpl');
$this->assertEquals($this->_errors, array());
@filemtime('ckxladanwijicajscaslyxck');
$error = array(__FILE__ . ' line ' . (__LINE__ - 1));
$this->assertEquals($error, $this->_errors);
Smarty::unmuteExpectedErrors();
restore_error_handler();
}
示例5: __construct
public function __construct()
{
if (!is_null(self::$smarty)) {
return;
}
$smarty = new Smarty();
$smarty->left_delimiter = C('LEFT_DELIMITER');
$smarty->right_delimiter = C('RIGHT_DELIMITER');
$smarty->template_dir = APP_TPL_PATH . '/' . CONTROLLER . '/';
$smarty->compile_dir = APP_COMPILE_PATH;
$smarty->cache_dir = APP_CACHE_PATH;
$smarty->caching = C('CACHE_ON');
$smarty->cache_lifetime = C("CACHE_TIME");
$smarty->unmuteExpectedErrors();
self::$smarty = $smarty;
}
示例6: clearCache
/**
* Empty cache for a specific template
*
* @param string $template_name template name
* @param string $cache_id cache id
* @param string $compile_id compile id
* @param integer $exp_time expiration time
* @param string $type resource type
* @return integer number of cache files deleted
*/
public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
{
Smarty::muteExpectedErrors();
// load cache resource and call clear
$_cache_resource = Smarty_CacheResource::load($this, $type);
Smarty_CacheResource::invalidLoadedCache($this);
$t = $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time);
Smarty::unmuteExpectedErrors();
return $t;
}
示例7: getCompiled
/**
* get a Compiled Object of this source
*
* @param Smarty_Internal_Template $_template template objet
* @return Smarty_Template_Compiled compiled object
*/
public function getCompiled(Smarty_Internal_Template $_template)
{
// check runtime cache
$_cache_key_dir = join(DIRECTORY_SEPARATOR, $_template->smarty->getTemplateDir());
$_cache_key = $_template->template_resource . '#' . $_template->compile_id;
if (!isset(Smarty_Resource::$compileds[$_cache_key_dir])) {
Smarty_Resource::$compileds[$_cache_key_dir] = array();
}
if (isset(Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key])) {
return Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key];
}
$compiled = new Smarty_Template_Compiled($this);
$this->handler->populateCompiledFilepath($compiled, $_template);
Smarty::muteExpectedErrors();
$compiled->timestamp = @filemtime($compiled->filepath);
Smarty::unmuteExpectedErrors();
$compiled->exists = !!$compiled->timestamp;
// runtime cache
Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key] = $compiled;
return $compiled;
}
示例8: _parse
private function _parse($pid)
{
$tpl = new Template();
$template = $tpl->getTemplateDefinitionByPageId($pid);
if ((int) $template->templatetype != 1) {
throw $this->throwException(7008);
}
$_SESSION['language'] = 'tpl';
$page = new Page();
$opage = $page->getPageById($pid, false, true);
$tn = new OTreeNode();
$tn->page = $opage;
$tname = $template->itemtype;
if (!file_exists(BASEPATH . '/bright/site/views/' . $tname . 'View.php')) {
throw $this->throwException(7010, array($tname . 'View'));
}
// include_once('views/' . $tname . 'View.php');
$viewclass = $tname . 'View';
$view = new $viewclass($tn);
// Simplify page for parsing
// @deprecated Should not be used anymore
foreach ($opage->content as $cfield => $value) {
$opage->{$cfield} = $value;
}
$deactivationlink = BASEURL . 'bright/';
if (defined('USEACTIONDIR') && USEACTIONDIR) {
$deactivationlink .= 'actions/';
}
$deactivationlink .= 'registration.php?action=deactivate&email={email}&code={code}';
$view->deactivationlink = $deactivationlink;
define('DEACTIVATIONLINK', $deactivationlink);
if (method_exists($view, 'parseTemplate')) {
// Bright parser
$parsed = $view->parseTemplate($view, $template->itemtype);
} else {
// Smarty parser
\Smarty::muteExpectedErrors();
$parsed = $view->output();
\Smarty::unmuteExpectedErrors();
}
$parsed = preg_replace_callback('/<img([^>]*)src="\\/([^"]*)"([^>]*)\\/>/ism', array($this, '_replaceImage'), $parsed);
$result = new \stdClass();
$result->page = $opage;
$result->parsed = $parsed;
return $result;
}