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

Commit

Permalink
Merge pull request #87 from andreskrey/development
Browse files Browse the repository at this point in the history
v2.1
  • Loading branch information
andreskrey authored Jul 22, 2019
2 parents 23f2175 + f351035 commit 7617a91
Show file tree
Hide file tree
Showing 127 changed files with 3,076 additions and 462 deletions.
54 changes: 41 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
language: php
language: bash
services: docker

before_install:
- apt-cache policy libxml2
env:
matrix:
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.9
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.8
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.7
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.6
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.5
- PHP_VERSION=7.3 LIBXML_VERSION=2.9.4
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.9
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.8
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.7
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.6
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.5
- PHP_VERSION=7.2 LIBXML_VERSION=2.9.4
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.9
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.8
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.7
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.6
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.5
- PHP_VERSION=7.1 LIBXML_VERSION=2.9.4
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.9
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.8
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.7
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.6
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.5
- PHP_VERSION=7.0 LIBXML_VERSION=2.9.4

install:
- composer install
matrix:
allow_failures:
- env: LIBXML_VERSION=2.9.9
- env: LIBXML_VERSION=2.9.8
- env: LIBXML_VERSION=2.9.7
- env: LIBXML_VERSION=2.9.6
- env: LIBXML_VERSION=2.9.5

php:
- "7.0"
- "7.1"
- "7.2"
- "7.3"
install:
- docker run --rm --volume $PWD:/app --workdir="/app" composer install

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

after_script:
- composer require php-coveralls/php-coveralls:^2.0
- php ./vendor/php-coveralls/php-coveralls/bin/php-coveralls -v
- docker run --volume $PWD:/app --workdir="/app" composer require php-coveralls/php-coveralls:^2.0
- 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
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ The AUTHORS/Contributors are (and/or have been):
* Andres Rey
* Sergiy Lavryk
* Pedro Amorim
* Malu Decks
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.

## Unreleased

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

## [v2.0.1](https://github.com/andreskrey/readability.php/releases/tag/v2.0.1)
- Fixed small issue that prevented the main image from showing up in the results

## [v2.0.0](https://github.com/andreskrey/readability.php/releases/tag/v2.0.0)

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

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

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

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

## [0.0.2-alpha](https://github.com/andreskrey/readability.php/releases/tag/v0.0.2-alpha)
- Last version I'm using master as the main development branch. All unreleased changes and main development will happen in the develop branch.

## [0.0.1-alpha](https://github.com/andreskrey/readability.php/releases/tag/v0.0.1-alpha)
- Initial release
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/andresk
## Running Tests

``` bash
$ ./vendor/bin/phpunit
$ make test-all #requires docker and docker-compose
```


Expand Down
27 changes: 21 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
.PHONY: test-all test-7.2 test-7.1 test-7.0
.PHONY: test-all

test-all: start test-7.2 test-7.1 test-7.0
test-all: start test-7.3 test-7.2 test-7.1 test-7.0 stop

test-7.3:
docker-compose exec php-7.3-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml

test-7.2:
docker-compose exec php-7.2 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
docker-compose exec php-7.2-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml

test-7.1:
docker-compose exec php-7.1 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
docker-compose exec php-7.1-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml

test-7.0:
docker-compose exec php-7.0 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml
docker-compose exec php-7.0-libxml-2.9.9 php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml

start:
docker-compose up -d
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

stop:
docker-compose stop

test-all-versions:
for php_version in 7.0 7.1 7.2 7.3; do \
for libxml_version in 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9; do \
docker-compose up -d php-$$php_version-libxml-$$libxml_version; \
docker-compose exec php-$$php_version-libxml-$$libxml_version php /app/vendor/phpunit/phpunit/phpunit --configuration /app/phpunit.xml; \
done \
done
docker-compose stop
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"andreskrey\\Readability\\": "src/"
}
},
"autoload-dev": {
"psr-4": {"andreskrey\\Readability\\Test\\": "test"}
},
"require": {
"php": ">=7.0.0",
"ext-dom": "*",
Expand Down
200 changes: 188 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,196 @@
version: '3'

services:
php-7.0:
build: ./docker/php-7.0
php-7.0-libxml-2.9.4: &template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.4
PHP_VERSION: 7.0
volumes:
- ./:/app
tty: true

php-7.1:
build: ./docker/php-7.1
volumes:
- ./:/app
tty: true
php-7.0-libxml-2.9.5:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.5
PHP_VERSION: 7.0

php-7.2:
build: ./docker/php-7.2
volumes:
- ./:/app
tty: true
php-7.0-libxml-2.9.6:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.6
PHP_VERSION: 7.0

php-7.0-libxml-2.9.7:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.7
PHP_VERSION: 7.0

php-7.0-libxml-2.9.8:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.8
PHP_VERSION: 7.0

php-7.0-libxml-2.9.9:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.9
PHP_VERSION: 7.0

php-7.1-libxml-2.9.4:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.4
PHP_VERSION: 7.1

php-7.1-libxml-2.9.5:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.5
PHP_VERSION: 7.1

php-7.1-libxml-2.9.6:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.6
PHP_VERSION: 7.1

php-7.1-libxml-2.9.7:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.7
PHP_VERSION: 7.1

php-7.1-libxml-2.9.8:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.8
PHP_VERSION: 7.1

php-7.1-libxml-2.9.9:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.9
PHP_VERSION: 7.1

php-7.2-libxml-2.9.4:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.4
PHP_VERSION: 7.2

php-7.2-libxml-2.9.5:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.5
PHP_VERSION: 7.2

php-7.2-libxml-2.9.6:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.6
PHP_VERSION: 7.2

php-7.2-libxml-2.9.7:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.7
PHP_VERSION: 7.2

php-7.2-libxml-2.9.8:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.8
PHP_VERSION: 7.2

php-7.2-libxml-2.9.9:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.9
PHP_VERSION: 7.2

php-7.3-libxml-2.9.4:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.4
PHP_VERSION: 7.3

php-7.3-libxml-2.9.5:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.5
PHP_VERSION: 7.3

php-7.3-libxml-2.9.6:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.6
PHP_VERSION: 7.3

php-7.3-libxml-2.9.7:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.7
PHP_VERSION: 7.3

php-7.3-libxml-2.9.8:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.8
PHP_VERSION: 7.3

php-7.3-libxml-2.9.9:
<<: *template
build:
context: ./docker/php
args:
LIBXML_VERSION: 2.9.9
PHP_VERSION: 7.3
2 changes: 0 additions & 2 deletions docker/php-7.0/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions docker/php-7.1/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions docker/php-7.2/Dockerfile

This file was deleted.

8 changes: 8 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG PHP_VERSION
ARG LIBXML_VERSION
FROM andreskrey/php-${PHP_VERSION}:libxml-${LIBXML_VERSION}

RUN pecl install xdebug && docker-php-ext-enable xdebug

# Required by coveralls
RUN apt-get install git -y
Loading

0 comments on commit 7617a91

Please sign in to comment.