diff --git a/.travis.yml b/.travis.yml index 248f0015..632fc369 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,13 @@ before_script: - mkdir -p build/logs script: - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then CM="phpdbg -qrr"; NC=""; else CM=""; NC="--no-coverage"; fi + #- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then CM="phpdbg -qrr"; NC=""; else CM=""; NC="--no-coverage"; fi + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then CM=""; NC=""; else CM=""; NC="--no-coverage"; fi - $CM ./vendor/bin/phpunit $NC - $CM ./vendor/bin/phpunit --configuration phpunit-mysql.xml $NC after_script: - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then vendor/bin/phpcov merge build/logs/ --clover /build/logs/clover.xml; vendor/bin/test-reporter; fi + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then vendor/bin/phpcov merge build/logs/ --clover cc.xml; vendor/bin/test-reporter --coverage-report cc.xml; fi notifications: urls: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5428716b..24286d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.1.2 + + - Fix how getDebugQuery() works without sql-formatter + - Fix Query::dsql will return instance of same class if you extend. #116 + ## 1.1.1 Bugfix and README.md update. diff --git a/README.md b/README.md index fa83ade5..28d0d539 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ DSQL has been in production since 2006, initially included in [AModules2](https: [![Gitter](https://img.shields.io/gitter/room/atk4/data.svg?maxAge=2592000)](https://gitter.im/atk4/dataset?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Documentation Status](https://readthedocs.org/projects/dsql/badge/?version=latest)](http://dsql.readthedocs.io/en/latest/?badge=latest) [![License](https://poser.pugx.org/atk4/dsql/license)](https://packagist.org/packages/atk4/dsql) -[![GitHub release](https://img.shields.io/github/release/atk4/dsql.svg?maxAge=2592000)]() +[![GitHub release](https://img.shields.io/badge/release-1.1.9-brightgreen.png?style=default)](CHANGELOG.md) [![Build Status](https://travis-ci.org/atk4/dsql.png?branch=develop)](https://travis-ci.org/atk4/dsql) [![Code Climate](https://codeclimate.com/github/atk4/dsql/badges/gpa.svg)](https://codeclimate.com/github/atk4/dsql) [![Test Coverage](https://codeclimate.com/github/atk4/dsql/badges/coverage.svg)](https://codeclimate.com/github/atk4/dsql/coverage) @@ -173,4 +173,4 @@ frequent topics: The code of DSQL is available under MIT license with community and [commercial support](http://www.agiletoolkit.org/enterprise) available. -Our team wishes to thanks [Reddit PHP community](https://www.reddit.com/r/PHP/) for feedback and help in creation of this project. \ No newline at end of file +Our team wishes to thanks [Reddit PHP community](https://www.reddit.com/r/PHP/) for feedback and help in creation of this project. diff --git a/docs/queries.rst b/docs/queries.rst index 73a83578..30edb011 100644 --- a/docs/queries.rst +++ b/docs/queries.rst @@ -564,6 +564,14 @@ The third argument specifies type of join and defaults to "left" join. You can s Method can be executed several times on the same Query object. +Joining on expression +````````````````````` + +For a more complex join conditions, you can pass second argument as expression:: + + $q->table('user', 'u'); + $q->join('address a', new Expression('a.name like u.pattern')); + Limiting result-set ------------------- diff --git a/phpunit-mysql.xml b/phpunit-mysql.xml index dfb6b2f4..9a6beccd 100644 --- a/phpunit-mysql.xml +++ b/phpunit-mysql.xml @@ -19,6 +19,6 @@ - + diff --git a/src/Expression.php b/src/Expression.php index 7895c105..9720ec5f 100644 --- a/src/Expression.php +++ b/src/Expression.php @@ -477,7 +477,7 @@ public function getDebugQuery($html = null) $result = $d; // output as-is } if (!$html) { - return strip_tags($result, '<>'); + return str_replace('#lte#', '<=', strip_tags(str_replace('<=', '#lte#', $result), '<>')); } return $result; diff --git a/src/Query.php b/src/Query.php index cd981125..f9fc0bff 100644 --- a/src/Query.php +++ b/src/Query.php @@ -1220,7 +1220,7 @@ public function mode($mode) */ public function dsql($properties = []) { - $q = new self($properties); + $q = new static($properties); $q->connection = $this->connection; return $q;