From 943266e341a610b4323487067a37d17272fe0432 Mon Sep 17 00:00:00 2001 From: Botanic Date: Thu, 13 Jun 2013 14:33:23 -0700 Subject: [PATCH] auto create folders --- .../ryzom_ams/ams_lib/autoload/helpers.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php index 6d200d774..10ee5e85f 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php @@ -14,6 +14,9 @@ class Helpers{ // caching must be disabled for multi-language support $smarty -> caching = false; $smarty -> cache_lifetime = 120; + + helpers :: create_folders (); + if ( !helpers :: check_if_game_client () or $forcelibrender = true ){ $smarty -> template_dir = $AMS_LIB . '/ingame_templates/'; $smarty -> setConfigDir( $AMS_LIB . '/configs' ); @@ -44,6 +47,23 @@ class Helpers{ $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() { // if HTTP_USER_AGENT is not set then its ryzom core