@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | if (is_array($validatorConfig)) { |
| 390 | 390 | $validator = array(); |
| 391 | 391 | foreach ($validatorConfig as $config) { |
| 392 | - if ($config === 'default' or ! class_exists($config)) { |
|
| 392 | + if ($config === 'default' or !class_exists($config)) { |
|
| 393 | 393 | return null; |
| 394 | 394 | } else { |
| 395 | 395 | $validator[] = new $config(); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | return $validator; |
| 400 | 400 | } else { |
| 401 | 401 | // Load validator by config (if non-default): |
| 402 | - if ($validatorConfig === 'default' or ! class_exists($validatorConfig)) { |
|
| 402 | + if ($validatorConfig === 'default' or !class_exists($validatorConfig)) { |
|
| 403 | 403 | return null; |
| 404 | 404 | } else { |
| 405 | 405 | $validator = new $validatorConfig(); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | protected $parameter_invoice = array(); |
| 53 | 53 | |
| 54 | 54 | /** @var Payone_Settings_Data_ConfigFile_Global_StatusMapping */ |
| 55 | - protected $status_mapping = null ; |
|
| 55 | + protected $status_mapping = null; |
|
| 56 | 56 | |
| 57 | 57 | /** @var array */ |
| 58 | 58 | protected $payment_creditcard = array(); |
@@ -68,6 +68,6 @@ |
||
| 68 | 68 | |
| 69 | 69 | public function addShop($shop) |
| 70 | 70 | { |
| 71 | - return $this->shop[]=$shop; |
|
| 71 | + return $this->shop[] = $shop; |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | protected $title = ''; |
| 42 | 42 | |
| 43 | 43 | protected $mid = null; |
| 44 | - protected $aid =null; |
|
| 44 | + protected $aid = null; |
|
| 45 | 45 | protected $portalid = null; |
| 46 | 46 | protected $fee_config = array(); |
| 47 | 47 | protected $min_order_total = null; |
| 48 | - protected $max_order_total =null; |
|
| 48 | + protected $max_order_total = null; |
|
| 49 | 49 | /** @var string */ |
| 50 | 50 | protected $types = null; |
| 51 | 51 | /** @var string */ |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | public function addFeeConfig($value) |
| 115 | 115 | { |
| 116 | - return $this->fee_config[]=$value; |
|
| 116 | + return $this->fee_config[] = $value; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function setMaxOrderTotal($max_order_total) |
@@ -143,8 +143,8 @@ |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * @return string |
|
| 147 | - */ |
|
| 146 | + * @return string |
|
| 147 | + */ |
|
| 148 | 148 | public function getKey() |
| 149 | 149 | { |
| 150 | 150 | return $this->key; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * @param string $active |
| 58 | 58 | */ |
| 59 | - public function setActive( $active) |
|
| 59 | + public function setActive($active) |
|
| 60 | 60 | { |
| 61 | 61 | $this->active = $active; |
| 62 | 62 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * @param string $authorization |
| 74 | 74 | */ |
| 75 | - public function setAuthorization( $authorization) |
|
| 75 | + public function setAuthorization($authorization) |
|
| 76 | 76 | { |
| 77 | 77 | $this->authorization = $authorization; |
| 78 | 78 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * @param string $countries |
| 90 | 90 | */ |
| 91 | - public function setCountries( $countries) |
|
| 91 | + public function setCountries($countries) |
|
| 92 | 92 | { |
| 93 | 93 | $this->countries = $countries; |
| 94 | 94 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * @param string $mode |
| 107 | 107 | */ |
| 108 | - public function setMode( $mode) |
|
| 108 | + public function setMode($mode) |
|
| 109 | 109 | { |
| 110 | 110 | $this->mode = $mode; |
| 111 | 111 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * @param string $newOrderStatus |
| 123 | 123 | */ |
| 124 | - public function setNewOrderStatus( $newOrderStatus) |
|
| 124 | + public function setNewOrderStatus($newOrderStatus) |
|
| 125 | 125 | { |
| 126 | 126 | $this->newOrderStatus = $newOrderStatus; |
| 127 | 127 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | /** |
| 51 | 51 | * @param $value |
| 52 | 52 | */ |
| 53 | - public function addTransactionstatusForwarding($value){ |
|
| 53 | + public function addTransactionstatusForwarding($value) { |
|
| 54 | 54 | $this->transactionstatus_forwarding[] = $value; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | $this->addChild($globalXml, $globalConfig, 'aid'); |
| 174 | 174 | $this->addChild($globalXml, $globalConfig, 'portalid'); |
| 175 | 175 | $this->addChild($globalXml, $globalConfig, 'request_type'); |
| 176 | - $this->mapParameterInvoice($globalConfig,$globalXml); |
|
| 176 | + $this->mapParameterInvoice($globalConfig, $globalXml); |
|
| 177 | 177 | $this->addStatusMapping($globalConfig, $globalXml); |
| 178 | - $this->mapPaymentCreditcard($globalConfig,$globalXml); |
|
| 178 | + $this->mapPaymentCreditcard($globalConfig, $globalXml); |
|
| 179 | 179 | return $shopXml; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | protected function mapProtect(Payone_Settings_Data_ConfigFile_Shop_Protect $protectConfig, DOMElement $shopXml) |
| 216 | 216 | { |
| 217 | - $protectXml = $this->appendElement($shopXml,$protectConfig->getKey()); |
|
| 217 | + $protectXml = $this->appendElement($shopXml, $protectConfig->getKey()); |
|
| 218 | 218 | |
| 219 | 219 | $protectXml = $this->mapConsumerscore($protectConfig->getConsumerscore(), $protectXml); |
| 220 | 220 | $protectXml = $this->mapAddresscheck($protectConfig->getAddresscheck(), $protectXml); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $tasXml = $this->appendElement($miscXml, $tasForwarding->getKey()); |
| 322 | 322 | |
| 323 | 323 | foreach ($tasForwarding->getTransactionstatusForwarding() as $keyTas => $config) { |
| 324 | - $configNode = $this->appendElement($tasXml,'config'); |
|
| 324 | + $configNode = $this->appendElement($tasXml, 'config'); |
|
| 325 | 325 | |
| 326 | 326 | foreach ($config as $key => $value) { |
| 327 | 327 | $configNode->setAttribute($key, $value); |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | public function addStatusMapping(Payone_Settings_Data_ConfigFile_Shop_Global $globalConfig, DOMElement $globalXml) |
| 337 | 337 | { |
| 338 | 338 | $statusMapping = $globalConfig->getStatusMapping(); |
| 339 | - $tasXml = $this->appendElement($globalXml,$statusMapping->getKey()); |
|
| 339 | + $tasXml = $this->appendElement($globalXml, $statusMapping->getKey()); |
|
| 340 | 340 | |
| 341 | 341 | foreach ($statusMapping->getStatusMapping() as $keyStatusMapping => $valueStatusMapping) { |
| 342 | - $parent = $this->appendElement($tasXml,$keyStatusMapping); |
|
| 342 | + $parent = $this->appendElement($tasXml, $keyStatusMapping); |
|
| 343 | 343 | |
| 344 | 344 | foreach ($valueStatusMapping as $key => $value) { |
| 345 | 345 | $mapNode = $this->appendElement($parent, 'map'); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | { |
| 386 | 386 | $feeConfig = $valueClearingType->getFeeConfig(); |
| 387 | 387 | if (!empty($feeConfig)) { |
| 388 | - $feeConfigNode = $this->appendElement($cleatringTypeNode,'fee_config'); |
|
| 388 | + $feeConfigNode = $this->appendElement($cleatringTypeNode, 'fee_config'); |
|
| 389 | 389 | |
| 390 | 390 | foreach ($feeConfig as $keyFeeConfig => $valueFeeConfig) { |
| 391 | 391 | if (array_key_exists('value', $valueFeeConfig) && array_key_exists('attribute', $valueFeeConfig)) { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $data = $object->$getter(); |
| 412 | 412 | $child = $parent; |
| 413 | 413 | if (is_array($data)) { |
| 414 | - $parentNode = $this->appendElement($parent,$property); |
|
| 414 | + $parentNode = $this->appendElement($parent, $property); |
|
| 415 | 415 | foreach ($data as $key => $value) { |
| 416 | 416 | $child = $this->appendElement($parentNode, $key, $value, $withCdata); |
| 417 | 417 | } |
@@ -452,9 +452,9 @@ discard block |
||
| 452 | 452 | * @param bool $asCdata |
| 453 | 453 | * @return DOMElement |
| 454 | 454 | */ |
| 455 | - protected function appendElement( $parent, $key, $value = null, $asCdata = false) |
|
| 455 | + protected function appendElement($parent, $key, $value = null, $asCdata = false) |
|
| 456 | 456 | { |
| 457 | - if($asCdata === true) |
|
| 457 | + if ($asCdata === true) |
|
| 458 | 458 | { |
| 459 | 459 | $cdata = $this->dom->createCDATASection($value); |
| 460 | 460 | $child = $this->dom->createElement($key); |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | else |
| 464 | 464 | { |
| 465 | 465 | $child = $this->dom->createElement($key); |
| 466 | - if($value !== null) |
|
| 466 | + if ($value !== null) |
|
| 467 | 467 | { |
| 468 | 468 | $domValue = $this->dom->createTextNode($value); |
| 469 | 469 | $child->appendChild($domValue); |
@@ -49,192 +49,192 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | class Payone_Log4php_LoggerHierarchy { |
| 51 | 51 | |
| 52 | - /** Array holding all Logger instances. */ |
|
| 53 | - protected $loggers = array(); |
|
| 52 | + /** Array holding all Logger instances. */ |
|
| 53 | + protected $loggers = array(); |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * The root logger. |
|
| 57 | - * @var RootLogger |
|
| 58 | - */ |
|
| 59 | - protected $root = null; |
|
| 55 | + /** |
|
| 56 | + * The root logger. |
|
| 57 | + * @var RootLogger |
|
| 58 | + */ |
|
| 59 | + protected $root = null; |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * The logger renderer map. |
|
| 63 | - * @var Payone_Log4php_LoggerRendererMap |
|
| 64 | - */ |
|
| 65 | - protected $rendererMap; |
|
| 61 | + /** |
|
| 62 | + * The logger renderer map. |
|
| 63 | + * @var Payone_Log4php_LoggerRendererMap |
|
| 64 | + */ |
|
| 65 | + protected $rendererMap; |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Main level threshold. Events with lower level will not be logged by any |
|
| 69 | - * logger, regardless of it's configuration. |
|
| 70 | - * @var Payone_Log4php_LoggerLevel |
|
| 71 | - */ |
|
| 72 | - protected $threshold; |
|
| 67 | + /** |
|
| 68 | + * Main level threshold. Events with lower level will not be logged by any |
|
| 69 | + * logger, regardless of it's configuration. |
|
| 70 | + * @var Payone_Log4php_LoggerLevel |
|
| 71 | + */ |
|
| 72 | + protected $threshold; |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Creates a new logger hierarchy. |
|
| 76 | - * @param Payone_Log4php_LoggerRoot $root The root logger. |
|
| 77 | - */ |
|
| 78 | - public function __construct(Payone_Log4php_LoggerRoot $root) { |
|
| 79 | - $this->root = $root; |
|
| 80 | - $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); |
|
| 81 | - $this->rendererMap = new Payone_Log4php_LoggerRendererMap(); |
|
| 82 | - } |
|
| 74 | + /** |
|
| 75 | + * Creates a new logger hierarchy. |
|
| 76 | + * @param Payone_Log4php_LoggerRoot $root The root logger. |
|
| 77 | + */ |
|
| 78 | + public function __construct(Payone_Log4php_LoggerRoot $root) { |
|
| 79 | + $this->root = $root; |
|
| 80 | + $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); |
|
| 81 | + $this->rendererMap = new Payone_Log4php_LoggerRendererMap(); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * Clears all loggers. |
|
| 86 | - */ |
|
| 87 | - public function clear() { |
|
| 88 | - $this->loggers = array(); |
|
| 89 | - } |
|
| 84 | + /** |
|
| 85 | + * Clears all loggers. |
|
| 86 | + */ |
|
| 87 | + public function clear() { |
|
| 88 | + $this->loggers = array(); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * Check if the named logger exists in the hierarchy. |
|
| 93 | - * @param string $name |
|
| 94 | - * @return boolean |
|
| 95 | - */ |
|
| 96 | - public function exists($name) { |
|
| 97 | - return isset($this->loggers[$name]); |
|
| 98 | - } |
|
| 91 | + /** |
|
| 92 | + * Check if the named logger exists in the hierarchy. |
|
| 93 | + * @param string $name |
|
| 94 | + * @return boolean |
|
| 95 | + */ |
|
| 96 | + public function exists($name) { |
|
| 97 | + return isset($this->loggers[$name]); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * Returns all the currently defined loggers in this hierarchy as an array. |
|
| 102 | - * @return array |
|
| 103 | - */ |
|
| 104 | - public function getCurrentLoggers() { |
|
| 105 | - return array_values($this->loggers); |
|
| 106 | - } |
|
| 100 | + /** |
|
| 101 | + * Returns all the currently defined loggers in this hierarchy as an array. |
|
| 102 | + * @return array |
|
| 103 | + */ |
|
| 104 | + public function getCurrentLoggers() { |
|
| 105 | + return array_values($this->loggers); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Returns a named logger instance logger. If it doesn't exist, one is created. |
|
| 110 | - * |
|
| 111 | - * @param string $name Logger name |
|
| 112 | - * @return Logger Logger instance. |
|
| 113 | - */ |
|
| 114 | - public function getLogger($name) { |
|
| 115 | - if(!isset($this->loggers[$name])) { |
|
| 116 | - $logger = new Payone_Log4php_Logger($name); |
|
| 108 | + /** |
|
| 109 | + * Returns a named logger instance logger. If it doesn't exist, one is created. |
|
| 110 | + * |
|
| 111 | + * @param string $name Logger name |
|
| 112 | + * @return Logger Logger instance. |
|
| 113 | + */ |
|
| 114 | + public function getLogger($name) { |
|
| 115 | + if(!isset($this->loggers[$name])) { |
|
| 116 | + $logger = new Payone_Log4php_Logger($name); |
|
| 117 | 117 | |
| 118 | - $nodes = explode('.', $name); |
|
| 119 | - $firstNode = array_shift($nodes); |
|
| 118 | + $nodes = explode('.', $name); |
|
| 119 | + $firstNode = array_shift($nodes); |
|
| 120 | 120 | |
| 121 | - // if name is not a first node but another first node is their |
|
| 122 | - if($firstNode != $name and isset($this->loggers[$firstNode])) { |
|
| 123 | - $logger->setParent($this->loggers[$firstNode]); |
|
| 124 | - } else { |
|
| 125 | - // if there is no father, set root logger as father |
|
| 126 | - $logger->setParent($this->root); |
|
| 127 | - } |
|
| 121 | + // if name is not a first node but another first node is their |
|
| 122 | + if($firstNode != $name and isset($this->loggers[$firstNode])) { |
|
| 123 | + $logger->setParent($this->loggers[$firstNode]); |
|
| 124 | + } else { |
|
| 125 | + // if there is no father, set root logger as father |
|
| 126 | + $logger->setParent($this->root); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - // if there are more nodes than one |
|
| 130 | - if(count($nodes) > 0) { |
|
| 131 | - // find parent node |
|
| 132 | - foreach($nodes as $node) { |
|
| 133 | - $parentNode = "$firstNode.$node"; |
|
| 134 | - if(isset($this->loggers[$parentNode]) and $parentNode != $name) { |
|
| 135 | - $logger->setParent($this->loggers[$parentNode]); |
|
| 136 | - } |
|
| 137 | - $firstNode .= ".$node"; |
|
| 138 | - } |
|
| 139 | - } |
|
| 129 | + // if there are more nodes than one |
|
| 130 | + if(count($nodes) > 0) { |
|
| 131 | + // find parent node |
|
| 132 | + foreach($nodes as $node) { |
|
| 133 | + $parentNode = "$firstNode.$node"; |
|
| 134 | + if(isset($this->loggers[$parentNode]) and $parentNode != $name) { |
|
| 135 | + $logger->setParent($this->loggers[$parentNode]); |
|
| 136 | + } |
|
| 137 | + $firstNode .= ".$node"; |
|
| 138 | + } |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - $this->loggers[$name] = $logger; |
|
| 142 | - } |
|
| 141 | + $this->loggers[$name] = $logger; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - return $this->loggers[$name]; |
|
| 145 | - } |
|
| 144 | + return $this->loggers[$name]; |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * Returns the logger renderer map. |
|
| 149 | - * @return Payone_Log4php_LoggerRendererMap |
|
| 150 | - */ |
|
| 151 | - public function getRendererMap() { |
|
| 152 | - return $this->rendererMap; |
|
| 153 | - } |
|
| 147 | + /** |
|
| 148 | + * Returns the logger renderer map. |
|
| 149 | + * @return Payone_Log4php_LoggerRendererMap |
|
| 150 | + */ |
|
| 151 | + public function getRendererMap() { |
|
| 152 | + return $this->rendererMap; |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - /** |
|
| 156 | - * Returns the root logger. |
|
| 157 | - * @return Payone_Log4php_LoggerRoot |
|
| 158 | - */ |
|
| 159 | - public function getRootLogger() { |
|
| 160 | - if(!isset($this->root) or $this->root == null) { |
|
| 161 | - $this->root = new Payone_Log4php_LoggerRoot(); |
|
| 162 | - } |
|
| 163 | - return $this->root; |
|
| 164 | - } |
|
| 155 | + /** |
|
| 156 | + * Returns the root logger. |
|
| 157 | + * @return Payone_Log4php_LoggerRoot |
|
| 158 | + */ |
|
| 159 | + public function getRootLogger() { |
|
| 160 | + if(!isset($this->root) or $this->root == null) { |
|
| 161 | + $this->root = new Payone_Log4php_LoggerRoot(); |
|
| 162 | + } |
|
| 163 | + return $this->root; |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - /** |
|
| 167 | - * Returns the main threshold level. |
|
| 168 | - * @return Payone_Log4php_LoggerLevel |
|
| 169 | - */ |
|
| 170 | - public function getThreshold() { |
|
| 171 | - return $this->threshold; |
|
| 172 | - } |
|
| 166 | + /** |
|
| 167 | + * Returns the main threshold level. |
|
| 168 | + * @return Payone_Log4php_LoggerLevel |
|
| 169 | + */ |
|
| 170 | + public function getThreshold() { |
|
| 171 | + return $this->threshold; |
|
| 172 | + } |
|
| 173 | 173 | |
| 174 | - /** |
|
| 175 | - * Returns true if the hierarchy is disabled for given log level and false |
|
| 176 | - * otherwise. |
|
| 177 | - * @return boolean |
|
| 178 | - */ |
|
| 179 | - public function isDisabled(Payone_Log4php_LoggerLevel $level) { |
|
| 180 | - return ($this->threshold->toInt() > $level->toInt()); |
|
| 181 | - } |
|
| 174 | + /** |
|
| 175 | + * Returns true if the hierarchy is disabled for given log level and false |
|
| 176 | + * otherwise. |
|
| 177 | + * @return boolean |
|
| 178 | + */ |
|
| 179 | + public function isDisabled(Payone_Log4php_LoggerLevel $level) { |
|
| 180 | + return ($this->threshold->toInt() > $level->toInt()); |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | - /** |
|
| 184 | - * Reset all values contained in this hierarchy instance to their |
|
| 185 | - * default. |
|
| 186 | - * |
|
| 187 | - * This removes all appenders from all loggers, sets |
|
| 188 | - * the level of all non-root loggers to <i>null</i>, |
|
| 189 | - * sets their additivity flag to <i>true</i> and sets the level |
|
| 190 | - * of the root logger to {@link LOGGER_LEVEL_DEBUG}. |
|
| 191 | - * |
|
| 192 | - * <p>Existing loggers are not removed. They are just reset. |
|
| 193 | - * |
|
| 194 | - * <p>This method should be used sparingly and with care as it will |
|
| 195 | - * block all logging until it is completed.</p> |
|
| 196 | - */ |
|
| 197 | - public function resetConfiguration() { |
|
| 198 | - $root = $this->getRootLogger(); |
|
| 183 | + /** |
|
| 184 | + * Reset all values contained in this hierarchy instance to their |
|
| 185 | + * default. |
|
| 186 | + * |
|
| 187 | + * This removes all appenders from all loggers, sets |
|
| 188 | + * the level of all non-root loggers to <i>null</i>, |
|
| 189 | + * sets their additivity flag to <i>true</i> and sets the level |
|
| 190 | + * of the root logger to {@link LOGGER_LEVEL_DEBUG}. |
|
| 191 | + * |
|
| 192 | + * <p>Existing loggers are not removed. They are just reset. |
|
| 193 | + * |
|
| 194 | + * <p>This method should be used sparingly and with care as it will |
|
| 195 | + * block all logging until it is completed.</p> |
|
| 196 | + */ |
|
| 197 | + public function resetConfiguration() { |
|
| 198 | + $root = $this->getRootLogger(); |
|
| 199 | 199 | |
| 200 | - $root->setLevel(Payone_Log4php_LoggerLevel::getLevelDebug()); |
|
| 201 | - $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); |
|
| 202 | - $this->shutDown(); |
|
| 200 | + $root->setLevel(Payone_Log4php_LoggerLevel::getLevelDebug()); |
|
| 201 | + $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); |
|
| 202 | + $this->shutDown(); |
|
| 203 | 203 | |
| 204 | - foreach($this->loggers as $logger) { |
|
| 205 | - $logger->setLevel(null); |
|
| 206 | - $logger->setAdditivity(true); |
|
| 207 | - $logger->removeAllAppenders(); |
|
| 208 | - } |
|
| 204 | + foreach($this->loggers as $logger) { |
|
| 205 | + $logger->setLevel(null); |
|
| 206 | + $logger->setAdditivity(true); |
|
| 207 | + $logger->removeAllAppenders(); |
|
| 208 | + } |
|
| 209 | 209 | |
| 210 | - $this->rendererMap->clear(); |
|
| 211 | - Payone_Log4php_LoggerAppenderPool::clear(); |
|
| 212 | - } |
|
| 210 | + $this->rendererMap->clear(); |
|
| 211 | + Payone_Log4php_LoggerAppenderPool::clear(); |
|
| 212 | + } |
|
| 213 | 213 | |
| 214 | - /** |
|
| 215 | - * Sets the main threshold level. |
|
| 216 | - * @param Payone_Log4php_LoggerLevel $l |
|
| 217 | - */ |
|
| 218 | - public function setThreshold(Payone_Log4php_LoggerLevel $threshold) { |
|
| 219 | - $this->threshold = $threshold; |
|
| 220 | - } |
|
| 214 | + /** |
|
| 215 | + * Sets the main threshold level. |
|
| 216 | + * @param Payone_Log4php_LoggerLevel $l |
|
| 217 | + */ |
|
| 218 | + public function setThreshold(Payone_Log4php_LoggerLevel $threshold) { |
|
| 219 | + $this->threshold = $threshold; |
|
| 220 | + } |
|
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * Shutting down a hierarchy will <i>safely</i> close and remove |
|
| 224 | - * all appenders in all loggers including the root logger. |
|
| 225 | - * |
|
| 226 | - * The shutdown method is careful to close nested |
|
| 227 | - * appenders before closing regular appenders. This is allows |
|
| 228 | - * configurations where a regular appender is attached to a logger |
|
| 229 | - * and again to a nested appender. |
|
| 230 | - * |
|
| 231 | - * @todo Check if the last paragraph is correct. |
|
| 232 | - */ |
|
| 233 | - public function shutdown() { |
|
| 234 | - $this->root->removeAllAppenders(); |
|
| 222 | + /** |
|
| 223 | + * Shutting down a hierarchy will <i>safely</i> close and remove |
|
| 224 | + * all appenders in all loggers including the root logger. |
|
| 225 | + * |
|
| 226 | + * The shutdown method is careful to close nested |
|
| 227 | + * appenders before closing regular appenders. This is allows |
|
| 228 | + * configurations where a regular appender is attached to a logger |
|
| 229 | + * and again to a nested appender. |
|
| 230 | + * |
|
| 231 | + * @todo Check if the last paragraph is correct. |
|
| 232 | + */ |
|
| 233 | + public function shutdown() { |
|
| 234 | + $this->root->removeAllAppenders(); |
|
| 235 | 235 | |
| 236 | - foreach($this->loggers as $logger) { |
|
| 237 | - $logger->removeAllAppenders(); |
|
| 238 | - } |
|
| 239 | - } |
|
| 236 | + foreach($this->loggers as $logger) { |
|
| 237 | + $logger->removeAllAppenders(); |
|
| 238 | + } |
|
| 239 | + } |
|
| 240 | 240 | } |
@@ -112,14 +112,14 @@ discard block |
||
| 112 | 112 | * @return Logger Logger instance. |
| 113 | 113 | */ |
| 114 | 114 | public function getLogger($name) { |
| 115 | - if(!isset($this->loggers[$name])) { |
|
| 115 | + if (!isset($this->loggers[$name])) { |
|
| 116 | 116 | $logger = new Payone_Log4php_Logger($name); |
| 117 | 117 | |
| 118 | 118 | $nodes = explode('.', $name); |
| 119 | 119 | $firstNode = array_shift($nodes); |
| 120 | 120 | |
| 121 | 121 | // if name is not a first node but another first node is their |
| 122 | - if($firstNode != $name and isset($this->loggers[$firstNode])) { |
|
| 122 | + if ($firstNode != $name and isset($this->loggers[$firstNode])) { |
|
| 123 | 123 | $logger->setParent($this->loggers[$firstNode]); |
| 124 | 124 | } else { |
| 125 | 125 | // if there is no father, set root logger as father |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // if there are more nodes than one |
| 130 | - if(count($nodes) > 0) { |
|
| 130 | + if (count($nodes) > 0) { |
|
| 131 | 131 | // find parent node |
| 132 | - foreach($nodes as $node) { |
|
| 132 | + foreach ($nodes as $node) { |
|
| 133 | 133 | $parentNode = "$firstNode.$node"; |
| 134 | - if(isset($this->loggers[$parentNode]) and $parentNode != $name) { |
|
| 134 | + if (isset($this->loggers[$parentNode]) and $parentNode != $name) { |
|
| 135 | 135 | $logger->setParent($this->loggers[$parentNode]); |
| 136 | 136 | } |
| 137 | 137 | $firstNode .= ".$node"; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @return Payone_Log4php_LoggerRoot |
| 158 | 158 | */ |
| 159 | 159 | public function getRootLogger() { |
| 160 | - if(!isset($this->root) or $this->root == null) { |
|
| 160 | + if (!isset($this->root) or $this->root == null) { |
|
| 161 | 161 | $this->root = new Payone_Log4php_LoggerRoot(); |
| 162 | 162 | } |
| 163 | 163 | return $this->root; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $this->setThreshold(Payone_Log4php_LoggerLevel::getLevelAll()); |
| 202 | 202 | $this->shutDown(); |
| 203 | 203 | |
| 204 | - foreach($this->loggers as $logger) { |
|
| 204 | + foreach ($this->loggers as $logger) { |
|
| 205 | 205 | $logger->setLevel(null); |
| 206 | 206 | $logger->setAdditivity(true); |
| 207 | 207 | $logger->removeAllAppenders(); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | public function shutdown() { |
| 234 | 234 | $this->root->removeAllAppenders(); |
| 235 | 235 | |
| 236 | - foreach($this->loggers as $logger) { |
|
| 236 | + foreach ($this->loggers as $logger) { |
|
| 237 | 237 | $logger->removeAllAppenders(); |
| 238 | 238 | } |
| 239 | 239 | } |
@@ -41,16 +41,16 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | class Payone_Log4php_LoggerAppenderPhp extends Payone_Log4php_LoggerAppender { |
| 43 | 43 | |
| 44 | - public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 45 | - if($this->layout !== null) { |
|
| 46 | - $level = $event->getLevel(); |
|
| 47 | - if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | - trigger_error($this->layout->format($event), E_USER_ERROR); |
|
| 49 | - } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 50 | - trigger_error($this->layout->format($event), E_USER_WARNING); |
|
| 51 | - } else { |
|
| 52 | - trigger_error($this->layout->format($event), E_USER_NOTICE); |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - } |
|
| 44 | + public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 45 | + if($this->layout !== null) { |
|
| 46 | + $level = $event->getLevel(); |
|
| 47 | + if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | + trigger_error($this->layout->format($event), E_USER_ERROR); |
|
| 49 | + } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 50 | + trigger_error($this->layout->format($event), E_USER_WARNING); |
|
| 51 | + } else { |
|
| 52 | + trigger_error($this->layout->format($event), E_USER_NOTICE); |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -42,9 +42,9 @@ |
||
| 42 | 42 | class Payone_Log4php_LoggerAppenderPhp extends Payone_Log4php_LoggerAppender { |
| 43 | 43 | |
| 44 | 44 | public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
| 45 | - if($this->layout !== null) { |
|
| 45 | + if ($this->layout !== null) { |
|
| 46 | 46 | $level = $event->getLevel(); |
| 47 | - if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 47 | + if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | 48 | trigger_error($this->layout->format($event), E_USER_ERROR); |
| 49 | 49 | } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
| 50 | 50 | trigger_error($this->layout->format($event), E_USER_WARNING); |