2017-04-05 23:37:26 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Extends the Zend Config XML library to allow attribute handling.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Xml;
|
|
|
|
|
2020-01-18 02:35:09 +00:00
|
|
|
use Laminas\Config\Reader\Xml;
|
2019-09-04 18:00:51 +00:00
|
|
|
|
2017-04-05 23:37:26 +00:00
|
|
|
/**
|
|
|
|
* XML config reader.
|
|
|
|
*/
|
2019-09-04 18:00:51 +00:00
|
|
|
class Reader extends Xml
|
2017-04-05 23:37:26 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get all attributes on the current node.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function getAttributes()
|
|
|
|
{
|
|
|
|
$attributes = [];
|
|
|
|
|
|
|
|
if ($this->reader->hasAttributes) {
|
|
|
|
while ($this->reader->moveToNextAttribute()) {
|
|
|
|
$attributes['@' . $this->reader->localName] = $this->reader->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->reader->moveToElement();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $attributes;
|
|
|
|
}
|
2019-09-04 18:00:51 +00:00
|
|
|
}
|