PHP Classes

File: source/FluidXml.php

Recommend this page to a friend!
  Classes of Daniele Orlando   FluidXML   source/FluidXml.php  
File: source/FluidXml.php
Role: Class source
Content type: text/plain
Description: Class source
Class: FluidXML
Manipulate XML documents using a fluent interface
Author: By
Last change: Internal refactoring.
1.20 pre release.
Initial CSS support for queries.
The biggest commit since the 1.0 release.

This is a major step forward breaking compatibility with the past.
Under the hood there is a general reorganization to be PSR-0/4 compliant,
a general cleanup of the API names for being consistent and allowing future
clean APIs growth, some notable additions like the ->filter() method to
programmatically filter the query results and ->html() to output the document
as valid HTML 5 string.

[+] New:
* ->html() is part of the family.
* ->filter() is part of the family.
* ->comment() is part of the family.
* ->setComment() is part of the family.
* ->addComment() is part of the family.
* ->size() is an alias of ->length().
* ->__invoke() is an alias of ->query().
* ->__toString() is an alias of ->xml().
* ->array() replaces ->asArray().
* ->addChild() replaces ->appendChild().
* ->addText() replaces ->appendText().
* ->addCdata() replaces ->appendCdata().

[~] Changed:
* fluidxml() has gained the super powers of fluidify().
* FluidXml->__construct() has gained the super powers of FluidXml::load().
* ::load()/fluidify() can be ONLY used to load an XML file.

[-] Removed:
* ->asArray() has been removed superseded by ->array().
* ->appendText() has been removed superseded by ->addText().
* ->appendCdata() has been removed superseded by ->addCdata().
* ->appendChild() has been removed superseded by ->addChild().
* ->insertSiblingBefore() has been removed superseded by ->prependSibling().
* ->insertSiblingAfter() has been removed superseded by ->appendSibling().

[@] Internal:
* PSR-0/4 compliance.
* FluidXml.php is still there for people not using Composer/PSR-0/4 loaders.
Introduces the '->save()' method.

* [+] ->save() is part of the family.
Coveralls integration.
Internal cleanup.

* [@] cleanup.
Internal cleanup and code coverage completion.
->each() and ->times() refactoring.
Extrapolation of the insertion handler from FluidContext.
Optimizations.
Internal refactoring and performance regression fix.

* [@] internal refactoring. Performances are normal.
Optimizations.
Speedtest is more balanced.
Replacing call_user_func because slower than direct closure call.
InsertionHandler cleanups.
Reverts to a monolithic insertion handler.
handleInsertion static.
handleInsertion refactoring trying to fix the performance regression.
Optimizations.
FluidContext refactoring.
Internal cleanup after Scrutinizer analysis.
'->times()' and '->each()' are bound to the context. $this behaves as expected.

* [@] internal refactoring. Performances are worst but code is much better.
Arguments are not passed by reference for the insertion handlers.
InsertionHandler merge back to FluidContext.
Small aesthetic fixes.
Closure-less insertion operations.
Static refactoring of the InsertionHandler.
Oracle abortion. Too performance expensive.
Element insertion logic initial refactoring.
Handling of methods with reserved names is unified using PHP magic methods.
Date: 8 years ago
Size: 2,763 bytes

You need to be a registered user and login to get this file.

1,615,206 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on: