当前位置: 首页>>代码示例>>PHP>>正文


PHP Smarty::unmuteExpectedErrors方法代码示例

本文整理汇总了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--;
     }
 }
开发者ID:anp135,项目名称:altocms,代码行数:7,代码来源:Viewer.class.php

示例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;
 }
开发者ID:harmofwk,项目名称:harmofwk,代码行数:13,代码来源:smarty_internal_resource_php.php

示例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;
 }
开发者ID:harmofwk,项目名称:harmofwk,代码行数:13,代码来源:smarty_internal_cacheresource_file.php

示例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();
 }
开发者ID:jjs180,项目名称:dance-america,代码行数:16,代码来源:MuteExpectedErrorsTests.php

示例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;
 }
开发者ID:lnmpoo,项目名称:yangziephp,代码行数:16,代码来源:SmartyView.class.php

示例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;
 }
开发者ID:harmofwk,项目名称:harmofwk,代码行数:20,代码来源:Smarty.class.php

示例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;
 }
开发者ID:harmofwk,项目名称:harmofwk,代码行数:27,代码来源:smarty_resource.php

示例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;
 }
开发者ID:rsids,项目名称:bright_api,代码行数:46,代码来源:Mailing.php


注:本文中的Smarty::unmuteExpectedErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。