auto create folders
This commit is contained in:
parent
aad9d74e40
commit
e657d24824
1 changed files with 20 additions and 0 deletions
|
@ -14,6 +14,9 @@ class Helpers{
|
||||||
// caching must be disabled for multi-language support
|
// caching must be disabled for multi-language support
|
||||||
$smarty -> caching = false;
|
$smarty -> caching = false;
|
||||||
$smarty -> cache_lifetime = 120;
|
$smarty -> cache_lifetime = 120;
|
||||||
|
|
||||||
|
helpers :: create_folders ();
|
||||||
|
|
||||||
if ( !helpers :: check_if_game_client () or $forcelibrender = true ){
|
if ( !helpers :: check_if_game_client () or $forcelibrender = true ){
|
||||||
$smarty -> template_dir = $AMS_LIB . '/ingame_templates/';
|
$smarty -> template_dir = $AMS_LIB . '/ingame_templates/';
|
||||||
$smarty -> setConfigDir( $AMS_LIB . '/configs' );
|
$smarty -> setConfigDir( $AMS_LIB . '/configs' );
|
||||||
|
@ -44,6 +47,23 @@ class Helpers{
|
||||||
$smarty -> display( $template . '.tpl' );
|
$smarty -> display( $template . '.tpl' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function create_folders(){
|
||||||
|
$arr = array( $AMS_LIB . '/ingame_templates/',
|
||||||
|
$AMS_LIB . '/configs',
|
||||||
|
$AMS_LIB . '/cache',
|
||||||
|
$SITEBASE . '/cache/',
|
||||||
|
$SITEBASE . '/templates/',
|
||||||
|
$SITEBASE . '/templates_c/',
|
||||||
|
$SITEBASE . '/configs'
|
||||||
|
);
|
||||||
|
foreach ( $arr as & $value ){
|
||||||
|
if ( !file_exists( $value ) ){
|
||||||
|
mkdir( $value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function check_if_game_client()
|
public function check_if_game_client()
|
||||||
{
|
{
|
||||||
// if HTTP_USER_AGENT is not set then its ryzom core
|
// if HTTP_USER_AGENT is not set then its ryzom core
|
||||||
|
|
Loading…
Reference in a new issue