diff --git a/README.md b/README.md index 5732748..65d6889 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ But after some initial refactoring work, we began a new parser. - Event-based (SAX-like) parser - DOM tree builder - Interoperability with QueryPath [[in progress](https://github.com/technosophos/querypath/issues/114)] +- Runs on **PHP** 5.3.0 or newer and **HHVM** 3.2 or newer [![Build Status](https://travis-ci.org/Masterminds/html5-php.png?branch=master)](https://travis-ci.org/Masterminds/html5-php) [![Latest Stable Version](https://poser.pugx.org/masterminds/html5/v/stable.png)](https://packagist.org/packages/masterminds/html5) [![Coverage Status](https://coveralls.io/repos/Masterminds/html5-php/badge.png?branch=master)](https://coveralls.io/r/Masterminds/html5-php?branch=master) @@ -22,12 +23,12 @@ To install, add `masterminds/html5` to your `composer.json` file: ``` { "require" : { - "masterminds/html5": "1.*" + "masterminds/html5": "2.*" }, } ``` -(You may substitute `1.*` for a more specific release tag, of +(You may substitute `2.*` for a more specific release tag, of course.) From there, use the `composer install` or `composer update` commands to @@ -118,7 +119,7 @@ different rule sets to be used. - The `Traverser`, which is a special-purpose tree walker. It visits each node node in the tree and uses the `OutputRules` to transform the node into a string. -- `\HTML5` manages the `Traverser` and stores the resultant data +- `HTML5` manages the `Traverser` and stores the resultant data in the correct place. The serializer (`save()`, `saveHTML()`) follows the @@ -171,6 +172,7 @@ issues known issues that are not presently on the roadmap: To use XML style namespaces you have to configure well the main `HTML5` instance. ```php +use Masterminds\HTML5; $html = new HTML5(array( "xmlNamespaces" => true )); @@ -185,6 +187,7 @@ You can also add some default prefixes that will not require the namespace decla but it's elements will be namespaced. ```php +use Masterminds\HTML5; $html = new HTML5(array( "implicitNamespaces"=>array( "t"=>"http://www.example.com" diff --git a/RELEASE.md b/RELEASE.md index ea8eb7e..c531d7b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,12 @@ # Release Notes +2.0.0 (2014-07-28) +- #53: Improved boolean attributes handling +- #52: Facebook HHVM compatibility +- #48: Adopted PSR-2 as coding standard +- #47: Moved everything to Masterminds namespace +- #45: Added custom namespaces +- #44: Added support to XML-style namespaces +- #37: Refactored HTML5 class removing static methods 1.0.5 (2014-06-10) - #38: Set the dev-master branch as the 1.0.x branch for composer (goetas) diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..76e3a19 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,21 @@ +From 1.x to 2.x +================= + +- All classes uses `Masterminds` namespace. +- All public static methods has been removed from `HTML5` class and the general API to access the HTML5 functionalities has changed. + + Before: + + $dom = \HTML5::loadHTML('....'); + \HTML5::saveHTML($dom); + + After: + + use Masterminds\HTML5; + + $html5 = new HTML5(); + + $dom = $html5->loadHTML('....'); + echo $html5->saveHTML($dom); + + diff --git a/composer.json b/composer.json index 00b868f..a14d5c6 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,10 @@ { "name": "Matt Farina", "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" } ], "require" : { diff --git a/src/HTML5.php b/src/HTML5.php index 0b2d368..2585fd4 100644 --- a/src/HTML5.php +++ b/src/HTML5.php @@ -24,12 +24,12 @@ class HTML5 * * @var array */ - private $options = array( + protected $options = array( // If the serializer should encode all entities. 'encode_entities' => false ); - private $errors = array(); + protected $errors = array(); public function __construct(array $options = array()) {