Skip to content

Commit bf98f69

Browse files
committed
patch lib"
0 parents  commit bf98f69

File tree

5 files changed

+1844
-0
lines changed

5 files changed

+1844
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.idea
2+
/.vscode

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
php-simple-html-dom-parser
2+
==========================
3+
4+
Version 1.5.2
5+
6+
Adaptation for Composer and PSR-0 of:
7+
8+
A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
9+
Require PHP 5+.
10+
Supports invalid HTML.
11+
Find tags on an HTML page with selectors just like jQuery.
12+
Extract contents from HTML in a single line.
13+
14+
Fixed for php 7+
15+
16+
http://simplehtmldom.sourceforge.net/
17+
18+
19+
Install
20+
-------
21+
22+
composer.phar
23+
```json
24+
"require": {
25+
"enemis/php-simple-html-dom-parser": "1.5.2"
26+
}
27+
```
28+
29+
Usage
30+
-----
31+
32+
```php
33+
use Enemis\PhpSimpleHtmlDom;
34+
35+
...
36+
$dom = HtmlDomParser::str_get_html( $str );
37+
or
38+
$dom = HtmlDomParser::file_get_html( $file_name );
39+
40+
$elems = $dom->find($elem_name);
41+
...
42+
43+
```

composer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "enemis/php-simple-html-dom",
3+
"type": "library",
4+
"description": "A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Adapted to PHP 7+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.",
5+
"keywords": ["html", "dom", "parser"],
6+
"homepage": "https://github.com/enemis/php-simple-html-dom",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "S.C. Chen",
11+
"homepage": "http://sourceforge.net/projects/simplehtmldom/"
12+
},
13+
{
14+
"name": "Enemis",
15+
"email": "stadnikandreypublic@gmail.com",
16+
"homepage": "https://github.com/enemis"
17+
}
18+
],
19+
"require": {
20+
"php": ">=7.0",
21+
"ext-mbstring": "*"
22+
},
23+
"autoload": {
24+
"psr-0": { "Enemis\\PhpSimpleHtmlDom": "src/" }
25+
}
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Enemis\PhpSimpleHtmlDom;
4+
5+
require 'simplehtmldom_1_5' . DIRECTORY_SEPARATOR . 'simple_html_dom.php';
6+
7+
class HtmlDomParser {
8+
9+
/**
10+
* @return \simplehtmldom_1_5\simple_html_dom
11+
*/
12+
static public function file_get_html() {
13+
return call_user_func_array ( '\simplehtmldom_1_5\file_get_html' , func_get_args() );
14+
}
15+
16+
/**
17+
* get html dom from string
18+
* @return \simplehtmldom_1_5\simple_html_dom
19+
*/
20+
static public function str_get_html() {
21+
return call_user_func_array ( '\simplehtmldom_1_5\str_get_html' , func_get_args() );
22+
}
23+
}

0 commit comments

Comments
 (0)