Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Commit 7617a91

Browse files
authored
Merge pull request #87 from andreskrey/development
v2.1
2 parents 23f2175 + f351035 commit 7617a91

File tree

127 files changed

+3076
-462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3076
-462
lines changed

.travis.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1-
language: php
1+
language: bash
2+
services: docker
23

3-
before_install:
4-
- apt-cache policy libxml2
4+
env:
5+
matrix:
6+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.9
7+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.8
8+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.7
9+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.6
10+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.5
11+
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.4
12+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.9
13+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.8
14+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.7
15+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.6
16+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.5
17+
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.4
18+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.9
19+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.8
20+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.7
21+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.6
22+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.5
23+
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.4
24+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.9
25+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.8
26+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.7
27+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.6
28+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.5
29+
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.4
530

6-
install:
7-
- composer install
31+
matrix:
32+
allow_failures:
33+
- env: LIBXML_VERSION=2.9.9
34+
- env: LIBXML_VERSION=2.9.8
35+
- env: LIBXML_VERSION=2.9.7
36+
- env: LIBXML_VERSION=2.9.6
37+
- env: LIBXML_VERSION=2.9.5
838

9-
php:
10-
- "7.0"
11-
- "7.1"
12-
- "7.2"
13-
- "7.3"
39+
install:
40+
- docker run --rm --volume $PWD:/app --workdir="/app" composer install
1441

1542
script:
16-
- ./vendor/bin/phpunit --coverage-clover ./test/clover.xml
43+
- docker build --build-arg PHP_VERSION=${PHP_VERSION} --build-arg LIBXML_VERSION=${LIBXML_VERSION} -t travis-build - < ./docker/php/Dockerfile
44+
- docker run --volume $PWD:/app --workdir="/app" travis-build php ./vendor/bin/phpunit --coverage-clover /app/test/clover.xml
1745

1846
after_script:
19-
- composer require php-coveralls/php-coveralls:^2.0
20-
- php ./vendor/php-coveralls/php-coveralls/bin/php-coveralls -v
47+
- docker run --volume $PWD:/app --workdir="/app" composer require php-coveralls/php-coveralls:^2.0
48+
- docker run --volume $PWD:/app --workdir="/app" --env TRAVIS=${TRAVIS} --env TRAVIS_JOB_ID=${TRAVIS_JOB_ID} travis-build php ./vendor/php-coveralls/php-coveralls/bin/php-coveralls -v

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ The AUTHORS/Contributors are (and/or have been):
1010
* Andres Rey
1111
* Sergiy Lavryk
1212
* Pedro Amorim
13+
* Malu Decks

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.
33

44
## Unreleased
55

