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


PHP Smarty::clear_compiled_tpl方法代码示例

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


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

示例1: clearTemplates

 /**
  * Clear all compiled templates
  * @return void
  */
 public function clearTemplates()
 {
     // adapt with smarty 2
     if (method_exists($this->_smarty, 'clear_compiled_tpl')) {
         return $this->_smarty->clear_compiled_tpl();
     }
     // adapt with smarty 3
     return $this->_smarty->clear_compiled_template();
 }
开发者ID:LWFeng,项目名称:hush,代码行数:13,代码来源:Smarty.php

示例2: ClearCompiled

 public function ClearCompiled($compile_id = null, $exp_time = null)
 {
     return parent::clear_compiled_tpl($this->_template, $compile_id, $exp_time);
 }
开发者ID:raj47i,项目名称:PHP.Fx,代码行数:4,代码来源:theme.php

示例3: install

/**
 * Install controller.
 *
 * @return void
 */
function install(Core $core)
{
    define('_ZINSTALLVER', Core::VERSION_NUM);
    $serviceManager = $core->getContainer();
    $eventManager = $core->getDispatcher();
    // Lazy load DB connection to avoid testing DSNs that are not yet valid (e.g. no DB created yet)
    $dbEvent = new GenericEvent(null, array('lazy' => true));
    $eventManager->dispatch('doctrine.init_connection', $dbEvent);
    $core->init(Core::STAGE_ALL & ~Core::STAGE_THEME & ~Core::STAGE_MODS & ~Core::STAGE_LANGS & ~Core::STAGE_DECODEURLS & ~Core::STAGE_SESSIONS);
    // Power users might have moved the temp folder out of the root and changed the config.php
    // accordingly. Make sure we respect this security related settings
    $tempDir = isset($GLOBALS['ZConfig']['System']['temp']) ? $GLOBALS['ZConfig']['System']['temp'] : 'ztemp';
    // define our smarty object
    $smarty = new Smarty();
    $smarty->caching = false;
    $smarty->compile_check = true;
    $smarty->left_delimiter = '{';
    $smarty->right_delimiter = '}';
    $smarty->compile_dir = $tempDir . '/view_compiled';
    $smarty->template_dir = 'install/templates';
    $smarty->plugins_dir = array('plugins', 'install/templates/plugins');
    $smarty->clear_compiled_tpl();
    file_put_contents("{$tempDir}/view_compiled/index.html", '');
    $lang = FormUtil::getPassedValue('lang', '', 'GETPOST');
    $dbhost = FormUtil::getPassedValue('dbhost', '', 'GETPOST');
    $dbusername = FormUtil::getPassedValue('dbusername', '', 'GETPOST');
    $dbpassword = FormUtil::getPassedValue('dbpassword', '', 'GETPOST');
    $dbname = FormUtil::getPassedValue('dbname', '', 'GETPOST');
    $dbprefix = '';
    $dbdriver = FormUtil::getPassedValue('dbdriver', '', 'GETPOST');
    $dbtabletype = FormUtil::getPassedValue('dbtabletype', '', 'GETPOST');
    $username = FormUtil::getPassedValue('username', '', 'POST');
    $password = FormUtil::getPassedValue('password', '', 'POST');
    $repeatpassword = FormUtil::getPassedValue('repeatpassword', '', 'POST');
    $email = FormUtil::getPassedValue('email', '', 'GETPOST');
    $action = FormUtil::getPassedValue('action', '', 'GETPOST');
    $notinstalled = isset($_GET['notinstalled']);
    $installedState = isset($GLOBALS['ZConfig']['System']['installed']) ? $GLOBALS['ZConfig']['System']['installed'] : 0;
    // If somehow we are browsing the not installed page but installed, redirect back to homepage
    if ($installedState && $notinstalled) {
        $response = new RedirectResponse(System::getHomepageUrl());
        return $response->send();
    }
    // see if the language was already selected
    $languageAlreadySelected = $lang ? true : false;
    if (!$notinstalled && $languageAlreadySelected && empty($action)) {
        $response = new RedirectResponse(System::getBaseUri() . "/install.php?action=requirements&lang={$lang}");
        return $response->send();
    }
    // see if the language was already selected
    $languageAlreadySelected = $lang ? true : false;
    if (!$notinstalled && $languageAlreadySelected && empty($action)) {
        $response = new RedirectResponse(System::getBaseUri() . "/install.php?action=requirements&lang={$lang}");
        return $response->send();
    }
    // load the installer language files
    if (empty($lang)) {
        if (is_readable('config/installer.ini')) {
            $test = parse_ini_file('config/installer.ini');
            $lang = isset($test['language']) ? $test['language'] : 'en';
        } else {
            $available = ZLanguage::getInstalledLanguages();
            $detector = new ZLanguageBrowser($available);
            $lang = $detector->discover();
        }
        $lang = DataUtil::formatForDisplay($lang);
    }
    // setup multilingual
    $GLOBALS['ZConfig']['System']['language_i18n'] = $lang;
    $GLOBALS['ZConfig']['System']['multilingual'] = true;
    $GLOBALS['ZConfig']['System']['languageurl'] = true;
    $GLOBALS['ZConfig']['System']['language_detect'] = false;
    $serviceManager->loadArguments($GLOBALS['ZConfig']['System']);
    $_lang = ZLanguage::getInstance();
    $_lang->setup();
    $lang = ZLanguage::getLanguageCode();
    $installbySQL = file_exists("install/sql/custom-{$lang}.sql") ? "install/sql/custom-{$lang}.sql" : false;
    $smarty->assign('lang', $lang);
    $smarty->assign('installbySQL', $installbySQL);
    $smarty->assign('langdirection', ZLanguage::getDirection());
    $smarty->assign('charset', ZLanguage::getEncoding());
    // show not installed case
    if ($notinstalled) {
        header('HTTP/1.1 503 Service Unavailable');
        $smarty->display('notinstalled.tpl');
        $smarty->clear_compiled_tpl();
        file_put_contents("{$tempDir}/view_compiled/index.html", '');
        exit;
    }
    // assign the values from config.php
    $smarty->assign($GLOBALS['ZConfig']['System']);
    // if the system is already installed, halt.
    if ($GLOBALS['ZConfig']['System']['installed']) {
        _installer_alreadyinstalled($smarty);
    }
//.........这里部分代码省略.........
开发者ID:planetenkiller,项目名称:core,代码行数:101,代码来源:lib.php

示例4: Smarty

            include_once 'version/2.0.0rc2.php';
            include_once 'version/2.0.0.php';
            include_once 'version/2.0.1.php';
            include_once 'version/2.0.2.php';
            include_once 'version/2.0.3.php';
        }
        echo '<li>Regenerating the totals table</li>';
        totals_regenerate();
        echo '<li>Clearing /cache directory</li>';
        include_once '../internal/Smarty.class.php';
        $smarty = new Smarty();
        $smarty->config_dir = '';
        $smarty->compile_dir = "../cache";
        $smarty->template_dir = "../templates";
        $smarty->config_dir = "..";
        $smarty->clear_compiled_tpl();
        include mnminclude . 'admin_config.php';
        $config = new pliggconfig();
        $config->create_file("../settings.php");
        echo '</ul></p><div class="alert alert-info">' . $lang['IfNoError'] . '</div></p>';
        //end of if post submit is Yes.
    }
    //end of no errors
} else {
    echo DisplayErrors($errors);
    echo '<p>' . $lang['PleaseFix'] . '</p>';
}
echo '</div>';
// .well
$include = 'footer.php';
if (file_exists($include)) {
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:31,代码来源:upgrade1.php

示例5: generate

 /**
  *  データーフォーマットの生成
  */
 protected function generate()
 {
     // データーフォーマット情報を取得
     $class_name = Cascade_Controller::getDataFormatClassName($this->schema_name);
     $file_path = Cascade_Controller::getClassFilePath($this->schema_name, $class_name);
     if (file_exists($file_path) !== FALSE) {
         $ex_msg = 'Already exists a file of DataFormat {filename} %s';
         $ex_msg = sprintf($ex_msg, $file_path);
         throw new Cascade_Exception_Exception($ex_msg);
     }
     // Smarty初期化
     include_once 'Smarty/Smarty.class.php';
     $smarty = new Smarty();
     $smarty->template_dir = CASCADE_SKEL_DIR_PATH;
     $smarty->compile_dir = '/var/tmp';
     // 変数値の埋め込み
     $smarty->assign('class_name', $class_name);
     $smarty->assign('table_name', $this->table_name);
     $smarty->assign('dsn_ident', $this->dsn_ident);
     if ($this->table_status !== NULL) {
         $auto_increment = $this->table_status['Auto_increment'] !== NULL ? 'TRUE' : 'FALSE';
         $smarty->assign('auto_increment', $auto_increment);
     }
     if ($this->table_fields !== NULL) {
         $field_names = array();
         foreach ($this->table_fields as $tmp) {
             $field_names[] = $tmp['Field'];
         }
         $smarty->assign('field_names', $field_names);
     }
     if (isset($this->default['author'])) {
         $smarty->assign('author', $this->default['author']);
     }
     if (isset($this->default['package'])) {
         $smarty->assign('package', $this->default['package']);
     }
     // 生成
     $tmp = $smarty->fetch('data-format-sql.php.tpl');
     $smarty->clear_compiled_tpl();
     if (FALSE === file_put_contents($file_path, $tmp, LOCK_EX)) {
         throw new Cascade_Exception_Exception('Could not generate a file');
     }
     // 完了
     $message = $this->config['message_done'] . PHP_EOL;
     $message .= '    class_name :: ' . $class_name . PHP_EOL;
     $message .= '    file_path  :: ' . $file_path;
     $this->print_long_message($message);
 }
开发者ID:gree,项目名称:cascade,代码行数:51,代码来源:SQL.php

示例6: 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);
 }
开发者ID:billyprice1,项目名称:whmcs,代码行数:14,代码来源:functions.php


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