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


PHP Smarty::setCompileCheck方法代码示例

本文整理汇总了PHP中Smarty::setCompileCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::setCompileCheck方法的具体用法?PHP Smarty::setCompileCheck怎么用?PHP Smarty::setCompileCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Smarty的用法示例。


在下文中一共展示了Smarty::setCompileCheck方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Smarty

<?php

// Inits Smarty template with correct paths
require_once 'Smarty.class.php';
// Initialize smarty
$smarty = new Smarty();
$smarty->setCompileCheck(ENV_LEVEL < ENV_LEVEL_PROD ? TRUE : FALSE);
$smarty->debugging = FALSE;
$smarty->template_dir = SMARTY_TEMPLATES_DIR;
$smarty->compile_dir = SMARTY_TEMPLATES_C_DIR;
$smarty->setCacheDir(SMARTY_CACHE_DIR);
开发者ID:jonathan-vallet,项目名称:craftanat,代码行数:11,代码来源:smarty.inc.php

示例2: project_history

 /**
  *
  */
 public static function project_history()
 {
     SystemEvent::raise(SystemEvent::DEBUG, "Called.", __METHOD__);
     if (empty($GLOBALS['project']) || !$GLOBALS['project'] instanceof Project || empty($_GET['bid'])) {
         $msg = 'Invalid request';
         SystemEvent::raise(SystemEvent::INFO, $msg, __METHOD__);
         echo json_encode(array('success' => false, 'error' => $msg));
         exit;
     }
     //
     // Viewing project build details
     //
     $build = null;
     // It's possible that no build was triggered yet.
     if (isset($_GET['bid']) && !empty($_GET['bid'])) {
         $build = Project_Build::getById($_GET['bid'], $GLOBALS['project'], $GLOBALS['user']);
     }
     if (!$build instanceof Project_Build) {
         $msg = 'Invalid request';
         SystemEvent::raise(SystemEvent::INFO, $msg, __METHOD__);
         echo json_encode(array('success' => false, 'error' => $msg));
         exit;
     }
     //
     // We need to process a Smarty file...
     // TODO: Centralize this
     //
     require_once CINTIENT_SMARTY_INCLUDE;
     $smarty = new Smarty();
     $smarty->setAllowPhpTag(true);
     $smarty->setCacheLifetime(0);
     $smarty->setDebugging(SMARTY_DEBUG);
     $smarty->setForceCompile(SMARTY_FORCE_COMPILE);
     $smarty->setCompileCheck(SMARTY_COMPILE_CHECK);
     $smarty->setTemplateDir(SMARTY_TEMPLATE_DIR);
     $smarty->setCompileDir(SMARTY_COMPILE_DIR);
     $smarty->error_reporting = error_reporting();
     Framework_SmartyPlugin::init($smarty);
     //
     // Special tasks. This is post build, so we're fetching an existing special task (never creating it)
     //
     $specialTasks = $build->getSpecialTasks();
     $smarty->assign('project_specialTasks', $specialTasks);
     if (!empty($specialTasks)) {
         foreach ($specialTasks as $task) {
             if (!class_exists($task)) {
                 SystemEvent::raise(SystemEvent::ERROR, "Unexisting special task. [PID={$GLOBALS['project']->getId()}] [BUILD={$build->getId()}] [TASK={$task}]", __METHOD__);
                 continue;
             }
             $o = $task::getById($build, $GLOBALS['user'], Access::READ);
             //$smarty->assign($task, $o); // Register for s
             if (!$o instanceof Build_SpecialTaskInterface) {
                 SystemEvent::raise(SystemEvent::ERROR, "Unexisting special task ID. [PID={$GLOBALS['project']->getId()}] [BUILD={$build->getId()}] [TASK={$task}] [TASKID={$build->getId()}]", __METHOD__);
                 continue;
             }
             $viewData = $o->getViewData();
             if (is_array($viewData)) {
                 foreach ($viewData as $key => $value) {
                     $smarty->assign($key, $value);
                 }
             }
             $o = null;
             unset($o);
         }
     }
     // Last assignments
     $smarty->assign('project_build', $build);
     $smarty->display('includes/buildHistoryRev.inc.tpl');
 }
开发者ID:rasismeiro,项目名称:cintient,代码行数:72,代码来源:AjaxManager.php

示例3: getcwd

 * User: Erdal Gunyar
 * Date: 28/01/2016
 * Time: 11:48
 */
/* Path settings */
define('ROOT_DIR', getcwd() . '/');
/* Composer autoload */
require ROOT_DIR . 'app/vendor/autoload.php';
/* DB */
Propel::init(ROOT_DIR . 'db/build/conf/orm-conf.php');
/* Global variables */
global $_DATA, $_SMARTY;
$_DATA = [];
/* Smarty settings */
$_SMARTY = new Smarty();
$_SMARTY->setTemplateDir(ROOT_DIR . 'tpl');
$_SMARTY->setCompileDir(ROOT_DIR . 'app/cache/templates');
$_SMARTY->setCacheDir(ROOT_DIR . 'app/cache/full-page');
$_SMARTY->setConfigDir(ROOT_DIR . 'config/');
$caching = CACHING_ENABLED ? Smarty::CACHING_LIFETIME_CURRENT : Smarty::CACHING_OFF;
$_SMARTY->setCaching($caching);
$_SMARTY->setCacheLifetime(-1);
// Never expires
$_SMARTY->setCompileCheck(ENVIRONMENT == 'dev');
/* Session */
session_start();
if ($_SESSION['error']) {
    $_DATA['error'] = $_SESSION['error'];
    $_SESSION['error'] = false;
    unset($_SESSION['error']);
}
开发者ID:Erdou,项目名称:Rikiki-MVC,代码行数:31,代码来源:init.php

示例4: getInstance

 public static function getInstance($param = null)
 {
     // 初始化Smarty自动加载
     if (!self::$isInit) {
         Bd_Autoloader::addClassMap(self::$smartyClassMap);
         self::$isInit = true;
     }
     // 从配置中读取参数
     if (!is_array($param)) {
         // 加载配置
         if (empty(self::$arrConf)) {
             self::$arrConf = Bd_Conf::getConf('/smarty/');
             if (empty(self::$arrConf)) {
                 self::$arrConf = null;
                 return null;
             }
         }
         // 取指定的配置组
         if ($param != null) {
             $param = self::$arrConf[$param];
             // 不存在则出错
             if (!$param) {
                 return null;
             }
         } else {
             $param = current(self::$arrConf);
         }
     }
     // new一个smarty
     $smarty = new Smarty();
     // 根据参数初始化该smarty对象
     $smarty->setTemplateDir(self::__absPath($param['template_dir']));
     $smarty->setCompileDir(self::__absPath($param['compile_dir']));
     $smarty->setCompileCheck($param['compile_check'] != '0');
     $smarty->setConfigDir(self::__absPath($param['config_dir']));
     if (!empty($param['config_load'])) {
         $smarty->configLoad($param['config_load']);
     }
     $smarty->addPluginsDir(self::__absPath($param['plugins_dir']));
     $smarty->left_delimiter = $param['left_delimiter'];
     $smarty->right_delimiter = $param['right_delimiter'];
     if (isset($_COOKIE['FIS_DEBUG']) && $_COOKIE['FIS_DEBUG'] === 'YlwtSmt' && self::isInternalIp(Bd_Ip::getClientIp())) {
         return new Bd_TplFactory($smarty);
     }
     return $smarty;
 }
开发者ID:drehere,项目名称:shenmegui,代码行数:46,代码来源:TplFactory.php


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