Skip to content

Commit

Permalink
Released 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jul 28, 2014
1 parent 425fd50 commit 2cad9c1
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
));
Expand All @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
21 changes: 21 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -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('<html>....');
\HTML5::saveHTML($dom);

After:

use Masterminds\HTML5;
$html5 = new HTML5();
$dom = $html5->loadHTML('<html>....');
echo $html5->saveHTML($dom);


4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
{
"name": "Matt Farina",
"email": "matt@mattfarina.com"
},
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
}
],
"require" : {
Expand Down
4 changes: 2 additions & 2 deletions src/HTML5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down

0 comments on commit 2cad9c1

Please sign in to comment.