Commit b02bd6c0 authored by techird's avatar techird

Merge branch 'native-export' of github.com:fex-team/kityminder into native-export

parents d3c707da adf5189f
...@@ -18,11 +18,11 @@ class Tpl { ...@@ -18,11 +18,11 @@ class Tpl {
$dir = dirname( __FILE__ ) . '/'; $dir = dirname( __FILE__ ) . '/';
$smarty->config_dir = $dir . "tmp/configs"; $smarty->config_dir = self::createDir( $dir . "tmp/configs" );
$smarty->caching = false; $smarty->caching = false;
$smarty->template_dir = $dir . "tpl"; $smarty->template_dir = self::createDir( $dir . "tpl" );
$smarty->compile_dir = $dir . "tmp/templates_c"; $smarty->compile_dir = self::createDir( $dir . "tmp/templates_c" );
$smarty->cache_dir = $dir . "tmp/cahce"; $smarty->cache_dir = self::createDir( $dir . "tmp/cahce" );
if ( !empty( $data ) ) { if ( !empty( $data ) ) {
foreach ( $data as $k=>$v ) { foreach ( $data as $k=>$v ) {
...@@ -34,4 +34,18 @@ class Tpl { ...@@ -34,4 +34,18 @@ class Tpl {
} }
private static function createDir ( $path ) {
if ( file_exists( $path ) ) {
return $path;
}
if ( !mkdir( $path, 0700, true ) ) {
throw new Exception( "directory creation failed: " . $path );
}
return $path;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment