1: <?php
2:
3: /**
4: * Jyxo PHP Library
5: *
6: * LICENSE
7: *
8: * This source file is subject to the new BSD license that is bundled
9: * with this package in the file license.txt.
10: * It is also available through the world-wide-web at this URL:
11: * https://github.com/jyxo/php/blob/master/license.txt
12: */
13:
14: /**
15: * Container for PO file headers.
16: *
17: * @category Jyxo
18: * @package Jyxo_Gettext
19: * @subpackage Parser
20: * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
21: * @license https://github.com/jyxo/php/blob/master/license.txt
22: * @author Matěj Humpál
23: */
24: class Jyxo_Gettext_Parser_Header
25: {
26: /**
27: * Constructor.
28: *
29: * @param string $items PO file header
30: */
31: public function __construct($items)
32: {
33: $items = explode("\n", $items);
34: foreach ($items as $item) {
35: $item = trim($item, '"');
36: $array = explode(': ', $item);
37: if (!empty($array[0])) {
38: if (!empty($array[1])) {
39: $this->{$array[0]} = $array[1];
40: }
41: }
42: }
43: }
44: }
45: