From cc420fc6076802dc727436d972fb79a790a6959b Mon Sep 17 00:00:00 2001 From: Tang Rufus Date: Mon, 13 Mar 2017 10:02:35 +0800 Subject: [PATCH 01/22] Add .gitattributes --- .gitattributes | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d4348b8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Path-based git attributes +# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html + +# Ignore everything. +/* export-ignore + +# Export white-listed production code only. +/src -export-ignore +/composer.json -export-ignore +/composer.lock -export-ignore + From 5ccf0ceaf30cf70e68a9a242754551e2dcf95c87 Mon Sep 17 00:00:00 2001 From: Tang Rufus Date: Mon, 13 Mar 2017 22:05:40 +0800 Subject: [PATCH 02/22] Version bump 1.10.2 and Lock phpunit version under 6 --- composer.json | 4 +- composer.lock | 433 ++++++++++++++++++++++++++------------------------ 2 files changed, 230 insertions(+), 207 deletions(-) diff --git a/composer.json b/composer.json index 9e9d476..7609019 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "jamesryanbell/cloudflare", "description": "CloudFlare API - PHP", "license": "MIT", - "version": "1.10.1", + "version": "1.10.2", "keywords": ["cloudflare", "api"], "authors": [ { @@ -12,7 +12,7 @@ ], "require": {}, "require-dev": { - "phpunit/phpunit": "*", + "phpunit/phpunit": "< 6", "satooshi/php-coveralls": "dev-master" }, "autoload": { diff --git a/composer.lock b/composer.lock index bc0d3a1..ce687e5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "30bdccc523544321b3eac3bea24989da", - "content-hash": "181988c127d2305c063857227eb54862", + "content-hash": "12de1420a4cc5a01c04a6e40c8cc107d", "packages": [], "packages-dev": [ { @@ -60,25 +59,25 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.2.2", + "version": "6.2.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60" + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", "shasum": "" }, "require": { "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.3.1", + "guzzlehttp/psr7": "^1.4", "php": ">=5.5" }, "require-dev": { @@ -122,32 +121,32 @@ "rest", "web service" ], - "time": "2016-10-08 15:01:37" + "time": "2017-02-28T22:50:30+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.2.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, "require": { "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -173,20 +172,20 @@ "keywords": [ "promise" ], - "time": "2016-05-18 16:56:05" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.3.1", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" + "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/0d6c7ca039329247e4f0f8f8f6506810e8248855", + "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855", "shasum": "" }, "require": { @@ -222,29 +221,36 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "PSR-7 message implementation", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ "http", "message", + "request", + "response", "stream", - "uri" + "uri", + "url" ], - "time": "2016-06-24 23:00:38" + "time": "2017-02-27T10:51:17+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.5.4", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f", - "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { @@ -273,7 +279,7 @@ "object", "object graph" ], - "time": "2016-09-16 13:37:59" + "time": "2017-01-26T22:05:40+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -327,7 +333,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -372,20 +378,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "shasum": "" }, "require": { @@ -419,31 +425,32 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-06-10 07:14:17" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.1", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0" + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "^2.0" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { @@ -481,39 +488,39 @@ "spy", "stub" ], - "time": "2016-06-07 08:13:47" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.1", + "version": "4.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3" + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3", - "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", - "sebastian/code-unit-reverse-lookup": "~1.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "~1.0|~2.0" + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "^5.4" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.4.0", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { @@ -544,20 +551,20 @@ "testing", "xunit" ], - "time": "2016-07-26 14:39:29" + "time": "2017-03-01T09:12:17+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -591,7 +598,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -632,29 +639,34 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -676,20 +688,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { @@ -725,20 +737,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", - "version": "5.6.1", + "version": "5.7.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7" + "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60c32c5b5e79c2248001efa2560f831da11cc2d7", - "reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b99112aecc01f62acf3d81a3f59646700a1849e5", + "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5", "shasum": "" }, "require": { @@ -749,20 +761,20 @@ "ext-xml": "*", "myclabs/deep-copy": "~1.3", "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0.1", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "^1.2.4", "sebastian/diff": "~1.2", - "sebastian/environment": "^1.3 || ^2.0", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", + "sebastian/version": "~1.0.3|~2.0", "symfony/yaml": "~2.1|~3.0" }, "conflict": { @@ -781,7 +793,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.6.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -807,27 +819,27 @@ "testing", "xunit" ], - "time": "2016-10-07 13:03:26" + "time": "2017-03-02T15:22:43+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.0", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2" + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/238d7a2723bce689c79eeac9c7d5e1d623bb9dc2", - "reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.6 || ^7.0", "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2" + "sebastian/exporter": "^1.2 || ^2.0" }, "conflict": { "phpunit/phpunit": "<5.4.0" @@ -866,7 +878,7 @@ "mock", "xunit" ], - "time": "2016-10-09 07:01:45" + "time": "2016-12-08T20:27:08+00:00" }, { "name": "psr/http-message", @@ -916,7 +928,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -963,7 +975,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "satooshi/php-coveralls", @@ -971,24 +983,24 @@ "source": { "type": "git", "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "50c60bb64054974f8ed7540ae6e75fd7981a5fd3" + "reference": "d5124af8bd6464144d550906cce46bd0df78f428" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/50c60bb64054974f8ed7540ae6e75fd7981a5fd3", - "reference": "50c60bb64054974f8ed7540ae6e75fd7981a5fd3", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/d5124af8bd6464144d550906cce46bd0df78f428", + "reference": "d5124af8bd6464144d550906cce46bd0df78f428", "shasum": "" }, "require": { "ext-json": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5", + "php": "^5.5 || ^7.0", "psr/log": "^1.0", - "symfony/config": "^2.1|^3.0", - "symfony/console": "^2.1|^3.0", - "symfony/stopwatch": "^2.0|^3.0", - "symfony/yaml": "^2.0|^3.0" + "symfony/config": "^2.1 || ^3.0", + "symfony/console": "^2.1 || ^3.0", + "symfony/stopwatch": "^2.0 || ^3.0", + "symfony/yaml": "^2.0 || ^3.0" }, "suggest": { "symfony/http-kernel": "Allows Symfony integration" @@ -1026,27 +1038,27 @@ "github", "test" ], - "time": "2016-01-20 17:44:41" + "time": "2017-02-25 12:14:18" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1071,26 +1083,26 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -1135,7 +1147,7 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -1187,32 +1199,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1237,25 +1249,25 @@ "environment", "hhvm" ], - "time": "2016-08-18 05:49:44" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", @@ -1264,7 +1276,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1304,7 +1316,7 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -1355,25 +1367,25 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { "php": ">=5.6", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "phpunit/phpunit": "~5" @@ -1381,7 +1393,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1401,20 +1413,20 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28 13:25:10" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { @@ -1426,7 +1438,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1454,7 +1466,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -1496,20 +1508,20 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { @@ -1539,33 +1551,36 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-02-04 12:56:52" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/config", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341" + "reference": "741d6d4cd1414d67d48eb71aba6072b46ba740c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/949e7e846743a7f9e46dc50eb639d5fde1f53341", - "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341", + "url": "https://api.github.com/repos/symfony/config/zipball/741d6d4cd1414d67d48eb71aba6072b46ba740c2", + "reference": "741d6d4cd1414d67d48eb71aba6072b46ba740c2", "shasum": "" }, "require": { "php": ">=5.5.9", "symfony/filesystem": "~2.8|~3.0" }, + "require-dev": { + "symfony/yaml": "~3.0" + }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1592,20 +1607,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-09-25 08:27:07" + "time": "2017-03-01T18:18:25+00:00" }, { "name": "symfony/console", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0" + "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6cb0872fb57b38b3b09ff213c21ed693956b9eb0", - "reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0", + "url": "https://api.github.com/repos/symfony/console/zipball/28fb243a2b5727774ca309ec2d92da240f1af0dd", + "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd", "shasum": "" }, "require": { @@ -1616,17 +1631,19 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1653,20 +1670,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-09-28 00:11:12" + "time": "2017-03-06T19:30:27+00:00" }, { "name": "symfony/debug", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8" + "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", + "url": "https://api.github.com/repos/symfony/debug/zipball/b90c9f91ad8ac37d9f114e369042d3226b34dc1a", + "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a", "shasum": "" }, "require": { @@ -1683,7 +1700,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1710,20 +1727,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-09-06 11:02:40" + "time": "2017-02-18T17:28:00+00:00" }, { "name": "symfony/filesystem", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "682fd8fdb3135fdf05fc496a01579ccf6c85c0e5" + "reference": "bc0f17bed914df2cceb989972c3b996043c4da4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/682fd8fdb3135fdf05fc496a01579ccf6c85c0e5", - "reference": "682fd8fdb3135fdf05fc496a01579ccf6c85c0e5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/bc0f17bed914df2cceb989972c3b996043c4da4a", + "reference": "bc0f17bed914df2cceb989972c3b996043c4da4a", "shasum": "" }, "require": { @@ -1732,7 +1749,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1759,20 +1776,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-09-14 00:18:46" + "time": "2017-03-06T19:30:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -1784,7 +1801,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1818,20 +1835,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1" + "reference": "c5ee0f8650c84b4d36a5f76b3b504233feaabf75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/bb42806b12c5f89db4ebf64af6741afe6d8457e1", - "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/c5ee0f8650c84b4d36a5f76b3b504233feaabf75", + "reference": "c5ee0f8650c84b4d36a5f76b3b504233feaabf75", "shasum": "" }, "require": { @@ -1840,7 +1857,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1867,29 +1884,35 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:41:56" + "time": "2017-02-18T17:28:00+00:00" }, { "name": "symfony/yaml", - "version": "v3.1.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3" + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3", - "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3", + "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", "shasum": "" }, "require": { "php": ">=5.5.9" }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1916,24 +1939,24 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-09-25 08:27:07" + "time": "2017-03-07T16:47:02+00:00" }, { "name": "webmozart/assert", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -1942,7 +1965,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1966,7 +1989,7 @@ "check", "validate" ], - "time": "2016-08-09 15:02:57" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], From 7ec8bd416a886874da7cb96f8b43150ab4210017 Mon Sep 17 00:00:00 2001 From: James Bell Date: Fri, 28 Apr 2017 20:43:07 +0100 Subject: [PATCH 03/22] Added notes to Access Rules endpoint. Closes #57 --- composer.json | 2 +- src/CloudFlare/Zone/Firewall/AccessRules.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7609019..8ccf4eb 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "jamesryanbell/cloudflare", "description": "CloudFlare API - PHP", "license": "MIT", - "version": "1.10.2", + "version": "1.10.3", "keywords": ["cloudflare", "api"], "authors": [ { diff --git a/src/CloudFlare/Zone/Firewall/AccessRules.php b/src/CloudFlare/Zone/Firewall/AccessRules.php index c6613ea..e3eeb00 100644 --- a/src/CloudFlare/Zone/Firewall/AccessRules.php +++ b/src/CloudFlare/Zone/Firewall/AccessRules.php @@ -30,8 +30,10 @@ class AccessRules extends Api * @param string|null $order Field to order rules by * @param string|null $direction Direction to order rules * @param string|null $match Whether to match all search requirements or at least one (any) + * @param string|null $notes Search in the access rules by notes. */ - public function rules($zone_id, $scope_type = null, $mode = null, $configuration_target = null, $configuration_value = null, $page = null, $per_page = null, $order = null, $direction = null, $match = null) + + public function rules($zone_id, $scope_type = null, $mode = null, $configuration_target = null, $configuration_value = null, $page = null, $per_page = null, $order = null, $direction = null, $match = null, $notes = null) { $data = [ 'scope_type' => $scope_type, @@ -43,6 +45,7 @@ public function rules($zone_id, $scope_type = null, $mode = null, $configuration 'order' => $order, 'direction' => $direction, 'match' => $match, + 'notes' => $notes, ]; return $this->get('/zones/'.$zone_id.'/firewall/access_rules/rules', $data); From be5bbfff12387eba7ce07015e97826a2d4fc9bf4 Mon Sep 17 00:00:00 2001 From: James Bell Date: Fri, 28 Apr 2017 19:44:34 +0000 Subject: [PATCH 04/22] Apply fixes from StyleCI --- src/CloudFlare/Zone/Firewall/AccessRules.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CloudFlare/Zone/Firewall/AccessRules.php b/src/CloudFlare/Zone/Firewall/AccessRules.php index e3eeb00..3fe155b 100644 --- a/src/CloudFlare/Zone/Firewall/AccessRules.php +++ b/src/CloudFlare/Zone/Firewall/AccessRules.php @@ -32,7 +32,6 @@ class AccessRules extends Api * @param string|null $match Whether to match all search requirements or at least one (any) * @param string|null $notes Search in the access rules by notes. */ - public function rules($zone_id, $scope_type = null, $mode = null, $configuration_target = null, $configuration_value = null, $page = null, $per_page = null, $order = null, $direction = null, $match = null, $notes = null) { $data = [ From 5458993af57412e9f783e67b83661ac0f5e221bf Mon Sep 17 00:00:00 2001 From: Menno Holtkamp Date: Sun, 9 Jul 2017 20:02:02 +0200 Subject: [PATCH 05/22] Use function defaults to prevent needless code / checks for `NULL` values --- src/CloudFlare/Api.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/CloudFlare/Api.php b/src/CloudFlare/Api.php index f8aca5a..b3897bd 100644 --- a/src/CloudFlare/Api.php +++ b/src/CloudFlare/Api.php @@ -165,15 +165,12 @@ public function patch($path, array $data = null) * * @return mixed */ - protected function request($path, array $data = null, $method = null) + protected function request($path, array $data = array(), $method = 'get') { if (!isset($this->email, $this->auth_key) || false === filter_var($this->email, FILTER_VALIDATE_EMAIL)) { throw new AuthenticationException('Authentication information must be provided'); } - $data = (is_null($data) ? [] : $data); - $method = (is_null($method) ? 'get' : $method); - //Removes null entries $data = array_filter($data, function ($val) { return !is_null($val); From 83b54ede2b5f0f07bf870c03452ba3d7ea9694a4 Mon Sep 17 00:00:00 2001 From: Menno Holtkamp Date: Sun, 9 Jul 2017 23:02:02 +0200 Subject: [PATCH 06/22] Set all headers at once --- src/CloudFlare/Api.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CloudFlare/Api.php b/src/CloudFlare/Api.php index f8aca5a..7a2b6d2 100644 --- a/src/CloudFlare/Api.php +++ b/src/CloudFlare/Api.php @@ -196,12 +196,16 @@ protected function request($path, array $data = null, $method = null) } $user_agent = __FILE__; - $headers = ["X-Auth-Email: {$this->email}", "X-Auth-Key: {$this->auth_key}", "User-Agent: {$user_agent}"]; + $headers = [ + "X-Auth-Email: {$this->email}", + "X-Auth-Key: {$this->auth_key}", + "User-Agent: {$user_agent}", + 'Content-type: application/json', + ]; $ch = curl_init(); curl_setopt_array($ch, $curl_options); - $headers[] = 'Content-type: application/json'; $json_data = json_encode($data); if ($method === 'post') { From c4f3778415e5e55698ddff7e338be5572f933b42 Mon Sep 17 00:00:00 2001 From: Menno Holtkamp Date: Mon, 10 Jul 2017 16:50:36 +0200 Subject: [PATCH 07/22] Add always_use_https() and change_always_use_https() --- src/CloudFlare/Zone/Settings.php | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index 5ca2296..22e08a3 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -50,6 +50,22 @@ public function always_online($zone_identifier) return $this->get('zones/'.$zone_identifier.'/settings/always_online'); } + /** + * Get Always Use HTTPS setting permission needed: #zone_settings:read + * + * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. + * + * @link https://api.cloudflare.com/#zone-settings-get-always-use-https-setting + * + * @param string $zone_identifier API item identifier tag + * + * @return \stdClass | false + */ + public function always_use_https($zone_identifier) + { + return $this->get('zones/' . $zone_identifier . '/settings/always_use_https'); + } + /** * Get Browser Cache TTL setting (permission needed: #zone_settings:read) * Browser Cache TTL (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors' computers. @@ -401,6 +417,26 @@ public function change_always_on($zone_identifier, $value = null) return $this->patch('zones/'.$zone_identifier.'/settings/always_online', $data); } + /** + * Change Always Use HTTPS setting (permission needed: #zone_settings:edit) + * + * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. + * + * @link https://api.cloudflare.com/#zone-settings-change-always-use-https-setting + * + * @param string $zone_identifier API item identifier tag + * @param string|null $value Value of the zone setting (default: off) + * + * @return \stdClass | false + */ + public function change_always_use_https($zone_identifier, $value = null) + { + $data = array( + 'value' => $value + ); + return $this->patch('zones/' . $zone_identifier . '/settings/always_use_https', $data); + } + /** * Change Browser Cache TTL setting (permission needed: #zone_settings:edit) * Browser Cache TTL (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors' computers. CloudFlare will honor any larger times specified by your server. From d585cef233f15c36c9f13f78e34793a0c4f9c170 Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Fri, 14 Jul 2017 14:17:54 +0300 Subject: [PATCH 08/22] add always_use_https method --- src/CloudFlare/Zone/Settings.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index 5ca2296..04aaf07 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -38,6 +38,17 @@ public function advanced_ddos($zone_identifier) return $this->get('zones/'.$zone_identifier.'/settings/advanced_ddos'); } + /** + * Get Always Use HTTPS setting permission needed: #zone_settings:read + * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. + * + * @param string $zone_identifier API item identifier tag + */ + public function always_use_https($zone_identifier) + { + return $this->get('zones/'.$zone_identifier.'/settings/always_use_https'); + } + /** * Get Always Online setting (permission needed: #zone_settings:read) * When enabled, Always Online will serve pages from our cache if your server is offline @@ -385,6 +396,22 @@ public function edit($zone_identifier, array $items) return $this->patch('zones/'.$zone_identifier.'/settings', $data); } + /** + * Change Always Use HTTPS setting permission needed: #zone_settings:edit + * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. + * + * @param string $zone_identifier API item identifier tag + * @param string|null $value Value of the zone setting (default: off) + */ + public function change_always_use_https($zone_identifier, $value = null) + { + $data = [ + 'value' => $value, + ]; + + return $this->patch('zones/'.$zone_identifier.'/settings/always_use_https', $data); + } + /** * Change Always Online setting (permission needed: #zone_settings:edit) * When enabled, Always Online will serve pages from our cache if your server is offline (https://support.cloudflare.com/hc/en-us/articles/200168006) From ecaa0dca8155cf275380c4d6674c3eb4ed430caa Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Fri, 14 Jul 2017 14:18:56 +0300 Subject: [PATCH 09/22] add automatic_https_rewrites method --- src/CloudFlare/Zone/Settings.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index 04aaf07..b948ca9 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -38,6 +38,17 @@ public function advanced_ddos($zone_identifier) return $this->get('zones/'.$zone_identifier.'/settings/advanced_ddos'); } + /** + * Get Automatic HTTPS Rewrites setting permission needed: #zone_settings:edit + * Enable the Automatic HTTPS Rewrites feature for this zone. + * + * @param string $zone_identifier API item identifier tag + */ + public function automatic_https_rewrites($zone_identifier) + { + return $this->get('zones/'.$zone_identifier.'/settings/automatic_https_rewrites'); + } + /** * Get Always Use HTTPS setting permission needed: #zone_settings:read * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. @@ -396,6 +407,22 @@ public function edit($zone_identifier, array $items) return $this->patch('zones/'.$zone_identifier.'/settings', $data); } + /** + * Change Automatic HTTPS Rewrites setting permission needed: #zone_settings:edit + * Enable the Automatic HTTPS Rewrites feature for this zone. + * + * @param string $zone_identifier API item identifier tag + * @param string|null $value Value of the zone setting (default: off) + */ + public function change_automatic_https_rewrites($zone_identifier, $value = null) + { + $data = [ + 'value' => $value, + ]; + + return $this->patch('zones/'.$zone_identifier.'/settings/automatic_https_rewrites', $data); + } + /** * Change Always Use HTTPS setting permission needed: #zone_settings:edit * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. From 914a737d9bb685071767fdbb26b28ee3483d8c2b Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Fri, 14 Jul 2017 14:28:43 +0300 Subject: [PATCH 10/22] remove always_use_https for merge request --- src/CloudFlare/Zone/Settings.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index b948ca9..c2d2920 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -49,17 +49,6 @@ public function automatic_https_rewrites($zone_identifier) return $this->get('zones/'.$zone_identifier.'/settings/automatic_https_rewrites'); } - /** - * Get Always Use HTTPS setting permission needed: #zone_settings:read - * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. - * - * @param string $zone_identifier API item identifier tag - */ - public function always_use_https($zone_identifier) - { - return $this->get('zones/'.$zone_identifier.'/settings/always_use_https'); - } - /** * Get Always Online setting (permission needed: #zone_settings:read) * When enabled, Always Online will serve pages from our cache if your server is offline @@ -423,22 +412,6 @@ public function change_automatic_https_rewrites($zone_identifier, $value = null) return $this->patch('zones/'.$zone_identifier.'/settings/automatic_https_rewrites', $data); } - /** - * Change Always Use HTTPS setting permission needed: #zone_settings:edit - * Reply to all requests for URLs that use "http" with a 301 redirect to the equivalent "https" URL. If you only want to redirect for a subset of requests, consider creating an "Always use HTTPS" page rule. - * - * @param string $zone_identifier API item identifier tag - * @param string|null $value Value of the zone setting (default: off) - */ - public function change_always_use_https($zone_identifier, $value = null) - { - $data = [ - 'value' => $value, - ]; - - return $this->patch('zones/'.$zone_identifier.'/settings/always_use_https', $data); - } - /** * Change Always Online setting (permission needed: #zone_settings:edit) * When enabled, Always Online will serve pages from our cache if your server is offline (https://support.cloudflare.com/hc/en-us/articles/200168006) From c9838880a105dfc540338119deebb9bbcb7ae2bb Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Fri, 14 Jul 2017 14:30:55 +0300 Subject: [PATCH 11/22] fix comments --- src/CloudFlare/Zone/Settings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index c2d2920..ab90314 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -39,7 +39,7 @@ public function advanced_ddos($zone_identifier) } /** - * Get Automatic HTTPS Rewrites setting permission needed: #zone_settings:edit + * Get Automatic HTTPS Rewrites setting (permission needed: #zone_settings:edit) * Enable the Automatic HTTPS Rewrites feature for this zone. * * @param string $zone_identifier API item identifier tag @@ -397,7 +397,7 @@ public function edit($zone_identifier, array $items) } /** - * Change Automatic HTTPS Rewrites setting permission needed: #zone_settings:edit + * Change Automatic HTTPS Rewrites setting (permission needed: #zone_settings:edit) * Enable the Automatic HTTPS Rewrites feature for this zone. * * @param string $zone_identifier API item identifier tag From c8b38c014007ff548cac6686b004eed95ff609bf Mon Sep 17 00:00:00 2001 From: James Bell Date: Wed, 2 Aug 2017 12:35:50 +0100 Subject: [PATCH 12/22] Removed version number Removed version number based on Composer best practices. Thanks for pointing out @holtkamp https://getcomposer.org/doc/04-schema.md#version --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 8ccf4eb..ca6fd74 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "jamesryanbell/cloudflare", "description": "CloudFlare API - PHP", "license": "MIT", - "version": "1.10.3", "keywords": ["cloudflare", "api"], "authors": [ { From df8932190da13d9e47adcf18446d491c96fce441 Mon Sep 17 00:00:00 2001 From: Aaron Huisinga Date: Wed, 2 Aug 2017 21:35:06 -0500 Subject: [PATCH 13/22] Update default data parameters for request methods v1.11.0 updated the default $data and $method parameters for the request method. The method parameters that call this method need to be updated to avoid exceptions being thrown. --- src/CloudFlare/Api.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/CloudFlare/Api.php b/src/CloudFlare/Api.php index ef30662..43f9cf2 100644 --- a/src/CloudFlare/Api.php +++ b/src/CloudFlare/Api.php @@ -92,12 +92,12 @@ public function setCurlOption($key, $value) /** * API call method for sending requests using GET * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request * * @return mixed */ - public function get($path, array $data = null) + public function get($path, array $data = array()) { return $this->request($path, $data, 'get'); } @@ -105,12 +105,12 @@ public function get($path, array $data = null) /** * API call method for sending requests using POST * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request * * @return mixed */ - public function post($path, array $data = null) + public function post($path, array $data = array()) { return $this->request($path, $data, 'post'); } @@ -118,12 +118,12 @@ public function post($path, array $data = null) /** * API call method for sending requests using PUT * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request * * @return mixed */ - public function put($path, array $data = null) + public function put($path, array $data = array()) { return $this->request($path, $data, 'put'); } @@ -131,12 +131,12 @@ public function put($path, array $data = null) /** * API call method for sending requests using DELETE * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request * * @return mixed */ - public function delete($path, array $data = null) + public function delete($path, array $data = array()) { return $this->request($path, $data, 'delete'); } @@ -144,12 +144,12 @@ public function delete($path, array $data = null) /** * API call method for sending requests using PATCH * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request * * @return mixed */ - public function patch($path, array $data = null) + public function patch($path, array $data = array()) { return $this->request($path, $data, 'patch'); } @@ -159,9 +159,9 @@ public function patch($path, array $data = null) * * API call method for sending requests using GET, POST, PUT, DELETE OR PATCH * - * @param string $path Path of the endpoint - * @param array|null $data Data to be sent along with the request - * @param string|null $method Type of method that should be used ('GET', 'POST', 'PUT', 'DELETE', 'PATCH') + * @param string $path Path of the endpoint + * @param array $data Data to be sent along with the request + * @param string $method Type of method that should be used ('GET', 'POST', 'PUT', 'DELETE', 'PATCH') * * @return mixed */ From cdf0e37fb5511e8f25ba7e88944a1db7ad83f06f Mon Sep 17 00:00:00 2001 From: Aaron Huisinga Date: Wed, 2 Aug 2017 21:37:40 -0500 Subject: [PATCH 14/22] Fix StyleCI issues --- src/CloudFlare/Api.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CloudFlare/Api.php b/src/CloudFlare/Api.php index 43f9cf2..21f152f 100644 --- a/src/CloudFlare/Api.php +++ b/src/CloudFlare/Api.php @@ -97,7 +97,7 @@ public function setCurlOption($key, $value) * * @return mixed */ - public function get($path, array $data = array()) + public function get($path, array $data = []) { return $this->request($path, $data, 'get'); } @@ -110,7 +110,7 @@ public function get($path, array $data = array()) * * @return mixed */ - public function post($path, array $data = array()) + public function post($path, array $data = []) { return $this->request($path, $data, 'post'); } @@ -123,7 +123,7 @@ public function post($path, array $data = array()) * * @return mixed */ - public function put($path, array $data = array()) + public function put($path, array $data = []) { return $this->request($path, $data, 'put'); } @@ -136,7 +136,7 @@ public function put($path, array $data = array()) * * @return mixed */ - public function delete($path, array $data = array()) + public function delete($path, array $data = []) { return $this->request($path, $data, 'delete'); } @@ -149,7 +149,7 @@ public function delete($path, array $data = array()) * * @return mixed */ - public function patch($path, array $data = array()) + public function patch($path, array $data = []) { return $this->request($path, $data, 'patch'); } @@ -165,7 +165,7 @@ public function patch($path, array $data = array()) * * @return mixed */ - protected function request($path, array $data = array(), $method = 'get') + protected function request($path, array $data = [], $method = 'get') { if (!isset($this->email, $this->auth_key) || false === filter_var($this->email, FILTER_VALIDATE_EMAIL)) { throw new AuthenticationException('Authentication information must be provided'); @@ -194,8 +194,8 @@ protected function request($path, array $data = array(), $method = 'get') $user_agent = __FILE__; $headers = [ - "X-Auth-Email: {$this->email}", - "X-Auth-Key: {$this->auth_key}", + "X-Auth-Email: {$this->email}", + "X-Auth-Key: {$this->auth_key}", "User-Agent: {$user_agent}", 'Content-type: application/json', ]; From 25883783658eaad90cb969d716f1a644ae7f8380 Mon Sep 17 00:00:00 2001 From: fmp777 Date: Thu, 31 Aug 2017 12:33:42 -0600 Subject: [PATCH 15/22] Add free SSL status and retry Cloudflare's free SSL takes time to issue. These two new functions enable you to detect when its ready and also to trigger Cloudflare to retry validation (like after name servers were updated). --- src/CloudFlare/Zone/SSL.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/CloudFlare/Zone/SSL.php b/src/CloudFlare/Zone/SSL.php index 5939d2f..774c166 100644 --- a/src/CloudFlare/Zone/SSL.php +++ b/src/CloudFlare/Zone/SSL.php @@ -96,4 +96,30 @@ public function delete_ssl($zone_identifier, $identifier) { return $this->delete('zones/'.$zone_identifier.'/custom_certificates/'.$identifier); } + + /** + * Get SSL Verification Info for a Zone (permission needed: #ssl:read) + * https://api.cloudflare.com/#ssl-verification-properties + * + * @param string $zone_identifier API item identifier tag + */ + public function free_ssl_status($zone_identifier) + { + return $this->get('zones/'.$zone_identifier.'/ssl/verification'); + } + + /** + * Immediately retry SSL verification (permission needed: #ssl:edit) + * https://api.cloudflare.com/#ssl-verification-properties + * + * @param string $zone_identifier API item identifier tag + */ + public function free_ssl_retry($zone_identifier) + { + $data = [ + 'retry' => true + ]; + + return $this->get('zones/'.$zone_identifier.'/ssl/verification', $data); + } } From d6fab0b7f51cecd70f00e6ac845cc742540ea8ca Mon Sep 17 00:00:00 2001 From: Darryl Date: Wed, 4 Dec 2019 12:12:01 -0500 Subject: [PATCH 16/22] Added min_tls_version --- src/CloudFlare/Zone/Settings.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index c9caf0d..144def0 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -891,4 +891,29 @@ public function change_waf($zone_identifier, $value = null) return $this->patch('zones/'.$zone_identifier.'/settings/waf', $data); } + + + public function min_tls_version($zone_identifier) + { + return $this->get('zones/'.$zone_identifier.'/settings/min_tls_version'); + } + + /** + * Change Minimum TLS Version setting + * Only accept HTTPS requests that use at least the TLS protocol version specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted. + * https://api.cloudflare.com/#zone-settings-change-minimum-tls-version-setting + * + * @param string $zone_identifier API item identifier tag + * @param string|null $value Value of the zone setting (default: off) + * + * @return mixed + */ + public function change_min_tls_version($zone_identifier, $value = null) + { + $data = [ + 'value' => $value, + ]; + + return $this->patch('zones/'.$zone_identifier.'/settings/min_tls_version', $data); + } } From 1ef7c3f00a5ad0e3c70e4a6ef1d06452311021b3 Mon Sep 17 00:00:00 2001 From: Darryl Date: Wed, 4 Dec 2019 14:59:15 -0500 Subject: [PATCH 17/22] change composer to my own fork --- composer.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index ca6fd74..258e9d1 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "jamesryanbell/cloudflare", + "name": "fmp777/cloudflare", "description": "CloudFlare API - PHP", "license": "MIT", "keywords": ["cloudflare", "api"], @@ -9,10 +9,11 @@ "email": "james@james-bell.co.uk" } ], - "require": {}, + "require": { + "jamesryanbell/cloudflare": "dev-master" + }, "require-dev": { "phpunit/phpunit": "< 6", - "satooshi/php-coveralls": "dev-master" }, "autoload": { "psr-4": { From d45cb7a5adf4a1701b4ef28829762c7f8eb7e078 Mon Sep 17 00:00:00 2001 From: Darryl Date: Wed, 4 Dec 2019 15:02:50 -0500 Subject: [PATCH 18/22] bonehead json mistake --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 258e9d1..6c34eb2 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "jamesryanbell/cloudflare": "dev-master" }, "require-dev": { - "phpunit/phpunit": "< 6", + "phpunit/phpunit": "< 6" }, "autoload": { "psr-4": { From b1548ac67ac872f456ccf55417c04fa0f014cad0 Mon Sep 17 00:00:00 2001 From: Darryl Date: Wed, 4 Dec 2019 15:04:38 -0500 Subject: [PATCH 19/22] composer update remove dependency --- composer.lock | 63 --------------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/composer.lock b/composer.lock index ce687e5..916e6e4 100644 --- a/composer.lock +++ b/composer.lock @@ -977,69 +977,6 @@ ], "time": "2016-10-10T12:19:37+00:00" }, - { - "name": "satooshi/php-coveralls", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "d5124af8bd6464144d550906cce46bd0df78f428" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/d5124af8bd6464144d550906cce46bd0df78f428", - "reference": "d5124af8bd6464144d550906cce46bd0df78f428", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.0", - "php": "^5.5 || ^7.0", - "psr/log": "^1.0", - "symfony/config": "^2.1 || ^3.0", - "symfony/console": "^2.1 || ^3.0", - "symfony/stopwatch": "^2.0 || ^3.0", - "symfony/yaml": "^2.0 || ^3.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "bin/coveralls" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Satooshi\\": "src/Satooshi/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2017-02-25 12:14:18" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", From a9fb2a3f055bb318d44c45a03f3683ce47bff355 Mon Sep 17 00:00:00 2001 From: Darryl Date: Wed, 4 Dec 2019 15:08:11 -0500 Subject: [PATCH 20/22] composer update --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6c34eb2..d582769 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "jamesryanbell/cloudflare": "dev-master" + "fmp777/cloudflare": "dev-master" }, "require-dev": { "phpunit/phpunit": "< 6" From 341722a4b1853011433ed81dea93a491aa4dc325 Mon Sep 17 00:00:00 2001 From: fmp777 Date: Fri, 24 Sep 2021 09:47:28 -0600 Subject: [PATCH 21/22] Update Settings.php - Added the undocumented API feature bot_fight_mode and change_bot_fight_mode to Settings --- src/CloudFlare/Zone/Settings.php | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index 144def0..60f1dfd 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -916,4 +916,38 @@ public function change_min_tls_version($zone_identifier, $value = null) return $this->patch('zones/'.$zone_identifier.'/settings/min_tls_version', $data); } + + /** + * Bot Fight Mode + * Gets the current settings object for bot fight mode ->result->fight_mode + * + * @param string $zone_identifier API item identifier tag + */ + public function bot_fight_mode($zone_identifier) + { + return $this->get('zones/' . $zone_identifier . '/bot_management'); + } + + /** + * Change Bot Fight Mode + * Enable or disable bot fight mode + * undocumented by cloudflare + * + * @param string $zone_identifier API item identifier tag + * @param string|null $value Value of the zone setting (default: off) + * + * @return mixed + */ + public function change_bot_fight_mode($zone_identifier, $value = true) + { + # doesn't follow other standards of on/off + if ($value === 'off' || $value === false || $value === 0) $value = false; + else $value = true; + + $data = [ + 'fight_mode' => $value, + ]; + + return $this->put('zones/' . $zone_identifier . '/bot_management', $data); + } } From f4c266581a749dee758832ac6c08d7cec7e6f5e0 Mon Sep 17 00:00:00 2001 From: Darryl Date: Thu, 14 Apr 2022 21:25:37 -0400 Subject: [PATCH 22/22] Remove double slashes from API calls if they make it in somehow, double slashes breaks the API calls --- src/CloudFlare/Api.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CloudFlare/Api.php b/src/CloudFlare/Api.php index 21f152f..7b0d84b 100644 --- a/src/CloudFlare/Api.php +++ b/src/CloudFlare/Api.php @@ -176,6 +176,8 @@ protected function request($path, array $data = [], $method = 'get') return !is_null($val); }); + $path = preg_replace('|^/|', '', $path); // FMP EDIT - a slash in path double slashes the api call - hackfix it + $path = str_replace('//', '/', $path); // FMP EDIT - remove any other double slashes made in error $url = 'https://api.cloudflare.com/client/v4/'.$path; $default_curl_options = [