Skip to content

Releases: darkfriend/php5-xml

2.0.0

17 Feb 17:08
Compare
Choose a tag to compare

Changelog

  • fixed bugs
  • changed structure xml encode and decode
  • added support duplicates elements
  • added support prolog attributes and additional elements
  • fixed attach elements
  • support encode->decode->encode without changes

Migration to 2.x.x

  • before @cdata, after cdata
  • before @value, after value
  • before @namespace, after namespace

before encode

$array = array(
    'bar' => 'value bar',
    'foo' => 'value foo',
    'der' => array(
        '@cdata' => 'this is long text',
        '@attributes' => array(
            'at1' => 'at1val',
            'at2' => 'at2val',
        ),
    ),
    'qpo' => array(
        'sub1' => array('sub2'=>'val')
    )
);

after encode

$array = [
    'bar' => 'value bar',
    'foo' => 'value foo',
    'der' => [
        'cdata' => 'this is long text',
        '@attributes' => [
            'at1' => 'at1val',
            'at2' => 'at2val',
        ],
    ],
    'qpo' => [
        'value' => [
            'sub1' => [
                'value' => [
                    'sub2'=>'val'
                ]
            ],
        ]
    ]
];

before decode

Array
(
    [bar] => value bar
    [foo] => value foo
    [der] => Array
        (
            [@attributes] => Array
                (
                    [at1] => at1val
                    [at2] => at2val
                )
            [@value] => this is long text
        )
    [qpo] => Array
        (
            [sub1] => Array
                (
                    [sub2] => val
                )
        )
)

after decode

array(4) {
  ["bar"]=>
  array(1) {
    [0]=>
    array(1) {
      ["value"]=>
      string(9) "value bar"
    }
  }
  ["foo"]=>
  array(1) {
    [0]=>
    array(1) {
      ["value"]=>
      string(9) "value foo"
    }
  }
  ["der"]=>
  array(1) {
    [0]=>
    array(2) {
      ["@attributes"]=>
      array(2) {
        ["at1"]=>
        string(6) "at1val"
        ["at2"]=>
        string(6) "at2val"
      }
      ["value"]=>
      string(17) "this is long text"
    }
  }
  ["qpo"]=>
  array(1) {
    [0]=>
    array(1) {
      ["value"]=>
      array(1) {
        ["sub1"]=>
        array(1) {
          [0]=>
          array(1) {
            ["value"]=>
            array(1) {
              ["sub2"]=>
              array(1) {
                [0]=>
                array(1) {
                  ["value"]=>
                  string(3) "val"
                }
              }
            }
          }
        }
      }
    }
  }
}

1.0.2

01 Sep 14:14
Compare
Choose a tag to compare

fixed parse child items

1.0.1

09 Apr 14:03
Compare
Choose a tag to compare
added customize <?xml?>

1.0.0

12 Jan 21:51
Compare
Choose a tag to compare
added Xml helper