| 38 | | if (null == self::$requestValueErrors) { |
|---|
| 39 | | self::$requestValueErrors = array(); |
|---|
| 40 | | $xjconf = new stubXJConfFacade(new XJConfFacade(array('__default' => stubXJConfLoader::getInstance()))); |
|---|
| 41 | | $xjconf->addDefinitions(stubFactory::getResourceURIs('xjconf/request.xml')); |
|---|
| 42 | | $sources = stubFactory::getResourceURIs('ipo/request.xml'); |
|---|
| 43 | | foreach ($sources as $source) { |
|---|
| 44 | | try { |
|---|
| 45 | | $xjconf->parse($source); |
|---|
| 46 | | } catch (stubXJConfException $xjce) { |
|---|
| 47 | | throw new stubRequestValueErrorException($xjce->getMessage()); |
|---|
| 48 | | } |
|---|
| 49 | | |
|---|
| 50 | | self::$requestValueErrors = array_merge(self::$requestValueErrors, $xjconf->getConfigValues()); |
|---|
| 51 | | } |
|---|
| | 36 | if (null != self::$requestValueErrors) { |
|---|
| | 37 | return; |
|---|
| | 38 | } |
|---|
| | 39 | |
|---|
| | 40 | self::$requestValueErrors = array(); |
|---|
| | 41 | $xjconf = new stubXJConfProxy($this); |
|---|
| | 42 | try { |
|---|
| | 43 | $xjconf->process(stubFactory::getResourceURIs('ipo/request.xml')); |
|---|
| | 44 | } catch (stubXJConfException $xjce) { |
|---|
| | 45 | throw new stubRequestValueErrorException($xjce->getMessage()); |
|---|
| 54 | | |
|---|
| | 48 | |
|---|
| | 49 | /** |
|---|
| | 50 | * returns the descriptor that identifies this initializer |
|---|
| | 51 | * |
|---|
| | 52 | * @return string |
|---|
| | 53 | */ |
|---|
| | 54 | public function getDescriptor() |
|---|
| | 55 | { |
|---|
| | 56 | return 'request'; |
|---|
| | 57 | } |
|---|
| | 58 | |
|---|
| | 59 | /** |
|---|
| | 60 | * returns the data to cache |
|---|
| | 61 | * |
|---|
| | 62 | * @return array |
|---|
| | 63 | */ |
|---|
| | 64 | public function getCacheData() |
|---|
| | 65 | { |
|---|
| | 66 | return self::$requestValueErrors; |
|---|
| | 67 | } |
|---|
| | 68 | |
|---|
| | 69 | /** |
|---|
| | 70 | * sets the data from the cache |
|---|
| | 71 | * |
|---|
| | 72 | * @param array $cacheData |
|---|
| | 73 | */ |
|---|
| | 74 | public function setCacheData(array $cacheData) |
|---|
| | 75 | { |
|---|
| | 76 | self::$requestValueErrors = $cacheData; |
|---|
| | 77 | } |
|---|
| | 78 | |
|---|
| | 79 | /** |
|---|
| | 80 | * returns a list of extensions for the parser |
|---|
| | 81 | * |
|---|
| | 82 | * @return array<Extension> |
|---|
| | 83 | */ |
|---|
| | 84 | public function getExtensions() |
|---|
| | 85 | { |
|---|
| | 86 | return array(); |
|---|
| | 87 | } |
|---|
| | 88 | |
|---|
| | 89 | /** |
|---|
| | 90 | * will be called in case the stubXJConfProxy did not found the data in the |
|---|
| | 91 | * cache and the initializer has to load values from the facade |
|---|
| | 92 | * |
|---|
| | 93 | * @param stubXJConfFacade $xjconf |
|---|
| | 94 | */ |
|---|
| | 95 | public function loadData(stubXJConfFacade $xjconf) |
|---|
| | 96 | { |
|---|
| | 97 | self::$requestValueErrors = array_merge(self::$requestValueErrors, $xjconf->getConfigValues()); |
|---|
| | 98 | } |
|---|
| | 99 | |
|---|