summaryrefslogtreecommitdiff
path: root/framework/I18N/TGlobalization.php
diff options
context:
space:
mode:
authorwei <>2006-08-05 01:05:07 +0000
committerwei <>2006-08-05 01:05:07 +0000
commit7d868c13a401d13f8777c0db5626832ac3f3a952 (patch)
treea538d61f69fb59b2d59df67b14065cd08864f488 /framework/I18N/TGlobalization.php
parent93c4193f4a3c315c7785bf5f9f522c955ef6fce7 (diff)
Fixed #318 and add chmod for each mkdir
Diffstat (limited to 'framework/I18N/TGlobalization.php')
-rw-r--r--framework/I18N/TGlobalization.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index aa545d21..1ea7ce2b 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -168,12 +168,33 @@ class TGlobalization extends TModule
{
if($config['type'] == 'XLIFF' || $config['type'] == 'gettext')
{
- $config['source'] = Prado::getPathOfNamespace($config['source']);
- if($config['source']===null || !is_dir($config['source']))
- throw new TException("invalid source dir '{$config['source']}'");
+ if($config['source'])
+ {
+ $config['source'] = Prado::getPathOfNamespace($config['source']);
+ if(!is_dir($config['source']))
+ {
+ if(@mkdir($config['source'])===false)
+ throw new TConfigurationException('globalization_source_path_failed',
+ $config['source']);
+ chmod($config['source'], 0777); //make it deletable
+ }
+ }
+ else
+ {
+ throw new TConfigurationException("invalid source dir '{$config['source']}'");
+ }
}
if($config['cache'])
+ {
$config['cache'] = $this->getApplication()->getRunTimePath().'/i18n';
+ if(!is_dir($config['cache']))
+ {
+ if(@mkdir($config['cache'])===false)
+ throw new TConfigurationException('globalization_cache_path_failed',
+ $config['cache']);
+ chmod($config['cache'], 0777); //make it deletable
+ }
+ }
$this->_translation = $config;
}