本文整理汇总了PHP中Bootstrap::sys_get_temp_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::sys_get_temp_dir方法的具体用法?PHP Bootstrap::sys_get_temp_dir怎么用?PHP Bootstrap::sys_get_temp_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::sys_get_temp_dir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define( 'DEBUG_CALENDAR_LOG', $config['debug_calendar'] );
define( 'MEMCACHED_ENABLED', $config['memcached'] );
define( 'MEMCACHED_SERVER', $config['memcached_server'] );
define( 'TIME_ZONE', $config['time_zone'] );
define ('WS_IN_LOGIN', isset($config['WS_IN_LOGIN']) ? $config['WS_IN_LOGIN'] : 'serverconf');
// IIS Compatibility, SERVER_ADDR doesn't exist on that env, so we need to define it.
$_SERVER['SERVER_ADDR'] = isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_NAME'];
//to do: make different environments. sys
//check if it is a installation instance
if (! defined( 'PATH_C' )) {
// is a intallation instance, so we need to define PATH_C and PATH_LANGUAGECONT constants temporarily
define( 'PATH_C', (rtrim( Bootstrap::sys_get_temp_dir(), PATH_SEP ) . PATH_SEP) );
define( 'PATH_LANGUAGECONT', PATH_HOME . 'engine/content/languages/' );
}
//Load filter class
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
// defining Virtual URLs
$virtualURITable = array ();
$virtualURITable['/plugin/(*)'] = 'plugin';
$virtualURITable['/(sys*)/(*.js)'] = 'jsMethod';
$virtualURITable['/js/(*)'] = PATH_GULLIVER_HOME . 'js/';
$virtualURITable['/jscore/(*)'] = PATH_CORE . 'js/';
if (defined( 'PATH_C' )) {
示例2: renderTemplate
/**
* render a smarty template
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @param $template string
* containing the template filename on /gulliver/templates/
* directory
* @param $data associative
* array containig the template data
*/
public function renderTemplate($template, $data = array())
{
if (!defined('PATH_THIRDPARTY')) {
throw new Exception('System constant (PATH_THIRDPARTY) is not defined!');
}
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
$fInfo = pathinfo($template);
$tplExists = true;
// file has absolute path
if (substr($template, 0, 1) != PATH_SEP) {
$template = PATH_TEMPLATE . $template;
}
// fix for template that have dot in its name but is not a valid
// extension
if (isset($fInfo['extension']) && ($fInfo['extension'] != 'tpl' || $fInfo['extension'] != 'html')) {
unset($fInfo['extension']);
}
if (!isset($fInfo['extension'])) {
if (file_exists($template . '.tpl')) {
$template .= '.tpl';
} elseif (file_exists($template . '.html')) {
$template .= '.html';
} else {
$tplExists = false;
}
} else {
if (!file_exists($template)) {
$tplExists = false;
}
}
if (!$tplExists) {
throw new Exception("Template: {$template}, doesn't exist!");
}
$smarty = new Smarty();
$smarty->compile_dir = Bootstrap::sys_get_temp_dir();
$smarty->cache_dir = Bootstrap::sys_get_temp_dir();
$smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
$smarty->template_dir = PATH_TEMPLATE;
$smarty->force_compile = true;
foreach ($data as $key => $value) {
$smarty->assign($key, $value);
}
$smarty->display($template);
}
示例3: renderTemplate
/**
* render a smarty template
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @param $template string
* containing the template filename on /gulliver/templates/
* directory
* @param $data associative
* array containig the template data
*/
public static function renderTemplate($template, $data = array())
{
if (!defined('PATH_THIRDPARTY')) {
throw new Exception('System constant (PATH_THIRDPARTY) is not defined!');
}
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
// file has absolute path
if (substr($template, 0, 1) != PATH_SEP) {
$template = PATH_TEMPLATE . $template;
}
if (!file_exists($template)) {
throw new Exception("Template: {$template}, doesn't exist!");
}
$smarty = new Smarty();
$smarty->compile_dir = Bootstrap::sys_get_temp_dir();
$smarty->cache_dir = Bootstrap::sys_get_temp_dir();
$smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
$smarty->template_dir = PATH_TEMPLATE;
$smarty->force_compile = true;
foreach ($data as $key => $value) {
$smarty->assign($key, $value);
}
$smarty->display($template);
}