@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * Array of translation messages. |
83 | 83 | * @var array |
84 | 84 | */ |
85 | - protected $messages = array(); |
|
85 | + protected $messages=array(); |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * The source of message translations. |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | protected $cache; |
98 | 98 | |
99 | - protected $untranslated = array(); |
|
99 | + protected $untranslated=array(); |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Private constructor. MessageSource must be initialized using |
@@ -126,23 +126,23 @@ discard block |
||
126 | 126 | */ |
127 | 127 | static function &factory($type, $source='.', $filename='') |
128 | 128 | { |
129 | - $types = array('XLIFF','PHP','gettext','Database'); |
|
129 | + $types=array('XLIFF', 'PHP', 'gettext', 'Database'); |
|
130 | 130 | |
131 | 131 | if(empty($filename) && !in_array($type, $types)) |
132 | 132 | throw new Exception('Invalid type "'.$type.'", valid types are '. |
133 | 133 | implode(', ', $types)); |
134 | 134 | |
135 | - $class = 'MessageSource_'.$type; |
|
135 | + $class='MessageSource_'.$type; |
|
136 | 136 | |
137 | 137 | if(empty($filename)) |
138 | - $filename = dirname(__FILE__).'/'.$class.'.php'; |
|
138 | + $filename=dirname(__FILE__).'/'.$class.'.php'; |
|
139 | 139 | |
140 | - if(is_file($filename) == false) |
|
140 | + if(is_file($filename)==false) |
|
141 | 141 | throw new Exception("File $filename not found"); |
142 | 142 | |
143 | 143 | include_once $filename; |
144 | 144 | |
145 | - $obj = new $class($source); |
|
145 | + $obj=new $class($source); |
|
146 | 146 | |
147 | 147 | return $obj; |
148 | 148 | } |
@@ -168,36 +168,36 @@ discard block |
||
168 | 168 | */ |
169 | 169 | function load($catalogue='messages') |
170 | 170 | { |
171 | - $variants = $this->getCatalogueList($catalogue); |
|
171 | + $variants=$this->getCatalogueList($catalogue); |
|
172 | 172 | |
173 | - $this->messages = array(); |
|
173 | + $this->messages=array(); |
|
174 | 174 | |
175 | 175 | foreach($variants as $variant) |
176 | 176 | { |
177 | - $source = $this->getSource($variant); |
|
177 | + $source=$this->getSource($variant); |
|
178 | 178 | |
179 | - if($this->isValidSource($source) == false) continue; |
|
179 | + if($this->isValidSource($source)==false) continue; |
|
180 | 180 | |
181 | - $loadData = true; |
|
181 | + $loadData=true; |
|
182 | 182 | |
183 | 183 | if($this->cache) |
184 | 184 | { |
185 | - $data = $this->cache->get($variant, |
|
185 | + $data=$this->cache->get($variant, |
|
186 | 186 | $this->culture, $this->getLastModified($source)); |
187 | 187 | |
188 | 188 | if(is_array($data)) |
189 | 189 | { |
190 | - $this->messages[$variant] = $data; |
|
191 | - $loadData = false; |
|
190 | + $this->messages[$variant]=$data; |
|
191 | + $loadData=false; |
|
192 | 192 | } |
193 | 193 | unset($data); |
194 | 194 | } |
195 | 195 | if($loadData) |
196 | 196 | { |
197 | - $data = &$this->loadData($source); |
|
197 | + $data=&$this->loadData($source); |
|
198 | 198 | if(is_array($data)) |
199 | 199 | { |
200 | - $this->messages[$variant] = $data; |
|
200 | + $this->messages[$variant]=$data; |
|
201 | 201 | if($this->cache) |
202 | 202 | $this->cache->save($data, $variant, $this->culture); |
203 | 203 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function setCache(MessageCache $cache) |
235 | 235 | { |
236 | - $this->cache = $cache; |
|
236 | + $this->cache=$cache; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | public function append($message) |
245 | 245 | { |
246 | 246 | if(!in_array($message, $this->untranslated)) |
247 | - $this->untranslated[] = $message; |
|
247 | + $this->untranslated[]=$message; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function setCulture($culture) |
255 | 255 | { |
256 | - $this->culture = $culture; |
|
256 | + $this->culture=$culture; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |