Skip to content

Commit 2cad9c1

Browse files
committed
Released 2.0.0
1 parent 425fd50 commit 2cad9c1

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ But after some initial refactoring work, we began a new parser.
1010
- Event-based (SAX-like) parser
1111
- DOM tree builder
1212
- Interoperability with QueryPath [[in progress](https://github.com/technosophos/querypath/issues/114)]
13+
- Runs on **PHP** 5.3.0 or newer and **HHVM** 3.2 or newer
1314

1415
[![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)
1516

@@ -22,12 +23,12 @@ To install, add `masterminds/html5` to your `composer.json` file:
2223
```
2324
{
2425
"require" : {
25-
"masterminds/html5": "1.*"
26+
"masterminds/html5": "2.*"
2627
},
2728
}
2829
```
2930

30-
(You may substitute `1.*` for a more specific release tag, of
31+
(You may substitute `2.*` for a more specific release tag, of
3132
course.)
3233

3334
From there, use the `composer install` or `composer update` commands to
@@ -118,7 +119,7 @@ different rule sets to be used.
118119
- The `Traverser`, which is a special-purpose tree walker. It visits
119120
each node node in the tree and uses the `OutputRules` to transform the node
120121
into a string.
121-
- `\HTML5` manages the `Traverser` and stores the resultant data
122+
- `HTML5` manages the `Traverser` and stores the resultant data
122123
in the correct place.
123124

124125
The serializer (`save()`, `saveHTML()`) follows the
@@ -171,6 +172,7 @@ issues known issues that are not presently on the roadmap:
171172
To use XML style namespaces you have to configure well the main `HTML5` instance.
172173

173174
```php
175+
use Masterminds\HTML5;
174176
$html = new HTML5(array(
175177
"xmlNamespaces" => true
176178
));
@@ -185,6 +187,7 @@ You can also add some default prefixes that will not require the namespace decla
185187
but it's elements will be namespaced.
186188

187189
```php
190+
use Masterminds\HTML5;
188191
$html = new HTML5(array(
189192
"implicitNamespaces"=>array(
190193
"t"=>"http://www.example.com"

RELEASE.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Release Notes
2+
2.0.0 (2014-07-28)
3+
- #53: Improved boolean attributes handling
4+
- #52: Facebook HHVM compatibility
5+
- #48: Adopted PSR-2 as coding standard
6+
- #47: Moved everything to Masterminds namespace
7+
- #45: Added custom namespaces
8+
- #44: Added support to XML-style namespaces
9+
- #37: Refactored HTML5 class removing static methods
210

311
1.0.5 (2014-06-10)
412
- #38: Set the dev-master branch as the 1.0.x branch for composer (goetas)

UPGRADING.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
From 1.x to 2.x
2+
=================
3+
4+
- All classes uses `Masterminds` namespace.
5+
- All public static methods has been removed from `HTML5` class and the general API to access the HTML5 functionalities has changed.
6+
7+
Before:
8+
9+
$dom = \HTML5::loadHTML('<html>....');
10+
\HTML5::saveHTML($dom);
11+
12+
After:
13+
14+
use Masterminds\HTML5;
15+
16+
$html5 = new HTML5();
17+
18+
$dom = $html5->loadHTML('<html>....');
19+
echo $html5->saveHTML($dom);
20+
21+

composer.json

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
{
1414
"name": "Matt Farina",
1515
"email": "[email protected]"
16+
},
17+
{
18+
"name": "Asmir Mustafic",
19+
"email": "[email protected]"
1620
}
1721
],
1822
"require" : {

src/HTML5.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ class HTML5
2424
*
2525
* @var array
2626
*/
27-
private $options = array(
27+
protected $options = array(
2828
// If the serializer should encode all entities.
2929
'encode_entities' => false
3030
);
3131

32-
private $errors = array();
32+
protected $errors = array();
3333

3434
public function __construct(array $options = array())
3535
{

0 commit comments

Comments
 (0)