本文整理汇总了PHP中Smarty::_IS_WINDOWS方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::_IS_WINDOWS方法的具体用法?PHP Smarty::_IS_WINDOWS怎么用?PHP Smarty::_IS_WINDOWS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::_IS_WINDOWS方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unmuteExpectedErrors
if ($previous !== $error_handler) {
Smarty::$_previous_error_handler = $previous;
}
}
/**
* Disable error handler muting expected messages
*
* @return void
*/
public static function unmuteExpectedErrors()
{
restore_error_handler();
}
}
// Check if we're running on windows
Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
if (Smarty::$_CHARSET !== 'UTF-8') {
Smarty::$_UTF8_MODIFIER = '';
}
/**
* Smarty exception class
* @package Smarty
*/
class SmartyException extends Exception
{
public static $escape = true;
public function __construct($message)
{
$this->message = self::$escape ? htmlentities($message) : $message;
}
示例2: __construct
/**
* Initialize new Smarty object
*/
public function __construct()
{
if (is_callable('mb_internal_encoding')) {
mb_internal_encoding(Smarty::$_CHARSET);
}
$this->start_time = microtime(true);
// check default dirs for overloading
if ($this->template_dir[0] !== './templates/' || isset($this->template_dir[1])) {
$this->setTemplateDir($this->template_dir);
}
if ($this->config_dir[0] !== './configs/' || isset($this->config_dir[1])) {
$this->setConfigDir($this->config_dir);
}
if ($this->compile_dir !== './templates_c/') {
unset(self::$_muted_directories['./templates_c/']);
$this->setCompileDir($this->compile_dir);
}
if ($this->cache_dir !== './cache/') {
unset(self::$_muted_directories['./cache/']);
$this->setCacheDir($this->cache_dir);
}
if (isset($this->plugins_dir)) {
$this->setPluginsDir($this->plugins_dir);
} else {
$this->setPluginsDir(SMARTY_PLUGINS_DIR);
}
if (isset($_SERVER['SCRIPT_NAME'])) {
Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
}
// Check if we're running on windows
Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
if (Smarty::$_CHARSET !== 'UTF-8') {
Smarty::$_UTF8_MODIFIER = '';
}
}
示例3: __construct
/**
* Initialize new Smarty object
*/
public function __construct()
{
if (is_callable('mb_internal_encoding')) {
mb_internal_encoding(Smarty::$_CHARSET);
}
$this->start_time = microtime(true);
if (isset($_SERVER['SCRIPT_NAME'])) {
Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
}
// Check if we're running on windows
Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
if (Smarty::$_CHARSET !== 'UTF-8') {
Smarty::$_UTF8_MODIFIER = '';
}
}
示例4: __construct
/**
* Initialize new Smarty object
*/
public function __construct()
{
if (is_callable('mb_internal_encoding')) {
mb_internal_encoding(Smarty::$_CHARSET);
}
$this->start_time = microtime(true);
// check default dirs for overloading
$this->setTemplateDir(APPPATH . 'views/');
if ($this->config_dir[0] !== './configs/' || isset($this->config_dir[1])) {
$this->setConfigDir($this->config_dir);
}
unset(self::$_muted_directories['./templates_c/']);
$this->setCompileDir(APPPATH . 'Runtime/compile/');
unset(self::$_muted_directories['./cache/']);
$this->setCacheDir(APPPATH . 'Runtime/cache/');
if (isset($this->plugins_dir)) {
$this->setPluginsDir($this->plugins_dir);
} else {
$this->setPluginsDir(SMARTY_PLUGINS_DIR);
}
if (isset($_SERVER['SCRIPT_NAME'])) {
Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
}
// Check if we're running on windows
Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
}