6+
## [v2.1.0](https://github.com/andreskrey/readability.php/releases/tag/v2.1.0)
7+
- Avoid overwriting extracted metadata with similarly named keys (like `og:image` and `og:image:width`)
8+
- Imported new `getSiteName()` feature from JS version as of [21 Dec 2018](https://github.com/mozilla/readability/pull/504)
9+
- Added getFirstElementChild function to NodeTrait + test case (Issue #83)
10+
- Reworked the test suit to use TestPage objects and give more hints about what failed
11+
- Removed getWordThreshold and setWordThreshold configuration functions
12+
- Added NodeUtility::filterTextNodes and deprecated NodeTrait getChildren()
13+
- Added new DOMNodeList fake class that mimics the original DOMNodeList class but allows to add new nodes to the list
14+
- Added new Dockerfiles that pulls different versions of PHP and libxml. Now we are supporting 4 versions of PHP and 6 versions of libxml!
15+
16+
## [v2.0.1](https://github.com/andreskrey/readability.php/releases/tag/v2.0.1)
17+
- Fixed small issue that prevented the main image from showing up in the results
18+
619
## [v2.0.0](https://github.com/andreskrey/readability.php/releases/tag/v2.0.0)
720

821
- [BREAKING CHANGE] Bumped the minimum supported version of PHP to 7.0
@@ -35,7 +48,7 @@ All notable changes to this project will be documented in this file.
3548

3649
## [v1.1.1](https://github.com/andreskrey/readability.php/releases/tag/v1.1.1)
3750

38-
- Switched from assertEquals to assertSame on unit testing to avoid weak comparisons.
51+
- Switched from assertEquals to assertSame on unit testing to avoid weak comparisons.
3952
- Added a safe check to avoid sending the DOMDocument as a node when scanning for node ancestors.
4053
- Fix issue #45: Small mistake in documentation
4154
- Fix issue #46: Added `data-src` as a image source path
@@ -64,7 +77,7 @@ All notable changes to this project will be documented in this file.
6477

6578
- Trim titles when detecting hierarchical separators to avoid false negatives on strings with spaces.
6679
- Fix issue when converting divs to p nodes and never rating them (issue #29)
67-
- Fix "Unsupported operand types" (PR #31)
80+
- Fix "Unsupported operand types" (PR #31)
6881
- Fix division by zero when no title was found (issue #32)
6982
- New function to retrieve all images at once (PR #30)
7083
- Get the title from the `<title>` tag before searching on the `<meta>` tags
@@ -127,6 +140,6 @@ We are getting closer to be a 100% complete port of Readability.js!
127140

128141
## [0.0.2-alpha](https://github.com/andreskrey/readability.php/releases/tag/v0.0.2-alpha)
129142
- Last version I'm using master as the main development branch. All unreleased changes and main development will happen in the develop branch.
130-
143+
131144
## [0.0.1-alpha](https://github.com/andreskrey/readability.php/releases/tag/v0.0.1-alpha)
132145
- Initial release

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/andresk
2323
## Running Tests
2424

2525
``` bash
26-
$ ./vendor/bin/phpunit
26+
$ make test-all #requires docker and docker-compose
2727
```
2828

2929

Makefile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1-
.PHONY: test-all test-7.2 test-7.1 test-7.0
1+
.PHONY: test-all
22

3-
test-all: start test-7.2 test-7.1 test-7.0
3+
test-all: start test-7.3 test-7.2 test-7.1 test-7.0 stop
4+
5+
test-7.3:
6+
docker-compose exec php-7.3-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
47

58
test-7.2:
6-
docker-compose exec php-7.2 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
9+
docker-compose exec php-7.2-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
710

811
test-7.1:
9-
docker-compose exec php-7.1 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
12+
docker-compose exec php-7.1-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
1013

1114
test-7.0:
12-
docker-compose exec php-7.0 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
15+
docker-compose exec php-7.0-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
1316

1417
start:
15-
docker-compose up -d
18+
docker-compose up -d php-7.3-libxml-2.9.9 php-7.2-libxml-2.9.9 php-7.1-libxml-2.9.9 php-7.0-libxml-2.9.9
19+
20+
stop:
21+
docker-compose stop
22+
23+
test-all-versions:
24+
for php_version in 7.0 7.1 7.2 7.3; do \
25+
for libxml_version in 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9; do \
26+
docker-compose up -d php-$$php_version-libxml-$$libxml_version; \
27+
docker-compose exec php-$$php_version-libxml-$$libxml_version php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml; \
28+
done \
29+
done
30+
docker-compose stop

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"andreskrey\\Readability\\": "src/"
1818
}
1919
},
20+
"autoload-dev": {
21+
"psr-4": {"andreskrey\\Readability\\Test\\": "test"}
22+
},
2023
"require": {
2124
"php": ">=7.0.0",
2225
"ext-dom": "*",

docker-compose.yml

Lines changed: 188 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,196 @@
11
version: '3'
22

33
services:
4-
php-7.0:
5-
build: ./docker/php-7.0
4+
php-7.0-libxml-2.9.4: &template
5+
build:
6+
context: ./docker/php
7+
args:
8+
LIBXML_VERSION: 2.9.4
9+
PHP_VERSION: 7.0
610
volumes:
711
- ./:/app
812
tty: true
913

10-
php-7.1:
11-
build: ./docker/php-7.1
12-
volumes:
13-
- ./:/app
14-
tty: true
14+
php-7.0-libxml-2.9.5:
15+
<<: *template
16+
build:
17+
context: ./docker/php
18+
args:
19+
LIBXML_VERSION: 2.9.5
20+
PHP_VERSION: 7.0
1521

16-
php-7.2:
17-
build: ./docker/php-7.2
18-
volumes:
19-
- ./:/app
20-
tty: true
22+
php-7.0-libxml-2.9.6:
23+
<<: *template
24+
build:
25+
context: ./docker/php
26+
args:
27+
LIBXML_VERSION: 2.9.6
28+
PHP_VERSION: 7.0
29+
30+
php-7.0-libxml-2.9.7:
31+
<<: *template
32+
build:
33+
context: ./docker/php
34+
args:
35+
LIBXML_VERSION: 2.9.7
36+
PHP_VERSION: 7.0
37+
38+
php-7.0-libxml-2.9.8:
39+
<<: *template
40+
build:
41+
context: ./docker/php
42+
args:
43+
LIBXML_VERSION: 2.9.8
44+
PHP_VERSION: 7.0
45+
46+
php-7.0-libxml-2.9.9:
47+
<<: *template
48+
build:
49+
context: ./docker/php
50+
args:
51+
LIBXML_VERSION: 2.9.9
52+
PHP_VERSION: 7.0
53+
54+
php-7.1-libxml-2.9.4:
55+
<<: *template
56+
build:
57+
context: ./docker/php
58+
args:
59+
LIBXML_VERSION: 2.9.4
60+
PHP_VERSION: 7.1
61+
62+
php-7.1-libxml-2.9.5:
63+
<<: *template
64+
build:
65+
context: ./docker/php
66+
args:
67+
LIBXML_VERSION: 2.9.5
68+
PHP_VERSION: 7.1
69+
70+
php-7.1-libxml-2.9.6:
71+
<<: *template
72+
build:
73+
context: ./docker/php
74+
args:
75+
LIBXML_VERSION: 2.9.6
76+
PHP_VERSION: 7.1
77+
78+
php-7.1-libxml-2.9.7:
79+
<<: *template
80+
build:
81+
context: ./docker/php
82+
args:
83+
LIBXML_VERSION: 2.9.7
84+
PHP_VERSION: 7.1
85+
86+
php-7.1-libxml-2.9.8:
87+
<<: *template
88+
build:
89+
context: ./docker/php
90+
args:
91+
LIBXML_VERSION: 2.9.8
92+
PHP_VERSION: 7.1
93+
94+
php-7.1-libxml-2.9.9:
95+
<<: *template
96+
build:
97+
context: ./docker/php
98+
args:
99+
LIBXML_VERSION: 2.9.9
100+
PHP_VERSION: 7.1
101+
102+
php-7.2-libxml-2.9.4:
103+
<<: *template
104+
build:
105+
context: ./docker/php
106+
args:
107+
LIBXML_VERSION: 2.9.4
108+
PHP_VERSION: 7.2
109+
110+
php-7.2-libxml-2.9.5:
111+
<<: *template
112+
build:
113+
context: ./docker/php
114+
args:
115+
LIBXML_VERSION: 2.9.5
116+
PHP_VERSION: 7.2
117+
118+
php-7.2-libxml-2.9.6:
119+
<<: *template
120+
build:
121+
context: ./docker/php
122+
args:
123+
LIBXML_VERSION: 2.9.6
124+
PHP_VERSION: 7.2
125+
126+
php-7.2-libxml-2.9.7:
127+
<<: *template
128+
build:
129+
context: ./docker/php
130+
args:
131+
LIBXML_VERSION: 2.9.7
132+
PHP_VERSION: 7.2
133+
134+
php-7.2-libxml-2.9.8:
135+
<<: *template
136+
build:
137+
context: ./docker/php
138+
args:
139+
LIBXML_VERSION: 2.9.8
140+
PHP_VERSION: 7.2
141+
142+
php-7.2-libxml-2.9.9:
143+
<<: *template
144+
build:
145+
context: ./docker/php
146+
args:
147+
LIBXML_VERSION: 2.9.9
148+
PHP_VERSION: 7.2
149+
150+
php-7.3-libxml-2.9.4:
151+
<<: *template
152+
build:
153+
context: ./docker/php
154+
args:
155+
LIBXML_VERSION: 2.9.4
156+
PHP_VERSION: 7.3
157+
158+
php-7.3-libxml-2.9.5:
159+
<<: *template
160+
build:
161+
context: ./docker/php
162+
args:
163+
LIBXML_VERSION: 2.9.5
164+
PHP_VERSION: 7.3
165+
166+
php-7.3-libxml-2.9.6:
167+
<<: *template
168+
build:
169+
context: ./docker/php
170+
args:
171+
LIBXML_VERSION: 2.9.6
172+
PHP_VERSION: 7.3
173+
174+
php-7.3-libxml-2.9.7:
175+
<<: *template
176+
build:
177+
context: ./docker/php
178+
args:
179+
LIBXML_VERSION: 2.9.7
180+
PHP_VERSION: 7.3
181+
182+
php-7.3-libxml-2.9.8:
183+
<<: *template
184+
build:
185+
context: ./docker/php
186+
args:
187+
LIBXML_VERSION: 2.9.8
188+
PHP_VERSION: 7.3
189+
190+
php-7.3-libxml-2.9.9:
191+
<<: *template
192+
build:
193+
context: ./docker/php
194+
args:
195+
LIBXML_VERSION: 2.9.9
196+
PHP_VERSION: 7.3

docker/php-7.0/Dockerfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker/php-7.1/Dockerfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker/php-7.2/Dockerfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)