ast
13 years ago
cache
13 years ago
XmlImportConfig.php
13 years ago
XmlImportCsvParse.php
13 years ago
XmlImportException.php
13 years ago
XmlImportParser.php
13 years ago
XmlImportReaderInterface.php
13 years ago
XmlImportStringReader.php
13 years ago
XmlImportTemplate.php
13 years ago
XmlImportTemplateCodeGenerator.php
13 years ago
XmlImportTemplateParser.php
13 years ago
XmlImportTemplateScanner.php
13 years ago
XmlImportToken.php
13 years ago
pclzip.lib.php
13 years ago
XmlImportConfig.php
88 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @author Olexandr Zanichkovsky <olexandr.zanichkovsky@zophiatech.com> |
| 4 | * @author Pavel Kulbakin <p.kulbakin@gmail.com> |
| 5 | * @package General |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * This class is used for different XmlImport settings |
| 10 | */ |
| 11 | if (!class_exists('XmlImportConfig')) |
| 12 | { |
| 13 | final class XmlImportConfig |
| 14 | { |
| 15 | /** |
| 16 | * Singleton instance |
| 17 | * @var XmlImportConfig |
| 18 | */ |
| 19 | private static $instance = null; |
| 20 | /** |
| 21 | * Path to cache directory |
| 22 | * @var string |
| 23 | */ |
| 24 | private $cache_dir; |
| 25 | /** |
| 26 | * String to use when concatenating result of xpath corresponding to multiple elements |
| 27 | * @var string |
| 28 | */ |
| 29 | private $multi_glue; |
| 30 | |
| 31 | /** |
| 32 | * Initial settings |
| 33 | */ |
| 34 | private function init() |
| 35 | { |
| 36 | $this->setCacheDirectory(dirname(__FILE__) . '/cache'); |
| 37 | $this->setMultiGlue(', '); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Gets instance of a singleton class |
| 42 | * @return XmlImportConfig |
| 43 | */ |
| 44 | public static function getInstance() |
| 45 | { |
| 46 | //if (is_null(self::$instance)) { |
| 47 | self::$instance = new self; |
| 48 | self::$instance->init(); |
| 49 | //} |
| 50 | return self::$instance; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Returns path to cache directory |
| 55 | * @return string |
| 56 | */ |
| 57 | public function getCacheDirectory() |
| 58 | { |
| 59 | return $this->cache_dir; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Sets path to cache directory |
| 64 | * @param string $cacheDirectoryPath |
| 65 | */ |
| 66 | public function setCacheDirectory($cacheDirectoryPath) |
| 67 | { |
| 68 | $this->cache_dir = $cacheDirectoryPath; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Returns string glue to use when concatenating multiple elements |
| 73 | * @return string |
| 74 | */ |
| 75 | public function getMultiGlue() |
| 76 | { |
| 77 | return $this->multi_glue; |
| 78 | } |
| 79 | /** |
| 80 | * Sets string glue to use when concatenating multiple element |
| 81 | * @param unknown_type $glue |
| 82 | */ |
| 83 | public function setMultiGlue($glue) |
| 84 | { |
| 85 | $this->multi_glue = $glue; |
| 86 | } |
| 87 | } |
| 88 | } |