this bug 6014 was solved, added a way to validate if a file exist
This commit is contained in:
@@ -93,9 +93,15 @@ class Translation extends BaseTranslation {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
if( ! is_dir(dirname($cacheFile)) )
|
||||
G::mk_dir(dirname($cacheFile));
|
||||
|
||||
if (!file_exists($cacheFile) || !file_exists($cacheFileJS)){
|
||||
$error = 'translation file does not exist';
|
||||
throw new Exception($error);
|
||||
}
|
||||
$f = fopen( $cacheFile , 'w+');
|
||||
fwrite( $f , "<?php\n" );
|
||||
fwrite( $f , '$translation =' . 'unserialize(\'' . addcslashes( serialize ( $translation ), '\\\'' ) . "');\n");
|
||||
@@ -113,6 +119,10 @@ class Translation extends BaseTranslation {
|
||||
$res['rows'] = count ( $translation );
|
||||
$res['rowsJS'] = count ( $translationJS );
|
||||
return $res;
|
||||
} catch( Exception $e ) {
|
||||
//echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user