From cd236d693d1df3e20c370c97a98c51ba3fcbd610 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 17 Jan 2007 22:26:53 +0000 Subject: Added PRADO_CHMOD constant so that users can specify the permission of PRADO-created directories --- framework/I18N/core/Gettext/PO.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'framework/I18N/core/Gettext/PO.php') diff --git a/framework/I18N/core/Gettext/PO.php b/framework/I18N/core/Gettext/PO.php index 7df99496..66c4596f 100644 --- a/framework/I18N/core/Gettext/PO.php +++ b/framework/I18N/core/Gettext/PO.php @@ -32,22 +32,22 @@ /** * File::Gettext::PO - * + * * @author Michael Wallner * @license PHP License */ - + require_once dirname(__FILE__).'/TGettext.php'; -/** +/** * File_Gettext_PO * * GNU PO file reader and writer. - * + * * @author Michael Wallner * @version $Revision: 1.2 $ * @access public - * @package System.I18N.core + * @package System.I18N.core */ class TGettext_PO extends TGettext { @@ -75,13 +75,13 @@ class TGettext_PO extends TGettext if (!isset($file)) { $file = $this->file; } - + // load file if (!$contents = @file($file)) { return false; } $contents = implode('', $contents); - + // match all msgid/msgstr entries $matched = preg_match_all( '/(msgid\s+("([^"]|\\\\")*?"\s*)+)\s+' . @@ -89,11 +89,11 @@ class TGettext_PO extends TGettext $contents, $matches ); unset($contents); - + if (!$matched) { return false; } - + // get all msgids and msgtrs for ($i = 0; $i < $matched; $i++) { $msgid = preg_replace( @@ -102,16 +102,16 @@ class TGettext_PO extends TGettext '/\s*msgstr\s*"(.*)"\s*/s', '\\1', $matches[4][$i]); $this->strings[parent::prepare($msgid)] = parent::prepare($msgstr); } - + // check for meta info if (isset($this->strings[''])) { $this->meta = parent::meta2array($this->strings['']); unset($this->strings['']); } - + return true; } - + /** * Save PO file * @@ -150,11 +150,11 @@ class TGettext_PO extends TGettext 'msgstr "' . parent::prepare($t, true) . '"' . "\n\n" ); } - + //done @flock($fh, LOCK_UN); @fclose($fh); - chmod($file,0777); + chmod($file,PRADO_CHMOD); return true; } } -- cgit v1.2.3