Skip to content

Commit a01596a

Browse files
authored
psr-4 upgrade (#3)
* psr-4 upgrade * updated readme
1 parent 1cf3e2a commit a01596a

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
php-simple
22
==========================
33

4-
Version 1.0.0
4+
Version 1.0.4
55

6-
Adaptation for Composer and PSR-0 of:
6+
PSR-4 compatible
77

88
Updated version of the simplehtmldom for php 7.3+.
99

@@ -27,7 +27,7 @@ Usage
2727
-----
2828

2929
```php
30-
use Eddieace\PhpSimple\;
30+
use Eddieace\PhpSimple\HtmlDomParser;
3131

3232
...
3333
$dom = HtmlDomParser::str_get_html( $str );
@@ -36,5 +36,16 @@ $dom = HtmlDomParser::file_get_html( $file_name );
3636

3737
$elems = $dom->find($elem_name);
3838
...
39+
```
40+
Example
41+
-----
42+
```php
43+
use Eddieace\PhpSimple\HtmlDomParser;
3944

40-
```
45+
$html = HtmlDomParser::file_get_html("http://example.com/");
46+
$results = $html->find('h1');
47+
echo $results[0]->plaintext;
48+
49+
//output : Example Domain
50+
51+
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"ext-mbstring": "*"
1515
},
1616
"autoload": {
17-
"psr-0": { "Eddieace\\PhpSimple\\HtmlDomParser": "src/" }
17+
"psr-4": { "Eddieace\\PhpSimple\\": "src/" }
1818
}
1919
}

0 commit comments

Comments
 (0)