mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
Optimize constructor
This commit is contained in:
@@ -223,19 +223,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $template_dir = array();
|
private $template_dir = array('./templates/');
|
||||||
/**
|
/**
|
||||||
* joined template directory string used in cache keys
|
* joined template directory string used in cache keys
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $joined_template_dir = null;
|
public $joined_template_dir = './templates/';
|
||||||
/**
|
/**
|
||||||
* joined config directory string used in cache keys
|
* joined config directory string used in cache keys
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $joined_config_dir = null;
|
public $joined_config_dir = './config/';
|
||||||
/**
|
/**
|
||||||
* default template handler
|
* default template handler
|
||||||
*
|
*
|
||||||
@@ -259,7 +259,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $compile_dir = null;
|
private $compile_dir = './templates_c/';
|
||||||
/**
|
/**
|
||||||
* plugins directory
|
* plugins directory
|
||||||
*
|
*
|
||||||
@@ -271,13 +271,13 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $cache_dir = null;
|
private $cache_dir = './templates_c/';
|
||||||
/**
|
/**
|
||||||
* config directory
|
* config directory
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $config_dir = array();
|
private $config_dir = array('./config/');
|
||||||
/**
|
/**
|
||||||
* force template compiling?
|
* force template compiling?
|
||||||
*
|
*
|
||||||
@@ -660,15 +660,11 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
}
|
}
|
||||||
$this->start_time = microtime(true);
|
$this->start_time = microtime(true);
|
||||||
// set default dirs
|
// set default dirs
|
||||||
$this->setTemplateDir('./templates/')
|
$this->setPluginsDir(SMARTY_PLUGINS_DIR);
|
||||||
->setCompileDir('./templates_c/')
|
|
||||||
->setPluginsDir(SMARTY_PLUGINS_DIR)
|
|
||||||
->setCacheDir('./cache/')
|
|
||||||
->setConfigDir('./configs/');
|
|
||||||
|
|
||||||
$this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';
|
$this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';
|
||||||
if (isset($_SERVER['SCRIPT_NAME'])) {
|
if (isset($_SERVER['SCRIPT_NAME'])) {
|
||||||
$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
|
Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_variable($_SERVER['SCRIPT_NAME']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we're running on windows
|
// Check if we're running on windows
|
||||||
|
Reference in New Issue
Block a user