Compare commits
18 Commits
master
...
develop_v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2111659914 | ||
|
|
c28cbd7f08 | ||
|
|
087628de5f | ||
|
|
6d501332f3 | ||
|
|
bf52f2d058 | ||
|
|
711fcdeef7 | ||
|
|
590a8b7ef2 | ||
|
|
9914f3d295 | ||
|
|
847520f380 | ||
|
|
b54f39169e | ||
|
|
8d92409bfe | ||
|
|
06a92710f6 | ||
|
|
5bc9250ccc | ||
|
|
2a8a32e704 | ||
|
|
2968370bd1 | ||
|
|
6e00210f9a | ||
|
|
b54200e5d8 | ||
|
|
33f1619d0f |
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10,6 +10,7 @@
|
|||||||
# git files
|
# git files
|
||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.gitattributes export-ignore
|
/.gitattributes export-ignore
|
||||||
|
/.github export-ignore
|
||||||
|
|
||||||
# project directories
|
# project directories
|
||||||
/build export-ignore
|
/build export-ignore
|
||||||
|
|||||||
64
.travis.yml
Normal file
64
.travis.yml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
language: php
|
||||||
|
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
|
php:
|
||||||
|
- 7.1
|
||||||
|
- 7.2
|
||||||
|
- 7.3
|
||||||
|
- 7.4
|
||||||
|
- nightly
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- php: 7.2
|
||||||
|
env: COVERAGE=1
|
||||||
|
- php: nightly
|
||||||
|
env: DEPENDENCIES="--ignore-platform-reqs"
|
||||||
|
exclude:
|
||||||
|
- php: 7.2
|
||||||
|
- php: nightly
|
||||||
|
allow_failures:
|
||||||
|
- php: 7.4 #needs an update on dompdf
|
||||||
|
- php: nightly
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.composer/cache
|
||||||
|
- .php-cs.cache
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: "Sq+6bVtnPsu0mWX8DWQ+9bGAjxMcGorksUiHc4YIXEJsuDfVmVlH8tTD547IeCjDAx9MxXerZ2Z4HSjxTB70VEnJPvZMHI/EZn4Ny31YLHEthdZbV5Gd1h0TGp8VOzPKGShvGrtGBX6MvMfgpK4zuieVWbSfdKeecm8ZNLMpUd4="
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
## Packages
|
||||||
|
- sudo rm -f /etc/apt/sources.list.d/mongodb.list # Makes apt crash on Precise, and we don't need MongoDB
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -y graphviz
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
## Deactivate xdebug if we don't do code coverage
|
||||||
|
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi
|
||||||
|
## Composer
|
||||||
|
- composer self-update
|
||||||
|
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
|
||||||
|
## PHPDocumentor
|
||||||
|
##- mkdir -p build/docs
|
||||||
|
- mkdir -p build/coverage
|
||||||
|
|
||||||
|
script:
|
||||||
|
## PHP_CodeSniffer
|
||||||
|
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip ; fi
|
||||||
|
## PHP-CS-Fixer
|
||||||
|
- if [ -n "$COVERAGE" ]; then ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run ; fi
|
||||||
|
## PHP Mess Detector
|
||||||
|
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php ; fi
|
||||||
|
## PHPUnit
|
||||||
|
- ./vendor/bin/phpunit -c ./ $(if [ -n "$COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi)
|
||||||
|
## PHPDocumentor
|
||||||
|
##- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
## Coveralls
|
||||||
|
- if [ -n "$COVERAGE" ]; then travis_retry php vendor/bin/php-coveralls -v ; fi
|
||||||
@ -58,25 +58,21 @@
|
|||||||
"fix": "Fixes issues found by PHP-CS"
|
"fix": "Fixes issues found by PHP-CS"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^5.3.3 || ^7.0 || ^8.0",
|
"php": "^7.1 || ^8",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"laminas/laminas-escaper": "^2.2"
|
"laminas/laminas-escaper": "^2.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"phpunit/phpunit": "^4.8.36 || ^7.0",
|
"phpunit/phpunit": "^7.5",
|
||||||
"squizlabs/php_codesniffer": "^2.9 || ^3.5",
|
"squizlabs/php_codesniffer": "^3.5",
|
||||||
"friendsofphp/php-cs-fixer": "^2.2",
|
"friendsofphp/php-cs-fixer": "^2.14",
|
||||||
"phpmd/phpmd": "2.*",
|
"phpmd/phpmd": "2.*",
|
||||||
"phploc/phploc": "2.* || 3.* || 4.* || 5.* || 6.* || 7.*",
|
|
||||||
"dompdf/dompdf":"0.8.* || 1.0.*",
|
"dompdf/dompdf":"0.8.* || 1.0.*",
|
||||||
"tecnickcom/tcpdf": "6.*",
|
"tecnickcom/tcpdf": "6.*",
|
||||||
"mpdf/mpdf": "5.7.4 || 6.* || 7.* || 8.*",
|
"mpdf/mpdf": "8.*",
|
||||||
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
|
"php-coveralls/php-coveralls": "^2.0"
|
||||||
},
|
|
||||||
"replace": {
|
|
||||||
"laminas/laminas-zendframework-bridge": "*"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-zip": "Allows writing OOXML and ODF",
|
"ext-zip": "Allows writing OOXML and ODF",
|
||||||
@ -92,7 +88,8 @@
|
|||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-develop": "0.18-dev"
|
"dev-develop": "0.19-dev",
|
||||||
|
"develop_v1.0": "1.0-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,6 @@
|
|||||||
<property name="minimum" value="30" />
|
<property name="minimum" value="30" />
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="rulesets/unusedcode.xml" />
|
<!--rule ref="rulesets/unusedcode.xml" /-->
|
||||||
<rule ref="rulesets/controversial.xml" />
|
<rule ref="rulesets/controversial.xml" />
|
||||||
</ruleset>
|
</ruleset>
|
||||||
@ -1,4 +1,6 @@
|
|||||||
<phpunit backupGlobals="false"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
|
||||||
|
backupGlobals="false"
|
||||||
backupStaticAttributes="false"
|
backupStaticAttributes="false"
|
||||||
bootstrap="./tests/bootstrap.php"
|
bootstrap="./tests/bootstrap.php"
|
||||||
colors="true"
|
colors="true"
|
||||||
|
|||||||
@ -71,13 +71,16 @@ class Html
|
|||||||
$html = '<body>' . $html . '</body>';
|
$html = '<body>' . $html . '</body>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//need to remove whitespaces between tags, as loadHTML seems to take those into account
|
||||||
|
$html = preg_replace('/(\>)\s*(\<)/m', '$1$2', $html);
|
||||||
|
|
||||||
// Load DOM
|
// Load DOM
|
||||||
if (\PHP_VERSION_ID < 80000) {
|
if (\PHP_VERSION_ID < 80000) {
|
||||||
$orignalLibEntityLoader = libxml_disable_entity_loader(true);
|
$orignalLibEntityLoader = libxml_disable_entity_loader(true);
|
||||||
}
|
}
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->preserveWhiteSpace = $preserveWhiteSpace;
|
$dom->preserveWhiteSpace = $preserveWhiteSpace;
|
||||||
$dom->loadXML($html);
|
$dom->loadHTML($html, LIBXML_NOWARNING);
|
||||||
self::$xpath = new \DOMXPath($dom);
|
self::$xpath = new \DOMXPath($dom);
|
||||||
$node = $dom->getElementsByTagName('body');
|
$node = $dom->getElementsByTagName('body');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user