diff --git a/.circleci/config.yml b/.circleci/config.yml index a9737ccdb..8fc9d310e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,19 +7,27 @@ workflows: name: PHP 5.5 - test-with-preinstalled-php: name: PHP 5.6 - docker-image: circleci/php:5.6.34-cli-jessie + docker-image: circleci/php:5.6 use-phpredis: false - test-with-preinstalled-php: name: PHP 7.0 - docker-image: circleci/php:7.0.28-cli-jessie + docker-image: circleci/php:7.0 - test-with-preinstalled-php: name: PHP 7.1 - docker-image: circleci/php:7.1.15-cli-jessie + docker-image: circleci/php:7.1 - test-with-preinstalled-php: name: PHP 7.2 - docker-image: circleci/php:7.2.3-cli-stretch + docker-image: circleci/php:7.2 include-lowest-compatible-versions-test: false # lowest "compatible" version of phpunit in 7.2 has a bug - https://github.com/sebastianbergmann/comparator/pull/30 + - test-with-preinstalled-php: + name: PHP 7.3 + docker-image: circleci/php:7.3 + include-lowest-compatible-versions-test: false + - test-with-preinstalled-php: + name: PHP 7.4 + docker-image: circleci/php:7.4 + include-lowest-compatible-versions-test: false - integration-test jobs: diff --git a/.gitignore b/.gitignore index 9d330805f..d0d7fdb94 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ composer.phar .vagrant integration-tests/vendor composer.lock +docs/build diff --git a/.ldrelease/build-docs.sh b/.ldrelease/build-docs.sh new file mode 100755 index 000000000..d39cf4ea4 --- /dev/null +++ b/.ldrelease/build-docs.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +cd docs +make PHPDOC_ARCHIVE=/home/circleci/ldtools/phpDocumentor.phar # provided in ldcircleci/ld-php-sdk-release image diff --git a/.ldrelease/config.yml b/.ldrelease/config.yml index 7b4b52e5d..6d102c880 100644 --- a/.ldrelease/config.yml +++ b/.ldrelease/config.yml @@ -6,5 +6,12 @@ publications: - url: https://packagist.org/packages/launchdarkly/server-sdk description: Packagist +circleCI: + linux: + image: ldcircleci/ld-php-sdk-release:1 # built in sdks-ci-docker project, contains PHP 7.2 + phpDocumentor + +documentation: + githubPages: true + sdk: displayName: "PHP" diff --git a/.ldrelease/publish-docs.sh b/.ldrelease/publish-docs.sh new file mode 100755 index 000000000..29fe6a382 --- /dev/null +++ b/.ldrelease/publish-docs.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +# Releaser will publish the docs to GitHub pages for us if we put a "docs.zip" artifact in ./artifacts + +mkdir -p artifacts +pushd docs/build/html +rm -f docs.zip +zip -r docs.zip * +popd +mv docs/build/html/docs.zip artifacts diff --git a/.ldrelease/update-version.sh b/.ldrelease/update-version.sh index 3fbea18d4..b017b80df 100755 --- a/.ldrelease/update-version.sh +++ b/.ldrelease/update-version.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # Update version in LDClient class LDCLIENT_PHP=src/LaunchDarkly/LDClient.php LDCLIENT_PHP_TEMP=${LDCLIENT_PHP}.tmp diff --git a/CHANGELOG.md b/CHANGELOG.md index b9d39c907..4c57d02d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to the LaunchDarkly PHP SDK will be documented in this file. ## [3.7.0] - 2019-12-13 ### Added: -- Added integration with the [`phpredis`](https://github.com/phpredis/phpredis) extension, which supports persistent Redis connections unlike the existing `predis` integration. See `LaunchDarkly::Integrations::PHPRedis`. (Thanks, [nicofff](https://github.com/launchdarkly/php-server-sdk/pull/128)!) +- Added integration with the [`phpredis`](https://github.com/phpredis/phpredis) extension, which has similar functionality to the already-supported `predis` but may have better performance (since `predis` is written in pure PHP, whereas `phpredis` uses a C extension). See `LaunchDarkly::Integrations::PHPRedis`. (Thanks, [nicofff](https://github.com/launchdarkly/php-server-sdk/pull/128)!) ## [3.6.0] - 2019-10-01 ### Added: diff --git a/composer.json b/composer.json index 560e0407e..2a90f4613 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,9 @@ }, "require-dev": { "aws/aws-sdk-php": "^3.86", - "friendsofphp/php-cs-fixer": "~2.2.19", + "friendsofphp/php-cs-fixer": ">=2.2.19 <3.0", "guzzlehttp/guzzle": "^6.2.1", "kevinrob/guzzle-cache-middleware": "^1.4.1", - "phpdocumentor/phpdocumentor": "^2.0", "phpunit/phpunit": ">=4.8.26 <5.4", "predis/predis": "^1.0", "sensiolabs/consul-php-sdk": ">=2.1 <3.0", diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..4423ca925 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,17 @@ + +# PHPDOC_ARCHIVE is overridden in the CircleCI release +PHPDOC_ARCHIVE := $(shell pwd)/build/phpDocumentor.phar +OUTPUT_DIR := $(shell pwd)/build +PHPDOC_URL=https://www.phpdoc.org/phpDocumentor.phar + +.PHONY: install html + +html: install + rm -rf build/temp build/html + cd .. && php $(PHPDOC_ARCHIVE) --visibility public --title "LaunchDarkly PHP SDK ${LD_RELEASE_VERSION}" + +install: $(PHPDOC_ARCHIVE) + +$(PHPDOC_ARCHIVE): + mkdir -p build + cd build && unzip ../lib/phpDocumentor.phar.zip diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml new file mode 100644 index 000000000..9f467505a --- /dev/null +++ b/phpdoc.dist.xml @@ -0,0 +1,40 @@ + + + + docs/build/temp + + + docs/build/html + + + src + src/LaunchDarkly/Impl/* + src/LaunchDarkly/Impl/Integrations/* + + src/LaunchDarkly/Clause.php + src/LaunchDarkly/EvalResult.php + src/LaunchDarkly/EvaluationException.php + src/LaunchDarkly/EventProcessor.php + src/LaunchDarkly/EventSerializer.php + src/LaunchDarkly/FeatureFlag.php + src/LaunchDarkly/Operators.php + src/LaunchDarkly/PreloadedFeatureRequester.php + src/LaunchDarkly/Prerequisite.php + src/LaunchDarkly/Rollout.php + src/LaunchDarkly/Rule.php + src/LaunchDarkly/Segment.php + src/LaunchDarkly/SegmentRule.php + src/LaunchDarkly/SemanticVersion.php + src/LaunchDarkly/Target.php + src/LaunchDarkly/UnrecoverableHTTPStatusException.php + src/LaunchDarkly/Util.php + src/LaunchDarkly/VariationOrRollout.php + src/LaunchDarkly/WeightedVariation.php + + +