From 471c4bacf34d148250c03500f5b6ac27704443c2 Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 19 Aug 2015 22:13:50 +0000 Subject: [PATCH] More updates --- lib/influxdb-php/.travis.yml | 14 - lib/influxdb-php/CONTRIBUTE.md | 50 -- lib/influxdb-php/LICENSE | 20 - lib/influxdb-php/README.md | 348 -------- lib/influxdb-php/composer.json | 47 - lib/influxdb-php/composer.lock | 812 ----------------- lib/influxdb-php/phpunit.xml | 29 - lib/influxdb-php/src/InfluxDB/Client.php | 324 ------- .../src/InfluxDB/Client/Admin.php | 158 ---- .../src/InfluxDB/Client/Exception.php | 12 - lib/influxdb-php/src/InfluxDB/Database.php | 232 ----- .../src/InfluxDB/Database/Exception.php | 10 - .../src/InfluxDB/Database/RetentionPolicy.php | 48 - .../src/InfluxDB/Driver/DriverInterface.php | 49 -- .../src/InfluxDB/Driver/Exception.php | 16 - .../src/InfluxDB/Driver/Guzzle.php | 134 --- .../InfluxDB/Driver/QueryDriverInterface.php | 22 - lib/influxdb-php/src/InfluxDB/Driver/UDP.php | 90 -- lib/influxdb-php/src/InfluxDB/Exception.php | 10 - lib/influxdb-php/src/InfluxDB/Point.php | 126 --- .../src/InfluxDB/Query/Builder.php | 271 ------ .../src/InfluxDB/Query/Exception.php | 10 - lib/influxdb-php/src/InfluxDB/ResultSet.php | 106 --- lib/influxdb-php/tests/bootstrap.php | 7 - lib/influxdb-php/tests/unit/AbstractTest.php | 124 --- lib/influxdb-php/tests/unit/AdminTest.php | 72 -- lib/influxdb-php/tests/unit/ClientTest.php | 60 -- lib/influxdb-php/tests/unit/DatabaseTest.php | 100 --- lib/influxdb-php/tests/unit/PointTest.php | 30 - lib/influxdb-php/tests/unit/ResultSetTest.php | 141 --- .../tests/unit/input.example.json | 17 - .../tests/unit/result-no-tags.example.json | 47 - .../tests/unit/result-test-users.example.json | 24 - .../tests/unit/result.example.json | 59 -- lib/influxdb-php/vendor/autoload.php | 7 - lib/influxdb-php/vendor/bin/coveralls | 1 - lib/influxdb-php/vendor/bin/test-reporter | 1 - .../vendor/codeclimate/php-test-reporter | 1 - .../vendor/composer/ClassLoader.php | 413 --------- lib/influxdb-php/vendor/composer/LICENSE | 21 - .../vendor/composer/autoload_classmap.php | 9 - .../vendor/composer/autoload_files.php | 12 - .../vendor/composer/autoload_namespaces.php | 16 - .../vendor/composer/autoload_psr4.php | 21 - .../vendor/composer/autoload_real.php | 55 -- .../vendor/composer/installed.json | 821 ------------------ lib/influxdb-php/vendor/guzzle/guzzle | 1 - lib/influxdb-php/vendor/guzzlehttp/guzzle | 1 - lib/influxdb-php/vendor/guzzlehttp/promises | 1 - .../vendor/guzzlehttp/psr7/.travis.yml | 20 - .../vendor/guzzlehttp/psr7/CHANGELOG.md | 19 - .../vendor/guzzlehttp/psr7/LICENSE | 19 - .../vendor/guzzlehttp/psr7/Makefile | 13 - .../vendor/guzzlehttp/psr7/README.md | 580 ------------- .../vendor/guzzlehttp/psr7/composer.json | 35 - .../vendor/guzzlehttp/psr7/phpunit.xml.dist | 17 - .../guzzlehttp/psr7/src/AppendStream.php | 233 ----- .../guzzlehttp/psr7/src/BufferStream.php | 137 --- .../guzzlehttp/psr7/src/CachingStream.php | 125 --- .../guzzlehttp/psr7/src/DroppingStream.php | 42 - .../vendor/guzzlehttp/psr7/src/FnStream.php | 149 ---- .../guzzlehttp/psr7/src/InflateStream.php | 29 - .../guzzlehttp/psr7/src/LazyOpenStream.php | 39 - .../guzzlehttp/psr7/src/LimitStream.php | 155 ---- .../guzzlehttp/psr7/src/MessageTrait.php | 158 ---- .../guzzlehttp/psr7/src/MultipartStream.php | 153 ---- .../guzzlehttp/psr7/src/NoSeekStream.php | 22 - .../vendor/guzzlehttp/psr7/src/PumpStream.php | 165 ---- .../vendor/guzzlehttp/psr7/src/Request.php | 149 ---- .../vendor/guzzlehttp/psr7/src/Response.php | 130 --- .../vendor/guzzlehttp/psr7/src/Stream.php | 245 ------ .../psr7/src/StreamDecoratorTrait.php | 149 ---- .../guzzlehttp/psr7/src/StreamWrapper.php | 121 --- .../vendor/guzzlehttp/psr7/src/Uri.php | 604 ------------- .../vendor/guzzlehttp/psr7/src/functions.php | 799 ----------------- .../psr7/tests/AppendStreamTest.php | 186 ---- .../psr7/tests/BufferStreamTest.php | 63 -- .../psr7/tests/CachingStreamTest.php | 137 --- .../psr7/tests/DroppingStreamTest.php | 26 - .../guzzlehttp/psr7/tests/FnStreamTest.php | 90 -- .../guzzlehttp/psr7/tests/FunctionsTest.php | 574 ------------ .../psr7/tests/InflateStreamTest.php | 16 - .../psr7/tests/LazyOpenStreamTest.php | 64 -- .../guzzlehttp/psr7/tests/LimitStreamTest.php | 166 ---- .../psr7/tests/MultipartStreamTest.php | 214 ----- .../psr7/tests/NoSeekStreamTest.php | 40 - .../guzzlehttp/psr7/tests/PumpStreamTest.php | 72 -- .../guzzlehttp/psr7/tests/RequestTest.php | 157 ---- .../guzzlehttp/psr7/tests/ResponseTest.php | 139 --- .../psr7/tests/StreamDecoratorTraitTest.php | 137 --- .../guzzlehttp/psr7/tests/StreamTest.php | 161 ---- .../psr7/tests/StreamWrapperTest.php | 100 --- .../vendor/guzzlehttp/psr7/tests/UriTest.php | 245 ------ .../guzzlehttp/psr7/tests/bootstrap.php | 11 - lib/influxdb-php/vendor/psr/http-message | 1 - lib/influxdb-php/vendor/psr/log/LICENSE | 19 - .../vendor/psr/log/Psr/Log/AbstractLogger.php | 120 --- .../log/Psr/Log/InvalidArgumentException.php | 7 - .../vendor/psr/log/Psr/Log/LogLevel.php | 18 - .../psr/log/Psr/Log/LoggerAwareInterface.php | 17 - .../psr/log/Psr/Log/LoggerAwareTrait.php | 22 - .../psr/log/Psr/Log/LoggerInterface.php | 114 --- .../vendor/psr/log/Psr/Log/LoggerTrait.php | 131 --- .../vendor/psr/log/Psr/Log/NullLogger.php | 27 - .../log/Psr/Log/Test/LoggerInterfaceTest.php | 116 --- lib/influxdb-php/vendor/psr/log/README.md | 45 - lib/influxdb-php/vendor/psr/log/composer.json | 17 - .../vendor/satooshi/php-coveralls/.travis.yml | 33 - .../satooshi/php-coveralls/CHANGELOG.md | 64 -- .../vendor/satooshi/php-coveralls/LICENSE | 22 - .../vendor/satooshi/php-coveralls/README.md | 263 ------ .../vendor/satooshi/php-coveralls/build.xml | 208 ----- .../php-coveralls/build/config/apigen.neon | 5 - .../php-coveralls/build/config/phpcs.xml | 31 - .../php-coveralls/build/config/phpmd.xml | 45 - .../satooshi/php-coveralls/composer.json | 43 - .../php-coveralls/composer/bin/coveralls | 34 - .../satooshi/php-coveralls/phpunit.xml.dist | 37 - .../CoverallsBundle/Console/Application.php | 92 -- .../Entity/ArrayConvertable.php | 17 - .../CoverallsV1Bundle/Api/CoverallsApi.php | 74 -- .../Bundle/CoverallsV1Bundle/Api/Jobs.php | 175 ---- .../Collector/CiEnvVarsCollector.php | 152 ---- .../Collector/CloverXmlCoverageCollector.php | 137 --- .../Collector/GitInfoCollector.php | 151 ---- .../Command/CoverallsV1JobsCommand.php | 359 -------- .../Config/Configuration.php | 366 -------- .../CoverallsV1Bundle/Config/Configurator.php | 229 ----- .../Config/CoverallsConfiguration.php | 68 -- .../CoverallsV1Bundle/Entity/Coveralls.php | 22 - .../CoverallsV1Bundle/Entity/Git/Commit.php | 237 ----- .../CoverallsV1Bundle/Entity/Git/Git.php | 119 --- .../CoverallsV1Bundle/Entity/Git/Remote.php | 97 --- .../CoverallsV1Bundle/Entity/JsonFile.php | 598 ------------- .../CoverallsV1Bundle/Entity/Metrics.php | 143 --- .../CoverallsV1Bundle/Entity/SourceFile.php | 176 ---- .../src/Contrib/Component/File/Path.php | 165 ---- .../Contrib/Component/Log/ConsoleLogger.php | 41 - .../Component/System/Git/GitCommand.php | 57 -- .../Component/System/SystemCommand.php | 90 -- .../Console/ApplicationTest.php | 119 --- .../Bundle/CoverallsV1Bundle/Api/JobsTest.php | 655 -------------- .../Collector/CiEnvVarsCollectorTest.php | 206 ----- .../CloverXmlCoverageCollectorTest.php | 177 ---- .../Collector/GitInfoCollectorTest.php | 226 ----- .../Command/CoverallsV1JobsCommandTest.php | 126 --- .../Config/ConfigurationTest.php | 407 --------- .../Config/ConfiguratorTest.php | 355 -------- .../Config/yaml/coverage_clover.yml | 1 - .../Config/yaml/coverage_clover_array.yml | 3 - .../Config/yaml/coverage_clover_glob.yml | 1 - .../Config/yaml/coverage_clover_invalid.yml | 1 - .../Config/yaml/coverage_clover_not_found.yml | 1 - .../CoverallsV1Bundle/Config/yaml/empty.yml | 0 .../Config/yaml/exclude_no_stmt_false.yml | 1 - .../Config/yaml/exclude_no_stmt_invalid.yml | 1 - .../Config/yaml/exclude_no_stmt_true.yml | 1 - .../Config/yaml/json_path.yml | 1 - .../Config/yaml/json_path_not_found.yml | 1 - .../CoverallsV1Bundle/Config/yaml/src_dir.yml | 1 - .../Config/yaml/src_dir_not_found.yml | 1 - .../Entity/Git/CommitTest.php | 220 ----- .../CoverallsV1Bundle/Entity/Git/GitTest.php | 89 -- .../Entity/Git/RemoteTest.php | 103 --- .../CoverallsV1Bundle/Entity/JsonFileTest.php | 725 ---------------- .../CoverallsV1Bundle/Entity/MetricsTest.php | 117 --- .../Entity/SourceFileTest.php | 138 --- .../tests/Contrib/Component/File/PathTest.php | 442 ---------- .../Component/Log/ConsoleLoggerTest.php | 38 - .../Component/System/Git/GitCommandTest.php | 142 --- .../php-coveralls/tests/prj/coveralls.yml | 1 - .../tests/prj/files/AbstractClass.php | 6 - .../tests/prj/files/TestInterface.php | 6 - .../php-coveralls/tests/prj/files/test.php | 9 - .../php-coveralls/tests/prj/files/test2.php | 10 - .../satooshi/php-coveralls/travis.phpunit.xml | 35 - .../satooshi/php-coveralls/travis/empty | 0 lib/influxdb-php/vendor/symfony/config | 1 - lib/influxdb-php/vendor/symfony/console | 1 - .../vendor/symfony/event-dispatcher | 1 - lib/influxdb-php/vendor/symfony/filesystem | 1 - lib/influxdb-php/vendor/symfony/stopwatch | 1 - lib/influxdb-php/vendor/symfony/yaml | 1 - 183 files changed, 21281 deletions(-) delete mode 100644 lib/influxdb-php/.travis.yml delete mode 100644 lib/influxdb-php/CONTRIBUTE.md delete mode 100644 lib/influxdb-php/LICENSE delete mode 100644 lib/influxdb-php/README.md delete mode 100644 lib/influxdb-php/composer.json delete mode 100644 lib/influxdb-php/composer.lock delete mode 100644 lib/influxdb-php/phpunit.xml delete mode 100644 lib/influxdb-php/src/InfluxDB/Client.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Client/Admin.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Client/Exception.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Database.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Database/Exception.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Database/RetentionPolicy.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Driver/DriverInterface.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Driver/Exception.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Driver/Guzzle.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Driver/QueryDriverInterface.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Driver/UDP.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Exception.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Point.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Query/Builder.php delete mode 100644 lib/influxdb-php/src/InfluxDB/Query/Exception.php delete mode 100644 lib/influxdb-php/src/InfluxDB/ResultSet.php delete mode 100644 lib/influxdb-php/tests/bootstrap.php delete mode 100644 lib/influxdb-php/tests/unit/AbstractTest.php delete mode 100644 lib/influxdb-php/tests/unit/AdminTest.php delete mode 100644 lib/influxdb-php/tests/unit/ClientTest.php delete mode 100644 lib/influxdb-php/tests/unit/DatabaseTest.php delete mode 100644 lib/influxdb-php/tests/unit/PointTest.php delete mode 100644 lib/influxdb-php/tests/unit/ResultSetTest.php delete mode 100644 lib/influxdb-php/tests/unit/input.example.json delete mode 100644 lib/influxdb-php/tests/unit/result-no-tags.example.json delete mode 100644 lib/influxdb-php/tests/unit/result-test-users.example.json delete mode 100644 lib/influxdb-php/tests/unit/result.example.json delete mode 100644 lib/influxdb-php/vendor/autoload.php delete mode 120000 lib/influxdb-php/vendor/bin/coveralls delete mode 120000 lib/influxdb-php/vendor/bin/test-reporter delete mode 160000 lib/influxdb-php/vendor/codeclimate/php-test-reporter delete mode 100644 lib/influxdb-php/vendor/composer/ClassLoader.php delete mode 100644 lib/influxdb-php/vendor/composer/LICENSE delete mode 100644 lib/influxdb-php/vendor/composer/autoload_classmap.php delete mode 100644 lib/influxdb-php/vendor/composer/autoload_files.php delete mode 100644 lib/influxdb-php/vendor/composer/autoload_namespaces.php delete mode 100644 lib/influxdb-php/vendor/composer/autoload_psr4.php delete mode 100644 lib/influxdb-php/vendor/composer/autoload_real.php delete mode 100644 lib/influxdb-php/vendor/composer/installed.json delete mode 160000 lib/influxdb-php/vendor/guzzle/guzzle delete mode 160000 lib/influxdb-php/vendor/guzzlehttp/guzzle delete mode 160000 lib/influxdb-php/vendor/guzzlehttp/promises delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/.travis.yml delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/CHANGELOG.md delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/LICENSE delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/Makefile delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/README.md delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/composer.json delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/phpunit.xml.dist delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/AppendStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/BufferStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/CachingStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/DroppingStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/FnStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/InflateStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/LimitStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/MessageTrait.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/MultipartStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/PumpStream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/Request.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/Response.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/Stream.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/Uri.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/src/functions.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FnStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FunctionsTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/RequestTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/ResponseTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/UriTest.php delete mode 100644 lib/influxdb-php/vendor/guzzlehttp/psr7/tests/bootstrap.php delete mode 160000 lib/influxdb-php/vendor/psr/http-message delete mode 100644 lib/influxdb-php/vendor/psr/log/LICENSE delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/AbstractLogger.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/InvalidArgumentException.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/LogLevel.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerAwareInterface.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerAwareTrait.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerInterface.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerTrait.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/NullLogger.php delete mode 100644 lib/influxdb-php/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php delete mode 100644 lib/influxdb-php/vendor/psr/log/README.md delete mode 100644 lib/influxdb-php/vendor/psr/log/composer.json delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/.travis.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/CHANGELOG.md delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/LICENSE delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/README.md delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/build.xml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/apigen.neon delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpcs.xml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpmd.xml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/composer.json delete mode 100755 lib/influxdb-php/vendor/satooshi/php-coveralls/composer/bin/coveralls delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/phpunit.xml.dist delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/File/Path.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/empty.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/coveralls.yml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/AbstractClass.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/TestInterface.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/test.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/test2.php delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/travis.phpunit.xml delete mode 100644 lib/influxdb-php/vendor/satooshi/php-coveralls/travis/empty delete mode 160000 lib/influxdb-php/vendor/symfony/config delete mode 160000 lib/influxdb-php/vendor/symfony/console delete mode 160000 lib/influxdb-php/vendor/symfony/event-dispatcher delete mode 160000 lib/influxdb-php/vendor/symfony/filesystem delete mode 160000 lib/influxdb-php/vendor/symfony/stopwatch delete mode 160000 lib/influxdb-php/vendor/symfony/yaml diff --git a/lib/influxdb-php/.travis.yml b/lib/influxdb-php/.travis.yml deleted file mode 100644 index c71c55677b..0000000000 --- a/lib/influxdb-php/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php -php: - - 5.5 - - 5.6 - -install: - - composer install - -addons: - code_climate: - repo_token: 5371d86d298d66eb9007cc8de462d7063e58f6dd85e430928834736edee479a9 - -after_script: - - vendor/bin/test-reporter diff --git a/lib/influxdb-php/CONTRIBUTE.md b/lib/influxdb-php/CONTRIBUTE.md deleted file mode 100644 index d9348f142d..0000000000 --- a/lib/influxdb-php/CONTRIBUTE.md +++ /dev/null @@ -1,50 +0,0 @@ -/* CONTRIBUTE */ - -This is the contribute.md of influxdb-php. Great to have you here. - -Here are a few ways you can help make this project better. - -# Contribute.md - -## Team members - -* Stephen "TheCodeAssassin" Hoogendijk -* Daniel "danibrutal" Martinez - -## Helping out - -We appreciate any efforts to help us writing this library. You can contribute in any of the following ways: - -* Documentation -* Unit tests -* New features -* Bug fixed -* Reviewing pull requests - -## Guidelines - -In order for your pull requests to get accepted we hold all the code to the following criteria: - -* PSR-1/PSR-2 compliant -* Do not use left hand conditions such as false == $something -* New features need to be documented -* Breaking changes should be well highlighted and explained in the PR -* Only short-array syntax should be used for arrays -* Use regular string concatenation for single-variable strings, and sprintf for multi-variable strings -* Do not align variable assignments - -The following is optional but encouraged: - -* Code should be documented -* Code should be unit tested -* Do not write conditions like false === $something, rather $something === false. - -## Special thanks - -We would like to thank the following people for helping to make this library possible: - -* InfluxDB Community -* LeaseWeb Technologies -* Paul Dix -* Sean Beckett -* CentaurWarchief \ No newline at end of file diff --git a/lib/influxdb-php/LICENSE b/lib/influxdb-php/LICENSE deleted file mode 100644 index 38ee24919e..0000000000 --- a/lib/influxdb-php/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 InfluxDB - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/influxdb-php/README.md b/lib/influxdb-php/README.md deleted file mode 100644 index 0972aed643..0000000000 --- a/lib/influxdb-php/README.md +++ /dev/null @@ -1,348 +0,0 @@ -# influxdb-php -## InfluxDB client library for PHP -[![Build Status](https://travis-ci.org/influxdb/influxdb-php.svg?branch=master)](https://travis-ci.org/influxdb/influxdb-php) -[![Code Climate](https://codeclimate.com/github/influxdb/influxdb-php/badges/gpa.svg)](https://codeclimate.com/github/influxdb/influxdb-php) -[![Test Coverage](https://codeclimate.com/github/influxdb/influxdb-php/badges/coverage.svg)](https://codeclimate.com/github/influxdb/influxdb-php/coverage) - -### Overview - -A easy to use library for using InfluxDB with PHP. - -The influxdb-php library was created to have php port of the python influxdb client. -This way there will be a common abstraction library between different programming languages. - -### Installation - -Installation can be done with composer: - -composer require influxdb/influxdb-php:dev-master - -### NOTE for PHP 5.3 and PHP 5.4 users - -If you use either PHP 5.3 and PHP 5.4, the 0.1.x release is still supported (bug fixes and new release fixes). -The 0.1.x branch will work on PHP 5.3 and PHP 5.4 but doesn't contain all the features that the 1.0.0 release has such as UDP support. - -### Getting started - -Initialize a new client object: - -```php - -$client = new InfluxDB\Client($host, $port); - - -``` - -This will create a new client object which you can use to read and write points to InfluxDB. - -It's also possible to create a client from a DSN (Data Source Name): - -```php - - // directly get the database object - $database = InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $host, $port, $dbname)); - - // get the client to retrieve other databases - $client = $database->getClient(); - -``` - -### Reading - -To fetch records from InfluxDB you can do a query directly on a database: - -```php - - // fetch the database - $database = $client->selectDB('influx_test_db'); - - // executing a query will yield a resultset object - $result = $database->query('select * from test_metric LIMIT 5'); - - // get the points from the resultset yields an array - $points = $result->getPoints(); - -``` - -It's also possible to use the QueryBuilder object. This is a class that simplifies the process of building queries. - -```php - - // retrieve points with the query builder - $result = $database->getQueryBuilder() - ->select('cpucount') - ->from('test_metric') - ->limit(2) - ->getResultSet() - ->getPoints(); - - - // get the query from the QueryBuilder - $query = $database->getQueryBuilder() - ->select('cpucount') - ->from('test_metric') - ->getQuery(); - -``` - -### Writing data - -Writing data is done by providing an array of points to the writePoints method on a database: - -```php - - // create an array of points - $points = array( - new Point( - 'test_metric', // name of the measurement - 0.64, // the measurement value - ['host' => 'server01', 'region' => 'us-west'], // optional tags - ['cpucount' => 10], // optional additional fields - 1435255849 // Time precision has to be set to seconds! - ), - new Point( - 'test_metric', // name of the measurement - 0.84, // the measurement value - ['host' => 'server01', 'region' => 'us-west'], // optional tags - ['cpucount' => 10], // optional additional fields - 1435255849 // Time precision has to be set to seconds! - ) - ); - - // we are writing unix timestamps, which have a second precision - $result = $database->writePoints($points, Database::PRECISION_SECONDS); - -``` - -It's possible to add multiple [fields](https://influxdb.com/docs/v0.9/concepts/key_concepts.html) when writing -measurements to InfluxDB. The point class allows one to easily write data in batches to influxDB. - -The name of a measurement and the value are mandatory. Additional fields, tags and a timestamp are optional. -InfluxDB takes the current time as the default timestamp. - -You can also write multiple fields to a measurement without specifying a value: - -```php - $points = [ - new Point( - 'instance', // the name of the measurement - null, // measurement value - ['host' => 'server01', 'region' => 'us-west'], // measurement tags - ['cpucount' => 10, 'free' => 1], // measurement fields - exec('date +%s%N') // timestamp in nanoseconds on Linux ONLY - ), - new Point( - 'instance', // the name of the measurement - null, // measurement value - ['host' => 'server01', 'region' => 'us-west'], // measurement tags - ['cpucount' => 10, 'free' => 2], // measurement fields - exec('date +%s%N') // timestamp in nanoseconds on Linux ONLY - ) - ]; - -``` - -#### Writing data using udp - -First, set your InfluxDB host to support incoming UDP sockets: - -```ini -[udp] - enabled = true - bind-address = ":4444" - database = "test_db" -``` - -Then, configure the UDP driver in the client: - -```php - - // set the UDP driver in the client - $client->setDriver(new \InfluxDB\Driver\UDP($client->getHost(), 4444)); - - $points = [ - new Point( - 'test_metric', - 0.84, - ['host' => 'server01', 'region' => 'us-west'], - ['cpucount' => 10], - exec('date +%s%N') // this will produce a nanosecond timestamp on Linux ONLY - ) - ]; - - // now just write your points like you normally would - $result = $database->writePoints($points); -``` - -Or simply use a DSN (Data Source Name) to send metrics using UDP: - -```php - - // get a database object using a DSN (Data Source Name) - $database = \InfluxDB\Client::fromDSN('udp+influxdb://username:pass@localhost:4444/test123'); - - // write your points - $result = $database->writePoints($points); -``` - -*Note:* It is import to note that precision will be *ignored* when you use UDP. You should always use nanosecond -precision when writing data to InfluxDB using UDP. - -#### Timestamp precision - -It's important to provide the correct precision when adding a timestamp to a Point object. This is because -if you specify a timestamp in seconds and the default (nanosecond) precision is set; the entered timestamp will be invalid. - -```php - // Points will require a nanosecond precision (this is default as per influxdb standard) - $newPoints = $database->writePoints($points); - - // Points will require second precision - $newPoints = $database->writePoints($points, Database::PRECISION_SECONDS); - - // Points will require microsecond precision - $newPoints = $database->writePoints($points, Database::PRECISION_MICROSECONDS); -``` - -Please note that `exec('date + %s%N')` does NOT work under MacOS; you can use PHP's `microtime` to get a timestamp with microsecond precision, like such: - -```php - list( $usec, $sec ) = explode(' ', microtime() ); - $timestamp = sprintf( '%d%06d', $sec, $usec*1000000 ); -``` - -### Creating databases - -When creating a database a default retention policy is added. This retention policy does not have a duration -so the data will be flushed with the memory. - -This library makes it easy to provide a retention policy when creating a database: - -```php - - // create the client - $client = new \InfluxDB\Client($host, $port, '', ''); - - // select the database - $database = $client->selectDB('influx_test_db'); - - // create the database with a retention policy - $result = $database->create(new RetentionPolicy('test', '5d', 1, true)); - - // check if a database exists then create it if it doesn't - $database = $client->selectDB('test_db'); - - if (!$database->exists()) { - $database->create(new RetentionPolicy('test', '1d', 2, true)); - } - -``` - -You can also alter retention policies: - -```php - $database->alterRetentionPolicy(new RetentionPolicy('test', '2d', 5, true)); -``` - -and list them: - -```php - $result = $database->listRetentionPolicies(); -``` - -You can add more retention policies to a database: - -```php - $result = $database->createRetentionPolicy(new RetentionPolicy('test2', '30d', 1, true)); -``` - -### Client functions - -Some functions are too general for a database. So these are available in the client: - -```php - - // list users - $result = $client->listUsers(); - - // list databases - $result = $client->listDatabases(); -``` - -### Admin functionality - -You can use the client's $client->admin functionality to administer InfluxDB via the API. - -```php - // add a new user without privileges - $client->admin->createUser('testuser123', 'testpassword'); - - // add a new user with ALL cluster-wide privileges - $client->admin->createUser('admin_user', 'password', \InfluxDB\Client\Admin::PRIVILEGE_ALL); - - // drop user testuser123 - $client->admin->dropUser('testuser123'); -``` - -List all the users: - -```php - // show a list of all users - $results = $client->admin->showUsers(); - - // show users returns a ResultSet object - $users = $results->getPoints(); -``` - -#### Granting and revoking privileges - -Granting permissions can be done on both the database level and cluster-wide. -To grant a user specific privileges on a database, provide a database object or a database name. - -```php - - // grant permissions using a database object - $database = $client->selectDB('test_db'); - $client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', $database); - - // give user testuser123 read privileges on database test_db - $client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', 'test_db'); - - // revoke user testuser123's read privileges on database test_db - $client->admin->revoke(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', 'test_db'); - - // grant a user cluster-wide privileges - $client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123'); - - // Revoke an admin's cluster-wide privileges - $client->admin->revoke(\InfluxDB\Client\Admin::PRIVILEGE_ALL, 'admin_user'); - -``` - -## Todo - -* More unit tests -* Increase documentation (wiki?) -* Add more features to the query builder -* Add validation to RetentionPolicy - - -## Changelog - -####1.0.1 -* Added support for authentication in the guzzle driver -* Added admin functionality - -####1.0.0 -* -BREAKING CHANGE- Dropped support for PHP 5.3 and PHP 5.4 -* Allowing for custom drivers -* UDP support - -####0.1.2 -* Added exists method to Database class -* Added time precision to database class - -####0.1.1 -* Merged repository to influxdb/influxdb-php -* Added unit test for createRetentionPolicy -* -BREAKING CHANGE- changed $client->db to $client->selectDB diff --git a/lib/influxdb-php/composer.json b/lib/influxdb-php/composer.json deleted file mode 100644 index 7af0fafe8f..0000000000 --- a/lib/influxdb-php/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "influxdb/influxdb-php", - "description": "InfluxDB client library for PHP", - "license": "MIT", - "keywords": [ - "influxdb", - "client", - "time series", - "influxdb client", - "influxdb class", - "influxdb library" - ], - "minimum-stability": "dev", - "authors": [ - { - "name": "Stephen Hoogendijk", - "email": "stephen@tca0.nl" - }, - { - "name": "Daniel Martinez", - "email": "danimartcas@hotmail.com" - } - ], - "require": { - "php": ">=5.5", - "guzzlehttp/guzzle": "6.*", - "symfony/event-dispatcher": "2.*" - }, - "require-dev": { - "codeclimate/php-test-reporter": "0.*", - "symfony/config": "~2.8", - "symfony/console": "~2.8", - "symfony/filesystem": "~2.8", - "symfony/stopwatch": "~2.8", - "symfony/yaml": "~2.8" - }, - "autoload": { - "psr-4": { - "InfluxDB\\": "src/InfluxDB" - } - }, - "autoload-dev": { - "psr-4": { - "InfluxDB\\Test\\": "tests" - } - } -} diff --git a/lib/influxdb-php/composer.lock b/lib/influxdb-php/composer.lock deleted file mode 100644 index a2fb5ba284..0000000000 --- a/lib/influxdb-php/composer.lock +++ /dev/null @@ -1,812 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "ee3f2e2a4eb50f8de36c6efbff37fe71", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "1879fbe853b0c64d109e369c7aeff09849e62d1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1879fbe853b0c64d109e369c7aeff09849e62d1e", - "reference": "1879fbe853b0c64d109e369c7aeff09849e62d1e", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.0-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-07-10 20:04:21" - }, - { - "name": "guzzlehttp/promises", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "f596be052ef429a16b2f640812fcf84392dd38f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f596be052ef429a16b2f640812fcf84392dd38f7", - "reference": "f596be052ef429a16b2f640812fcf84392dd38f7", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2015-06-30 16:39:54" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/af0e1758de355eb113917ad79c3c0e3604bce4bd", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2015-06-24 19:55:15" - }, - { - "name": "psr/http-message", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/d7246885b7fe4cb5a2786bda34362d2f0e40b730", - "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/phpunit-bridge": "~2.7|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-06-24 15:32:32" - } - ], - "packages-dev": [ - { - "name": "codeclimate/php-test-reporter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/codeclimate/php-test-reporter.git", - "reference": "418ae782307841ac50fe26daa4cfe04520b0de9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/418ae782307841ac50fe26daa4cfe04520b0de9c", - "reference": "418ae782307841ac50fe26daa4cfe04520b0de9c", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3", - "satooshi/php-coveralls": "0.6.*", - "symfony/console": ">=2.0" - }, - "require-dev": { - "ext-xdebug": "*", - "phpunit/phpunit": "3.7.*@stable" - }, - "bin": [ - "composer/bin/test-reporter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "CodeClimate\\Component": "src/", - "CodeClimate\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Code Climate", - "email": "hello@codeclimate.com", - "homepage": "https://codeclimate.com" - } - ], - "description": "PHP client for reporting test coverage to Code Climate", - "homepage": "https://github.com/codeclimate/php-test-reporter", - "keywords": [ - "codeclimate", - "coverage" - ], - "time": "2015-04-18 14:43:54" - }, - { - "name": "guzzle/guzzle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/b3f5050cb6270c7a728a0b74ac2de50a262b3e02", - "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-04-29 17:06:53" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "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": "2013-05-04 08:07:33" - }, - { - "name": "symfony/config", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "358ec929e494b6f12d8508d88357cbd7383a10ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/358ec929e494b6f12d8508d88357cbd7383a10ca", - "reference": "358ec929e494b6f12d8508d88357cbd7383a10ca", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:11:14" - }, - { - "name": "symfony/console", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a", - "reference": "fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/phpunit-bridge": "~2.7|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-07-16 12:22:14" - }, - { - "name": "symfony/filesystem", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e", - "reference": "9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2015-07-09 16:11:14" - }, - { - "name": "symfony/stopwatch", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "cd5f0dc1d3d0e2c83461dad77e20a9186beb6146" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/cd5f0dc1d3d0e2c83461dad77e20a9186beb6146", - "reference": "cd5f0dc1d3d0e2c83461dad77e20a9186beb6146", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 18:24:26" - }, - { - "name": "symfony/yaml", - "version": "2.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "000e7fc2653335cd42c6d21405dac1c74224a387" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/000e7fc2653335cd42c6d21405dac1c74224a387", - "reference": "000e7fc2653335cd42c6d21405dac1c74224a387", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-07-01 14:16:54" - } - ], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.5" - }, - "platform-dev": [] -} diff --git a/lib/influxdb-php/phpunit.xml b/lib/influxdb-php/phpunit.xml deleted file mode 100644 index 9913a0eda8..0000000000 --- a/lib/influxdb-php/phpunit.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - tests - - - - - src/ - - - - - - - - - - diff --git a/lib/influxdb-php/src/InfluxDB/Client.php b/lib/influxdb-php/src/InfluxDB/Client.php deleted file mode 100644 index b724c63f04..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Client.php +++ /dev/null @@ -1,324 +0,0 @@ -host = (string) $host; - $this->port = (int) $port; - $this->username = (string) $username; - $this->password = (string) $password; - $this->timeout = (int) $timeout; - $this->verifySSL = (bool) $verifySSL; - - if ($ssl) { - $this->scheme = 'https'; - $this->options['verify'] = $verifySSL; - } - - // the the base URI - $this->baseURI = sprintf('%s://%s:%d', $this->scheme, $this->host, $this->port); - - // set the default driver to guzzle - $this->driver = new Guzzle( - new \GuzzleHttp\Client( - [ - 'timeout' => $this->timeout, - 'base_uri' => $this->baseURI, - 'verify' => $this->verifySSL - ] - ) - ); - - $this->admin = new Admin($this); - } - - /** - * Use the given database - * - * @param string $name - * @return Database - */ - public function selectDB($name) - { - return new Database($name, $this); - } - - /** - * Query influxDB - * - * @param string $database - * @param string $query - * @param array $parameters - * - * @return ResultSet - * @throws Exception - */ - public function query($database, $query, $parameters = []) - { - - if (!$this->driver instanceof QueryDriverInterface) { - throw new Exception('The currently configured driver does not support query operations'); - } - - if ($database) { - $parameters['db'] = $database; - } - - $driver = $this->getDriver(); - - $parameters = [ - 'url' => 'query?' . http_build_query(array_merge(['q' => $query], $parameters)), - 'database' => $database, - 'method' => 'get' - ]; - - // add authentication to the driver if needed - if (!empty($this->username) && !empty($this->password)) { - $parameters += ['auth' => [$this->username, $this->password]]; - } - - $driver->setParameters($parameters); - - try { - // perform the query and return the resultset - return $driver->query(); - - } catch (DriverException $e) { - throw new Exception('Query has failed', $e->getCode(), $e); - } - } - - /** - * List all the databases - */ - public function listDatabases() - { - $result = $this->query(null, 'SHOW DATABASES')->getPoints(); - - return $this->pointsToArray($result); - } - - /** - * List all the users - * - * @return array - * @throws Exception - */ - public function listUsers() - { - $result = $this->query(null, 'SHOW USERS')->getPoints(); - - return $this->pointsToArray($result); - } - - /** - * Build the client from a dsn - * Examples: - * - * https+influxdb://username:pass@localhost:8086/databasename - * udp+influxdb://username:pass@localhost:4444/databasename - * - * @param string $dsn - * @param int $timeout - * @param bool $verifySSL - * -*@return Client|Database - * @throws ClientException - */ - public static function fromDSN($dsn, $timeout = 0, $verifySSL = false) - { - $connParams = parse_url($dsn); - $schemeInfo = explode('+', $connParams['scheme']); - $dbName = null; - $modifier = null; - $scheme = $schemeInfo[0]; - - if (isset($schemeInfo[1])) { - $modifier = strtolower($schemeInfo[0]); - $scheme = $schemeInfo[1]; - } - - if ($scheme != 'influxdb') { - throw new ClientException($scheme . ' is not a valid scheme'); - } - - $ssl = $modifier === 'https' ? true : false; - $dbName = $connParams['path'] ? substr($connParams['path'], 1) : null; - - $client = new self( - $connParams['host'], - $connParams['port'], - $connParams['user'], - $connParams['pass'], - $ssl, - $verifySSL, - $timeout - ); - - // set the UDP driver when the DSN specifies UDP - if ($modifier == 'udp') { - $client->setDriver(new UDP($connParams['host'], $connParams['port'])); - } - - return ($dbName ? $client->selectDB($dbName) : $client); - } - - /** - * @return mixed - */ - public function getBaseURI() - { - return $this->baseURI; - } - - /** - * @return int - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * @param Driver\DriverInterface $driver - */ - public function setDriver(DriverInterface $driver) - { - $this->driver = $driver; - } - - /** - * @return DriverInterface|QueryDriverInterface - */ - public function getDriver() - { - return $this->driver; - } - - /** - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * @param Point[] $points - * @return array - */ - protected function pointsToArray(array $points) - { - $names = []; - - foreach ($points as $item) { - $names[] = $item['name']; - } - - return $names; - } - -} diff --git a/lib/influxdb-php/src/InfluxDB/Client/Admin.php b/lib/influxdb-php/src/InfluxDB/Client/Admin.php deleted file mode 100644 index b62782a38c..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Client/Admin.php +++ /dev/null @@ -1,158 +0,0 @@ -client = $client; - } - - /** - * Create a user - * - * @param string $username - * @param string $password - * - * @param string $privilege - * - * @throws \InfluxDB\Exception - * @return \InfluxDB\ResultSet - */ - public function createUser($username, $password, $privilege = null) - { - $query = sprintf('CREATE USER %s WITH PASSWORD \'%s\'', $username, $password); - - if ($privilege) { - $query .= " WITH $privilege PRIVILEGES"; - } - - return $this->client->query(null, $query); - } - - /** - * @param string $username - * - * @return \InfluxDB\ResultSet - * @throws \InfluxDB\Exception - */ - public function dropUser($username) - { - return $this->client->query(null, 'DROP USER ' . $username); - } - - /** - * Change a users password - * - * @param string $username - * @param string $newPassword - * - * @return \InfluxDB\ResultSet - * @throws \InfluxDB\Exception - */ - public function changeUserPassword($username, $newPassword) - { - return $this->client->query(null, "SET PASSWORD FOR $username = '$newPassword'"); - } - - /** - * Shows a list of all the users - * - * @return \InfluxDB\ResultSet - * @throws \InfluxDB\Exception - */ - public function showUsers() - { - return $this->client->query(null, "SHOW USERS"); - } - - /** - * Grants permissions - * - * @param string $privilege - * @param string $username - * @param Database|string $database - * - * @return \InfluxDB\ResultSet - */ - public function grant($privilege, $username, $database = null) - { - return $this->executePrivilege('GRANT', $privilege, $username, $database); - } - - /** - * Revokes permissions - * - * @param string $privilege - * @param string $username - * @param Database|string $database - * - * @throws \InfluxDB\Exception - * @return \InfluxDB\ResultSet - */ - public function revoke($privilege, $username, $database = null) - { - return $this->executePrivilege('REVOKE', $privilege, $username, $database); - } - - /** - * @param string $type - * @param string $privilege - * @param string $username - * @param Database|string $database - * - * @throws \InfluxDB\Exception - * @return \InfluxDB\ResultSet - */ - private function executePrivilege($type, $privilege, $username, $database = null) - { - - if (!in_array($privilege, [self::PRIVILEGE_READ, self::PRIVILEGE_WRITE, self::PRIVILEGE_ALL])) { - throw new Exception($privilege . ' is not a valid privileges, allowed privileges: READ, WRITE, ALL'); - } - - if ($privilege != self::PRIVILEGE_ALL && !$database) { - throw new Exception('Only grant ALL cluster-wide privileges are allowed'); - } - - $database = ($database instanceof Database ? $database->getName() : (string) $database); - - $query = "$type $privilege"; - - if ($database) { - $query .= sprintf(' ON %s ', $database); - } else { - $query .= " PRIVILEGES "; - } - - if ($username && $type == 'GRANT') { - $query .= "TO $username"; - } elseif ($username && $type == 'REVOKE') { - $query .= "FROM $username"; - } - - return $this->client->query(null, $query); - } -} \ No newline at end of file diff --git a/lib/influxdb-php/src/InfluxDB/Client/Exception.php b/lib/influxdb-php/src/InfluxDB/Client/Exception.php deleted file mode 100644 index 0674e86868..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Client/Exception.php +++ /dev/null @@ -1,12 +0,0 @@ -name = (string) $name; - $this->client = $client; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Query influxDB - * - * @param string $query - * @param array $params - * @return ResultSet - * @throws Exception - */ - public function query($query, $params = []) - { - return $this->client->query($this->name, $query, $params); - } - - /** - * Create this database - * - * @param RetentionPolicy $retentionPolicy - * @return ResultSet - * @throws DatabaseException - * @throws Exception - */ - public function create(RetentionPolicy $retentionPolicy = null) - { - try { - $this->query(sprintf('CREATE DATABASE %s', $this->name)); - - if ($retentionPolicy) { - $this->createRetentionPolicy($retentionPolicy); - } - } catch (\Exception $e) { - throw new DatabaseException( - sprintf('Failed to created database %s', $this->name), - $e->getCode(), - $e - ); - } - } - - /** - * @param RetentionPolicy $retentionPolicy - * @return ResultSet - */ - public function createRetentionPolicy(RetentionPolicy $retentionPolicy) - { - return $this->query($this->getRetentionPolicyQuery('CREATE', $retentionPolicy)); - } - - /** - * Writes points into InfluxDB - * - * @param Point[] $points Array of points - * @param string $precision The timestamp precision (defaults to nanoseconds) - * @return bool - * @throws Exception - */ - public function writePoints(array $points, $precision = self::PRECISION_NANOSECONDS) - { - $payload = array_map( - function (Point $point) { - return (string) $point; - }, - $points - ); - - try { - $driver = $this->client->getDriver(); - - $parameters = [ - 'url' => sprintf('write?db=%s&precision=%s', $this->name, $precision), - 'database' => $this->name, - 'method' => 'post' - ]; - - // add authentication to the driver if needed - if (!empty($this->username) && !empty($this->password)) { - $parameters += ['auth' => [$this->username, $this->password]]; - } - - $driver->setParameters($parameters); - - // send the points to influxDB - $driver->write(implode(PHP_EOL, $payload)); - - return $driver->isSuccess(); - - } catch (\Exception $e) { - throw new Exception($e->getMessage(), $e->getCode()); - } - } - - /** - * @return bool - */ - public function exists() - { - $databases = $this->client->listDatabases(); - - return in_array($this->name, $databases); - } - - /** - * @param RetentionPolicy $retentionPolicy - */ - public function alterRetentionPolicy(RetentionPolicy $retentionPolicy) - { - $this->query($this->getRetentionPolicyQuery('ALTER', $retentionPolicy)); - } - - /** - * @return array - * @throws Exception - */ - public function listRetentionPolicies() - { - return $this->query(sprintf('SHOW RETENTION POLICIES %s', $this->name))->getPoints(); - } - - /** - * Drop this database - */ - public function drop() - { - $this->query(sprintf('DROP DATABASE %s', $this->name)); - } - - /** - * Retrieve the query builder - * - * @return QueryBuilder - */ - public function getQueryBuilder() - { - return new QueryBuilder($this); - } - - /** - * @return Client - */ - public function getClient() - { - return $this->client; - } - - /** - * @param string $method - * @param RetentionPolicy $retentionPolicy - * @return string - */ - protected function getRetentionPolicyQuery($method, RetentionPolicy $retentionPolicy) - { - if (!in_array($method, ['CREATE', 'ALTER'])) { - throw new \InvalidArgumentException(sprintf('%s is not a valid method')); - } - - $query = sprintf( - '%s RETENTION POLICY %s ON %s DURATION %s REPLICATION %s', - $method, - $retentionPolicy->name, - $this->name, - $retentionPolicy->duration, - $retentionPolicy->replication - ); - - if ($retentionPolicy->default) { - $query .= " DEFAULT"; - } - - return $query; - } -} diff --git a/lib/influxdb-php/src/InfluxDB/Database/Exception.php b/lib/influxdb-php/src/InfluxDB/Database/Exception.php deleted file mode 100644 index f5142b49ea..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Database/Exception.php +++ /dev/null @@ -1,10 +0,0 @@ -name = (string) $name; - $this->duration = $duration; - $this->replication = (int) $replication; - $this->default = (bool) $default; - } -} diff --git a/lib/influxdb-php/src/InfluxDB/Driver/DriverInterface.php b/lib/influxdb-php/src/InfluxDB/Driver/DriverInterface.php deleted file mode 100644 index fc3a2c2f96..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Driver/DriverInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - 'name of the database', - * 'url' => 'URL to the resource', - * 'method' => 'HTTP method used' - * ] - * - * @param array $parameters - * - * @return mixed - */ - public function setParameters(array $parameters); - - /** - * Send the data - * - * @param $data - * - * @return mixed - */ - public function write($data = null); - - /** - * Should return if sending the data was successful - * - * @return bool - */ - public function isSuccess(); - -} diff --git a/lib/influxdb-php/src/InfluxDB/Driver/Exception.php b/lib/influxdb-php/src/InfluxDB/Driver/Exception.php deleted file mode 100644 index 237766eeef..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Driver/Exception.php +++ /dev/null @@ -1,16 +0,0 @@ -httpClient = $client; - } - - /** - * Called by the client write() method, will pass an array of required parameters such as db name - * - * will contain the following parameters: - * - * [ - * 'database' => 'name of the database', - * 'url' => 'URL to the resource', - * 'method' => 'HTTP method used' - * ] - * - * @param array $parameters - * - * @return mixed - */ - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - } - - /** - * Send the data - * - * @param $data - * - * @throws Exception - * @return mixed - */ - public function write($data = null) - { - $this->response = $this->httpClient->post($this->parameters['url'], $this->getRequestParameters($data)); - } - - /** - * @throws Exception - * @return ResultSet - */ - public function query() - { - - $response = $this->httpClient->get($this->parameters['url'], $this->getRequestParameters()); - - $raw = (string) $response->getBody(); - - $responseJson = json_encode($raw); - - if (isset($responseJson->error)) { - throw new Exception($responseJson->error); - } - - return new ResultSet($raw); - - } - - /** - * Should return if sending the data was successful - * - * @return bool - */ - public function isSuccess() - { - return in_array($this->response->getStatusCode(), ['200', '204']); - } - - /** - * @param null $data - * - * @return array - */ - protected function getRequestParameters($data = null) - { - $requestParameters = ['http_errors' => false]; - - if ($data) { - $requestParameters += ['body' => $data]; - } - - if (isset($this->parameters['auth'])) { - $requestParameters += ['auth' => $this->parameters['auth']]; - } - - return $requestParameters; - } -} diff --git a/lib/influxdb-php/src/InfluxDB/Driver/QueryDriverInterface.php b/lib/influxdb-php/src/InfluxDB/Driver/QueryDriverInterface.php deleted file mode 100644 index 0966cecc3d..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Driver/QueryDriverInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -config['host'] = $host; - $this->config['port'] = $port; - - - } - - /** - * Called by the client write() method, will pass an array of required parameters such as db name - * - * will contain the following parameters: - * - * [ - * 'database' => 'name of the database', - * 'url' => 'URL to the resource', - * 'method' => 'HTTP method used' - * ] - * - * @param array $parameters - * - * @return mixed - */ - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - } - - /** - * Send the data - * - * @param $data - * - * @return mixed - */ - public function write($data = null) - { - - $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']); - - // stream the data using UDP and suppress any errors - $stream = @stream_socket_client($host); - @stream_socket_sendto($stream, $data); - @fclose($stream); - - return true; - } - - /** - * Should return if sending the data was successful - * - * @return bool - */ - public function isSuccess() - { - return true; - } -} \ No newline at end of file diff --git a/lib/influxdb-php/src/InfluxDB/Exception.php b/lib/influxdb-php/src/InfluxDB/Exception.php deleted file mode 100644 index 868dd74c48..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Exception.php +++ /dev/null @@ -1,10 +0,0 @@ -measurement = (string) $measurement; - $this->tags = $tags; - $this->fields = $additionalFields; - - if ($value) { - $this->fields['value'] = $value; - } - - if ($timestamp && !$this->isValidTimeStamp($timestamp)) { - throw new DatabaseException(sprintf('%s is not a valid timestamp', $timestamp)); - } - - $this->timestamp = $timestamp; - } - - /** - * @see: https://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html - * - * Should return this format - * 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000' - */ - public function __toString() - { - - $string = $this->measurement; - - if (count($this->tags) > 0) { - $string .= ',' . $this->arrayToString($this->tags); - } - - $string .= ' ' . $this->arrayToString($this->fields); - - if ($this->timestamp) { - $string .= ' '.$this->timestamp; - } - - return $string; - } - - /** - * @param array $arr - * @return string - */ - private function arrayToString(array $arr) - { - $strParts = []; - - foreach ($arr as $key => $value) { - $strParts[] = sprintf('%s=%s', $key, $value); - } - - return implode(',', $strParts); - } - - /** - * @param int $timestamp - * @return bool - */ - private function isValidTimeStamp($timestamp) - { - if ((int) $timestamp === $timestamp) { - return true; - } - - if ($timestamp <= PHP_INT_MAX && $timestamp >= ~PHP_INT_MAX) { - return true; - } - - return false; - } -} diff --git a/lib/influxdb-php/src/InfluxDB/Query/Builder.php b/lib/influxdb-php/src/InfluxDB/Query/Builder.php deleted file mode 100644 index 1060bc39d4..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Query/Builder.php +++ /dev/null @@ -1,271 +0,0 @@ -percentile(95)->setTimeRange($timeFrom, $timeTo)->getResult(); - * - * $series->select('*')->from('*')->getResult(); - * - * @todo add inner join - * @todo add merge - * - * @package InfluxDB\Query - * @author Stephen "TheCodeAssassin" Hoogendijk - */ -class Builder -{ - /** - * @var Database - */ - protected $db; - - /** - * @var string - */ - protected $selection = '*'; - - /** - * @var string[] - */ - protected $where = array(); - - /** - * @var string - */ - protected $startTime; - - /** - * @var string - */ - protected $endTime; - - /** - * @var string - */ - protected $metric; - - /** - * @var string - */ - protected $limitClause = ''; - - /** - * @param Database $db - */ - public function __construct(Database $db) - { - $this->db = $db; - } - - /** - * @param string $metric The metric to select (required) - * @return $this - */ - public function from($metric) - { - $this->metric = $metric; - - return $this; - } - - /** - * Custom select method - * - * example: - * - * $series->select('sum(value)', - * - * @param string $customSelect - * @return $this - */ - public function select($customSelect) - { - $this->selection = $customSelect; - - return $this; - } - - /** - * @param array $conditions - * - * Example: array('time > now()', 'time < now() -1d'); - * - * @return $this - */ - public function where(array $conditions) - { - foreach ($conditions as $condition) { - $this->where[] = $condition; - } - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function count($field = 'type') - { - $this->selection = sprintf('count(%s)', $field); - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function median($field = 'type') - { - $this->selection = sprintf('median(%s)', $field); - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function mean($field = 'type') - { - $this->selection = sprintf('mean(%s)', $field); - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function sum($field = 'type') - { - $this->selection = sprintf('sum(%s)', $field); - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function first($field = 'type') - { - $this->selection = sprintf('first(%s)', $field); - - return $this; - } - - /** - * @param string $field - * @return $this - */ - public function last($field = 'type') - { - $this->selection = sprintf('last(%s)', $field); - - return $this; - } - - /** - * Set's the time range to select data from - * - * @param int $from - * @param int $to - * @return $this - */ - public function setTimeRange($from, $to) - { - $fromDate = date('Y-m-d H:i:s', (int) $from); - $toDate = date('Y-m-d H:i:s', (int) $to); - - $this->where(array("time > '$fromDate'", "time < '$toDate'")); - - return $this; - } - - /** - * @param int $percentile Percentage to select (for example 95 for 95th percentile billing) - * - * @return $this - */ - public function percentile($percentile = 95) - { - $this->selection = sprintf('percentile(value, %d)', (int) $percentile); - - return $this; - } - - /** - * Limit the ResultSet to n records - * - * @param int $count - * - * @return $this - */ - public function limit($count) - { - $this->limitClause = sprintf(' LIMIT %s', (int) $count); - - return $this; - } - - /** - * @return string - */ - public function getQuery() - { - return $this->parseQuery(); - } - - /** - * Gets the result from the database (builds the query) - * - * @return ResultSet - */ - public function getResultSet() - { - return $this->db->query($this->parseQuery()); - } - - /** - * @return string - */ - protected function parseQuery() - { - $query = sprintf("SELECT %s FROM %s", $this->selection, $this->metric); - - if (! $this->metric) { - throw new \InvalidArgumentException('No metric provided to from()'); - } - - for ($i = 0; $i < count($this->where); $i++) { - $selection = 'WHERE'; - - if ($i > 0) { - $selection = 'AND'; - } - - $clause = $this->where[$i]; - $query .= ' ' . $selection . ' ' . $clause; - - } - - if ($this->limitClause) { - $query .= $this->limitClause; - } - - return $query; - } -} diff --git a/lib/influxdb-php/src/InfluxDB/Query/Exception.php b/lib/influxdb-php/src/InfluxDB/Query/Exception.php deleted file mode 100644 index 448a41e979..0000000000 --- a/lib/influxdb-php/src/InfluxDB/Query/Exception.php +++ /dev/null @@ -1,10 +0,0 @@ -parsedResults = json_decode((string) $raw, true); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new \InvalidArgumentException('Invalid JSON'); - } - - // There was an error in the query thrown by influxdb - if (isset($this->parsedResults['error'])) { - throw new ClientException($this->parsedResults['error']); - } - - // Check if there are errors in the first serie - if (isset($this->parsedResults['results'][0]['error'])) { - throw new ClientException($this->parsedResults['results'][0]['error']); - } - } - - /** - * @param $metricName - * @param array $tags - * @return array $points - */ - public function getPoints($metricName = '', array $tags = array()) - { - $points = []; - $series = $this->getSeries(); - - foreach ($series as $serie) { - if ((empty($metricName) && empty($tags) - || $serie['name'] == $metricName - || (isset($serie['tags']) && array_intersect($tags, $serie['tags']))) - && isset($serie['values']) - ) { - $points = array_merge($points, $this->getPointsFromSerie($serie)); - } - } - - return $points; - } - - /** - * @see: https://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html - * - * results is an array of objects, one for each query, - * each containing the keys for a series - * - * @throws Exception - * @return array $series - */ - public function getSeries() - { - $series = array_map( - function ($object) { - if (isset($object['error'])) { - throw new ClientException($object['error']); - } - - return isset($object['series']) ? $object['series'] : []; - }, - $this->parsedResults['results'] - ); - - return array_shift($series); - } - - /** - * @param array $serie - * @return array - */ - private function getPointsFromSerie(array $serie) - { - $points = []; - - foreach ($serie['values'] as $point) { - $points[] = array_combine($serie['columns'], $point); - } - - return $points; - } -} diff --git a/lib/influxdb-php/tests/bootstrap.php b/lib/influxdb-php/tests/bootstrap.php deleted file mode 100644 index f94d45bf44..0000000000 --- a/lib/influxdb-php/tests/bootstrap.php +++ /dev/null @@ -1,7 +0,0 @@ -mockClient = $this->getMockBuilder('\InfluxDB\Client') - ->disableOriginalConstructor() - ->getMock(); - - $this->resultData = file_get_contents(dirname(__FILE__) . '/result.example.json'); - - $this->mockClient->expects($this->any()) - ->method('getBaseURI') - ->will($this->returnValue($this->equalTo('http://localhost:8086'))); - - $this->mockClient->expects($this->any()) - ->method('query') - ->will($this->returnValue(new ResultSet($this->resultData))); - - $httpMockClient = new Guzzle($this->buildHttpMockClient('')); - - // make sure the client has a valid driver - $this->mockClient->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($httpMockClient)); - - $this->database = new Database('influx_test_db', $this->mockClient); - - } - - /** - * @return mixed - */ - public function getMockResultSet() - { - return $this->mockResultSet; - } - - /** - * @param mixed $mockResultSet - */ - public function setMockResultSet($mockResultSet) - { - $this->mockResultSet = $mockResultSet; - } - - - /** - * @return GuzzleClient - */ - public function buildHttpMockClient($body) - { - // Create a mock and queue two responses. - $mock = new MockHandler([new Response(200, array(), $body)]); - - $handler = HandlerStack::create($mock); - return new GuzzleClient(['handler' => $handler]); - } - - /** - * @return string - */ - public function getEmptyResult() - { - return $this->emptyResult; - } - - /** - * @param bool $emptyResult - * - * @return PHPUnit_Framework_MockObject_MockObject|Client - */ - public function getClientMock($emptyResult = false) - { - $mockClient = $this->getMockBuilder('\InfluxDB\Client') - ->disableOriginalConstructor() - ->getMock(); - - if ($emptyResult) { - $mockClient->expects($this->once()) - ->method('query') - ->will($this->returnValue(new ResultSet($this->getEmptyResult()))); - } - - return $mockClient; - } -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/AdminTest.php b/lib/influxdb-php/tests/unit/AdminTest.php deleted file mode 100644 index 889874f4c6..0000000000 --- a/lib/influxdb-php/tests/unit/AdminTest.php +++ /dev/null @@ -1,72 +0,0 @@ -getAdminObject(true); - - $this->assertEquals( - new ResultSet($this->emptyResult), - $adminObject->createUser('test', 'test', Client\Admin::PRIVILEGE_ALL) - ); - } - - public function testChangeUserPassword() - { - $adminObject = $this->getAdminObject(true); - - $this->assertEquals( - new ResultSet($this->emptyResult), - $adminObject->changeUserPassword('test', 'test') - ); - } - - public function testShowUsers() - { - $testJson = file_get_contents(dirname(__FILE__) . '/result-test-users.example.json'); - - $clientMock = $this->getClientMock(); - $testResult = new ResultSet($testJson); - - $clientMock->expects($this->once()) - ->method('query') - ->will($this->returnValue($testResult)); - - $adminMock = new Client\Admin($clientMock); - - $this->assertEquals($testResult, $adminMock->showUsers()); - } - - /** - * @return Client\Admin - */ - private function getAdminObject() - { - return new Client\Admin($this->getClientMock(true)); - } - -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/ClientTest.php b/lib/influxdb-php/tests/unit/ClientTest.php deleted file mode 100644 index 09f420d1bf..0000000000 --- a/lib/influxdb-php/tests/unit/ClientTest.php +++ /dev/null @@ -1,60 +0,0 @@ -assertEquals($client->getBaseURI(), 'http://localhost:8086'); - } - - public function testSelectDbShouldReturnDatabaseInstance() - { - $client = new Client('localhost', 8086); - - $dbName = 'test-database'; - $database = $client->selectDB($dbName); - - $this->assertInstanceOf('\InfluxDB\Database', $database); - - $this->assertEquals($dbName, $database->getName()); - } - - - /** - */ - public function testGuzzleQuery() - { - $client = new Client('localhost', 8086); - $query = "some-bad-query"; - - $bodyResponse = file_get_contents(dirname(__FILE__) . '/result.example.json'); - $httpMockClient = $this->buildHttpMockClient($bodyResponse); - - $client->setDriver(new Guzzle($httpMockClient)); - - /** @var \InfluxDB\ResultSet $result */ - $result = $client->query(null, $query); - - $this->assertInstanceOf('\InfluxDB\ResultSet', $result); - } - -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/DatabaseTest.php b/lib/influxdb-php/tests/unit/DatabaseTest.php deleted file mode 100644 index e410385476..0000000000 --- a/lib/influxdb-php/tests/unit/DatabaseTest.php +++ /dev/null @@ -1,100 +0,0 @@ -resultData = file_get_contents(dirname(__FILE__) . '/result.example.json'); - - $this->mockClient->expects($this->any()) - ->method('listDatabases') - ->will($this->returnValue(array('test123', 'test'))); - - $this->dataToInsert = file_get_contents(dirname(__FILE__) . '/input.example.json'); - - } - - /** - * - */ - public function testQuery() - { - $testResultSet = new ResultSet($this->resultData); - $this->assertEquals($this->database->query('SELECT * FROM test_metric'), $testResultSet); - } - - public function testCreateRetentionPolicy() - { - $retentionPolicy = new Database\RetentionPolicy('test', '1d', 1, true); - - $mockClient = $this->getClientMock(true); - - $database = new Database('test', $mockClient); - - $this->assertEquals($database->createRetentionPolicy($retentionPolicy), new ResultSet($this->getEmptyResult())); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEmptyDatabaseName() - { - new Database(null, $this->mockClient); - } - - public function testExists() - { - $database = new Database('test', $this->mockClient); - - $this->assertEquals($database->exists(), true); - } - - - public function testNotExists() - { - $database = new Database('test_not_exists', $this->mockClient); - - $this->assertEquals($database->exists(), false); - } - - public function testWritePointsInASingleCall() - { - $point1 = new Point( - 'cpu_load_short', - 0.64, - array('host' => 'server01', 'region' => 'us-west'), - array('cpucount' => 10), - 1435222310 - ); - - $point2 = new Point( - 'cpu_load_short', - 0.84 - ); - - $this->assertEquals(true, $this->database->writePoints(array($point1, $point2))); - } -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/PointTest.php b/lib/influxdb-php/tests/unit/PointTest.php deleted file mode 100644 index eaee63fe75..0000000000 --- a/lib/influxdb-php/tests/unit/PointTest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'server01', 'region' => 'us-west'), - array('cpucount' => 10), - 1435222310 - ); - - $this->assertEquals($expected, (string) $point); - } -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/ResultSetTest.php b/lib/influxdb-php/tests/unit/ResultSetTest.php deleted file mode 100644 index 4c04bf1e9b..0000000000 --- a/lib/influxdb-php/tests/unit/ResultSetTest.php +++ /dev/null @@ -1,141 +0,0 @@ -resultSet = new ResultSet($resultJsonExample); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionIfJSONisNotValid() - { - $invalidJSON = 'foo'; - - new ResultSet($invalidJSON); - } - - /** - * Throws Exception if something went wrong with influxDB - * @expectedException \InfluxDB\Exception - */ - public function testThrowsInfluxDBException() - { - - $errorResult = <<resultSet = new ResultSet($resultJsonExample); - - $measurementName = 'cpu_load_short'; - $expectedNumberOfPoints = 2; - - $points = $this->resultSet->getPoints($measurementName); - - $this->assertTrue(is_array($points)); - - $this->assertCount($expectedNumberOfPoints, $points); - } - - /** - * We can get points from measurement - */ - public function testGetPoints() - { - $expectedNumberOfPoints = 3; - - $points = $this->resultSet->getPoints(); - - $this->assertTrue( - is_array($points) - ); - - $this->assertCount($expectedNumberOfPoints, $points); - - } - - /** - * We can get points from measurement - */ - public function testGetPointsFromMeasurementName() - { - $measurementName = 'cpu_load_short'; - $expectedNumberOfPoints = 2; - $expectedValueFromFirstPoint = 0.64; - - $points = $this->resultSet->getPoints($measurementName); - - $this->assertTrue( - is_array($points) - ); - - $this->assertCount($expectedNumberOfPoints, $points); - - $somePoint = array_shift($points); - - $this->assertEquals($expectedValueFromFirstPoint, $somePoint['value']); - } - - public function testGetPointsFromTags() - { - $tags = array("host" => "server01"); - $expectedNumberOfPoints = 2; - - $points = $this->resultSet->getPoints('', $tags); - - $this->assertTrue(is_array($points)); - $this->assertCount($expectedNumberOfPoints, $points); - } - - public function testGetPointsFromNameAndTags() - { - $tags = array("host" => "server01"); - $expectedNumberOfPoints = 2; - - $points = $this->resultSet->getPoints('', $tags); - - $this->assertTrue(is_array($points)); - $this->assertCount($expectedNumberOfPoints, $points); - } -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/input.example.json b/lib/influxdb-php/tests/unit/input.example.json deleted file mode 100644 index f47806261d..0000000000 --- a/lib/influxdb-php/tests/unit/input.example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "database": "mydb", - "retentionPolicy": "mypolicy", - "points": [ - { - "measurement": "cpu_load_short", - "tags": { - "host": "server01", - "region": "us-west" - }, - "time": "2009-11-10T23:00:00Z", - "fields": { - "value": 0.64 - } - } - ] -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/result-no-tags.example.json b/lib/influxdb-php/tests/unit/result-no-tags.example.json deleted file mode 100644 index feba13f256..0000000000 --- a/lib/influxdb-php/tests/unit/result-no-tags.example.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "results": [ - { - "series": [ - { - "name": "cpu_load_short", - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.64 - ] - ] - }, - { - "name": "cpu_load_short", - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.65 - ] - ] - }, - { - "name": "other_serie", - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.66 - ] - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/result-test-users.example.json b/lib/influxdb-php/tests/unit/result-test-users.example.json deleted file mode 100644 index 34f5f999b6..0000000000 --- a/lib/influxdb-php/tests/unit/result-test-users.example.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "results": [ - { - "series": [ - { - "columns": [ - "user", - "admin" - ], - "values": [ - [ - "test1", - true - ], - [ - "test2", - false - ] - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/lib/influxdb-php/tests/unit/result.example.json b/lib/influxdb-php/tests/unit/result.example.json deleted file mode 100644 index 8603cae10f..0000000000 --- a/lib/influxdb-php/tests/unit/result.example.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "results": [ - { - "series": [ - { - "name": "cpu_load_short", - "tags": { - "host": "server01", - "region": "us-west" - }, - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.64 - ] - ] - }, - { - "name": "cpu_load_short", - "tags": { - "host": "server02", - "region": "us-west" - }, - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.65 - ] - ] - }, - { - "name": "other_serie", - "tags": { - "host": "server01", - "region": "us-west" - }, - "columns": [ - "time", - "value" - ], - "values": [ - [ - "2015-01-29T21:51:28.968422294Z", - 0.66 - ] - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/lib/influxdb-php/vendor/autoload.php b/lib/influxdb-php/vendor/autoload.php deleted file mode 100644 index 78aba2457a..0000000000 --- a/lib/influxdb-php/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - - private $classMapAuthoritative = false; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-0 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/lib/influxdb-php/vendor/composer/LICENSE b/lib/influxdb-php/vendor/composer/LICENSE deleted file mode 100644 index c8d57af8b2..0000000000 --- a/lib/influxdb-php/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2015 Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/lib/influxdb-php/vendor/composer/autoload_classmap.php b/lib/influxdb-php/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153b0d..0000000000 --- a/lib/influxdb-php/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/psr/log'), - 'Guzzle\\Tests' => array($vendorDir . '/guzzle/guzzle/tests'), - 'Guzzle' => array($vendorDir . '/guzzle/guzzle/src'), - 'Contrib\\Component' => array($vendorDir . '/satooshi/php-coveralls/src'), - 'Contrib\\Bundle' => array($vendorDir . '/satooshi/php-coveralls/src'), - 'CodeClimate\\Component' => array($vendorDir . '/codeclimate/php-test-reporter/src'), - 'CodeClimate\\Bundle' => array($vendorDir . '/codeclimate/php-test-reporter/src'), -); diff --git a/lib/influxdb-php/vendor/composer/autoload_psr4.php b/lib/influxdb-php/vendor/composer/autoload_psr4.php deleted file mode 100644 index 4d96789fc6..0000000000 --- a/lib/influxdb-php/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,21 +0,0 @@ - array($vendorDir . '/symfony/yaml'), - 'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'), - 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), - 'InfluxDB\\Test\\' => array($baseDir . '/tests'), - 'InfluxDB\\' => array($baseDir . '/src/InfluxDB'), - 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), - 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), -); diff --git a/lib/influxdb-php/vendor/composer/autoload_real.php b/lib/influxdb-php/vendor/composer/autoload_real.php deleted file mode 100644 index 1054eaf840..0000000000 --- a/lib/influxdb-php/vendor/composer/autoload_real.php +++ /dev/null @@ -1,55 +0,0 @@ - $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(true); - - $includeFiles = require __DIR__ . '/autoload_files.php'; - foreach ($includeFiles as $file) { - composerRequire834a242029a498370312fbad08ece378($file); - } - - return $loader; - } -} - -function composerRequire834a242029a498370312fbad08ece378($file) -{ - require $file; -} diff --git a/lib/influxdb-php/vendor/composer/installed.json b/lib/influxdb-php/vendor/composer/installed.json deleted file mode 100644 index 7fb9e9da48..0000000000 --- a/lib/influxdb-php/vendor/composer/installed.json +++ /dev/null @@ -1,821 +0,0 @@ -[ - { - "name": "psr/http-message", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-05-04 20:22:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "guzzlehttp/psr7", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/af0e1758de355eb113917ad79c3c0e3604bce4bd", - "reference": "af0e1758de355eb113917ad79c3c0e3604bce4bd", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2015-06-24 19:55:15", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ] - }, - { - "name": "guzzlehttp/promises", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "f596be052ef429a16b2f640812fcf84392dd38f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f596be052ef429a16b2f640812fcf84392dd38f7", - "reference": "f596be052ef429a16b2f640812fcf84392dd38f7", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2015-06-30 16:39:54", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ] - }, - { - "name": "guzzlehttp/guzzle", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "1879fbe853b0c64d109e369c7aeff09849e62d1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1879fbe853b0c64d109e369c7aeff09849e62d1e", - "reference": "1879fbe853b0c64d109e369c7aeff09849e62d1e", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "time": "2015-07-10 20:04:21", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.0-dev" - } - }, - "installation-source": "source", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "symfony/event-dispatcher", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/d7246885b7fe4cb5a2786bda34362d2f0e40b730", - "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/phpunit-bridge": "~2.7|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2015-06-24 15:32:32", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/console", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a", - "reference": "fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/phpunit-bridge": "~2.7|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "time": "2015-07-16 12:22:14", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/yaml", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "000e7fc2653335cd42c6d21405dac1c74224a387" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/000e7fc2653335cd42c6d21405dac1c74224a387", - "reference": "000e7fc2653335cd42c6d21405dac1c74224a387", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "time": "2015-07-01 14:16:54", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/stopwatch", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "cd5f0dc1d3d0e2c83461dad77e20a9186beb6146" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/cd5f0dc1d3d0e2c83461dad77e20a9186beb6146", - "reference": "cd5f0dc1d3d0e2c83461dad77e20a9186beb6146", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "time": "2015-07-01 18:24:26", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/filesystem", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e", - "reference": "9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "time": "2015-07-09 16:11:14", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/config", - "version": "2.8.x-dev", - "version_normalized": "2.8.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "358ec929e494b6f12d8508d88357cbd7383a10ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/358ec929e494b6f12d8508d88357cbd7383a10ca", - "reference": "358ec929e494b6f12d8508d88357cbd7383a10ca", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0.0" - }, - "time": "2015-07-09 16:11:14", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com" - }, - { - "name": "psr/log", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "time": "2012-12-21 11:40:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "guzzle/guzzle", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/b3f5050cb6270c7a728a0b74ac2de50a262b3e02", - "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "time": "2015-04-29 17:06:53", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "version_normalized": "0.6.1.0", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "time": "2013-05-04 08:07:33", - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "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" - ] - }, - { - "name": "codeclimate/php-test-reporter", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/codeclimate/php-test-reporter.git", - "reference": "418ae782307841ac50fe26daa4cfe04520b0de9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/418ae782307841ac50fe26daa4cfe04520b0de9c", - "reference": "418ae782307841ac50fe26daa4cfe04520b0de9c", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3", - "satooshi/php-coveralls": "0.6.*", - "symfony/console": ">=2.0" - }, - "require-dev": { - "ext-xdebug": "*", - "phpunit/phpunit": "3.7.*@stable" - }, - "time": "2015-04-18 14:43:54", - "bin": [ - "composer/bin/test-reporter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "CodeClimate\\Component": "src/", - "CodeClimate\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Code Climate", - "email": "hello@codeclimate.com", - "homepage": "https://codeclimate.com" - } - ], - "description": "PHP client for reporting test coverage to Code Climate", - "homepage": "https://github.com/codeclimate/php-test-reporter", - "keywords": [ - "codeclimate", - "coverage" - ] - } -] diff --git a/lib/influxdb-php/vendor/guzzle/guzzle b/lib/influxdb-php/vendor/guzzle/guzzle deleted file mode 160000 index b3f5050cb6..0000000000 --- a/lib/influxdb-php/vendor/guzzle/guzzle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b3f5050cb6270c7a728a0b74ac2de50a262b3e02 diff --git a/lib/influxdb-php/vendor/guzzlehttp/guzzle b/lib/influxdb-php/vendor/guzzlehttp/guzzle deleted file mode 160000 index 1879fbe853..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/guzzle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1879fbe853b0c64d109e369c7aeff09849e62d1e diff --git a/lib/influxdb-php/vendor/guzzlehttp/promises b/lib/influxdb-php/vendor/guzzlehttp/promises deleted file mode 160000 index f596be052e..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/promises +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f596be052ef429a16b2f640812fcf84392dd38f7 diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/.travis.yml b/lib/influxdb-php/vendor/guzzlehttp/psr7/.travis.yml deleted file mode 100644 index b88f8da270..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm - -sudo: false - -install: - - travis_retry composer install --no-interaction --prefer-source - -script: make test - -matrix: - allow_failures: - - php: hhvm - fast_finish: true diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/CHANGELOG.md b/lib/influxdb-php/vendor/guzzlehttp/psr7/CHANGELOG.md deleted file mode 100644 index 8f6d8b2924..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -# CHANGELOG - -## 1.1.0 - 2015-06-24 - -* URIs can now be relative. -* `multipart/form-data` headers are now overridden case-insensitively. -* URI paths no longer encode the following characters because they are allowed - in URIs: "(", ")", "*", "!", "'" -* A port is no longer added to a URI when the scheme is missing and no port is - present. - -## 1.0.0 - 2015-05-19 - -Initial release. - -Currently unsupported: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/LICENSE b/lib/influxdb-php/vendor/guzzlehttp/psr7/LICENSE deleted file mode 100644 index 581d95f920..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/Makefile b/lib/influxdb-php/vendor/guzzlehttp/psr7/Makefile deleted file mode 100644 index 9c210960ef..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit $(TEST) - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage $(TEST) - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/README.md b/lib/influxdb-php/vendor/guzzlehttp/psr7/README.md deleted file mode 100644 index 0b30d5ab09..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/README.md +++ /dev/null @@ -1,580 +0,0 @@ -# PSR-7 Message Implementation - -This repository contains a partial [PSR-7](http://www.php-fig.org/psr/psr-7/) -message implementation, several stream decorators, and some helpful -functionality like query string parsing. Currently missing -ServerRequestInterface and UploadedFileInterface; a pull request for these features is welcome. - - -# Stream implementation - -This package comes with a number of stream implementations and stream -decorators. - - -## AppendStream - -`GuzzleHttp\Psr7\AppendStream` - -Reads from multiple streams, one after the other. - -```php -use GuzzleHttp\Psr7; - -$a = Psr7\stream_for('abc, '); -$b = Psr7\stream_for('123.'); -$composed = new Psr7\AppendStream([$a, $b]); - -$composed->addStream(Psr7\stream_for(' Above all listen to me'). - -echo $composed(); // abc, 123. Above all listen to me. -``` - - -## BufferStream - -`GuzzleHttp\Psr7\BufferStream` - -Provides a buffer stream that can be written to to fill a buffer, and read -from to remove bytes from the buffer. - -This stream returns a "hwm" metadata value that tells upstream consumers -what the configured high water mark of the stream is, or the maximum -preferred size of the buffer. - -```php -use GuzzleHttp\Psr7; - -// When more than 1024 bytes are in the buffer, it will begin returning -// false to writes. This is an indication that writers should slow down. -$buffer = new Psr7\BufferStream(1024); -``` - - -## CachingStream - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\stream_for(fopen('http://www.google.com', 'r')); -$stream = new Psr7\CachingStream($original); - -$stream->read(1024); -echo $stream->tell(); -// 1024 - -$stream->seek(0); -echo $stream->tell(); -// 0 -``` - - -## DroppingStream - -`GuzzleHttp\Psr7\DroppingStream` - -Stream decorator that begins dropping data once the size of the underlying -stream becomes too full. - -```php -use GuzzleHttp\Psr7; - -// Create an empty stream -$stream = Psr7\stream_for(); - -// Start dropping data when the stream has more than 10 bytes -$dropping = new Psr7\DroppingStream($stream, 10); - -$stream->write('01234567890123456789'); -echo $stream; // 0123456789 -``` - - -## FnStream - -`GuzzleHttp\Psr7\FnStream` - -Compose stream implementations based on a hash of functions. - -Allows for easy testing and extension of a provided stream without needing to -to create a concrete class for a simple extension point. - -```php - -use GuzzleHttp\Psr7; - -$stream = Psr7\stream_for('hi'); -$fnStream = Psr7\FnStream::decorate($stream, [ - 'rewind' => function () use ($stream) { - echo 'About to rewind - '; - $stream->rewind(); - echo 'rewound!'; - } -]); - -$fnStream->rewind(); -// Outputs: About to rewind - rewound! -``` - - -## InflateStream - -`GuzzleHttp\Psr7\InflateStream` - -Uses PHP's zlib.inflate filter to inflate deflate or gzipped content. - -This stream decorator skips the first 10 bytes of the given stream to remove -the gzip header, converts the provided stream to a PHP stream resource, -then appends the zlib.inflate filter. The stream is then converted back -to a Guzzle stream resource to be used as a Guzzle stream. - - -## LazyOpenStream - -`GuzzleHttp\Psr7\LazyOpenStream` - -Lazily reads or writes to a file that is opened only after an IO operation -take place on the stream. - -```php -use GuzzleHttp\Psr7; - -$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); -// The file has not yet been opened... - -echo $stream->read(10); -// The file is opened and read from only when needed. -``` - - -## LimitStream - -`GuzzleHttp\Psr7\LimitStream` - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+')); -echo $original->getSize(); -// >>> 1048576 - -// Limit the size of the body to 1024 bytes and start reading from byte 2048 -$stream = new Psr7\LimitStream($original, 1024, 2048); -echo $stream->getSize(); -// >>> 1024 -echo $stream->tell(); -// >>> 0 -``` - - -## MultipartStream - -`GuzzleHttp\Psr7\MultipartStream` - -Stream that when read returns bytes for a streaming multipart or -multipart/form-data stream. - - -## NoSeekStream - -`GuzzleHttp\Psr7\NoSeekStream` - -NoSeekStream wraps a stream and does not allow seeking. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\stream_for('foo'); -$noSeek = new Psr7\NoSeekStream($original); - -echo $noSeek->read(3); -// foo -var_export($noSeek->isSeekable()); -// false -$noSeek->seek(0); -var_export($noSeek->read(3)); -// NULL -``` - - -## PumpStream - -`GuzzleHttp\Psr7\PumpStream` - -Provides a read only stream that pumps data from a PHP callable. - -When invoking the provided callable, the PumpStream will pass the amount of -data requested to read to the callable. The callable can choose to ignore -this value and return fewer or more bytes than requested. Any extra data -returned by the provided callable is buffered internally until drained using -the read() function of the PumpStream. The provided callable MUST return -false when there is no more data to read. - - -## Implementing stream decorators - -Creating a stream decorator is very easy thanks to the -`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that -implement `Psr\Http\Message\StreamInterface` by proxying to an underlying -stream. Just `use` the `StreamDecoratorTrait` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -`read()` method. - -```php -use Psr\Http\Message\StreamInterface; -use GuzzleHttp\Psr7\StreamDecoratorTrait; - -class EofCallbackStream implements StreamInterface -{ - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $cb) - { - $this->stream = $stream; - $this->callback = $cb; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } -} -``` - -This decorator could be added to any existing stream and used like so: - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\stream_for('foo'); - -$eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; -}); - -$eofStream->read(2); -$eofStream->read(1); -// echoes "EOF!" -$eofStream->seek(0); -$eofStream->read(3); -// echoes "EOF!" -``` - - -## PHP StreamWrapper - -You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a -PSR-7 stream as a PHP stream resource. - -Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP -stream from a PSR-7 stream. - -```php -use GuzzleHttp\Psr7\StreamWrapper; - -$stream = GuzzleHttp\Psr7\stream_for('hello!'); -$resource = StreamWrapper::getResource($stream); -echo fread($resource, 6); // outputs hello! -``` - - -# Function API - -There are various functions available under the `GuzzleHttp\Psr7` namespace. - - -## `function str` - -`function str(MessageInterface $message)` - -Returns the string representation of an HTTP message. - -```php -$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); -echo GuzzleHttp\Psr7\str($request); -``` - - -## `function uri_for` - -`function uri_for($uri)` - -This function accepts a string or `Psr\Http\Message\UriInterface` and returns a -UriInterface for the given value. If the value is already a `UriInterface`, it -is returned as-is. - -```php -$uri = GuzzleHttp\Psr7\uri_for('http://example.com'); -assert($uri === GuzzleHttp\Psr7\uri_for($uri)); -``` - - -## `function stream_for` - -`function stream_for($resource = '', array $options = [])` - -Create a new stream based on the input type. - -Options is an associative array that can contain the following keys: - -* - metadata: Array of custom metadata. -* - size: Size of the stream. - -This method accepts the following `$resource` types: - -- `Psr\Http\Message\StreamInterface`: Returns the value as-is. -- `string`: Creates a stream object that uses the given string as the contents. -- `resource`: Creates a stream object that wraps the given PHP stream resource. -- `Iterator`: If the provided value implements `Iterator`, then a read-only - stream object will be created that wraps the given iterable. Each time the - stream is read from, data from the iterator will fill a buffer and will be - continuously called until the buffer is equal to the requested read size. - Subsequent read calls will first read from the buffer and then call `next` - on the underlying iterator until it is exhausted. -- `object` with `__toString()`: If the object has the `__toString()` method, - the object will be cast to a string and then a stream will be returned that - uses the string value. -- `NULL`: When `null` is passed, an empty stream object is returned. -- `callable` When a callable is passed, a read-only stream object will be - created that invokes the given callable. The callable is invoked with the - number of suggested bytes to read. The callable can return any number of - bytes, but MUST return `false` when there is no more data to return. The - stream object that wraps the callable will invoke the callable until the - number of requested bytes are available. Any additional bytes will be - buffered and used in subsequent reads. - -```php -$stream = GuzzleHttp\Psr7\stream_for('foo'); -$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r')); - -$generator function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield ' '; - } -} - -$stream = GuzzleHttp\Psr7\stream_for($generator(100)); -``` - - -## `function parse_header` - -`function parse_header($header)` - -Parse an array of header values containing ";" separated data into an array of -associative arrays representing the header key value pair data of the header. -When a parameter does not contain a value, but just contains a key, this -function will inject a key with a '' string value. - - -## `function normalize_header` - -`function normalize_header($header)` - -Converts an array of header values that may contain comma separated headers -into an array of headers with no comma separated values. - - -## `function modify_request` - -`function modify_request(RequestInterface $request, array $changes)` - -Clone and modify a request with the given changes. This method is useful for -reducing the number of clones needed to mutate a message. - -The changes can be one of: - -- method: (string) Changes the HTTP method. -- set_headers: (array) Sets the given headers. -- remove_headers: (array) Remove the given headers. -- body: (mixed) Sets the given body. -- uri: (UriInterface) Set the URI. -- query: (string) Set the query string value of the URI. -- version: (string) Set the protocol version. - - -## `function rewind_body` - -`function rewind_body(MessageInterface $message)` - -Attempts to rewind a message body and throws an exception on failure. The body -of the message will only be rewound if a call to `tell()` returns a value other -than `0`. - - -## `function try_fopen` - -`function try_fopen($filename, $mode)` - -Safely opens a PHP stream resource using a filename. - -When fopen fails, PHP normally raises a warning. This function adds an error -handler that checks for errors and throws an exception instead. - - -## `function copy_to_string` - -`function copy_to_string(StreamInterface $stream, $maxLen = -1)` - -Copy the contents of a stream into a string until the given number of bytes -have been read. - - -## `function copy_to_stream` - -`function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)` - -Copy the contents of a stream into another stream until the given number of -bytes have been read. - - -## `function hash` - -`function hash(StreamInterface $stream, $algo, $rawOutput = false)` - -Calculate a hash of a Stream. This method reads the entire stream to calculate -a rolling hash (based on PHP's hash_init functions). - - -## `function readline` - -`function readline(StreamInterface $stream, $maxLength = null)` - -Read a line from the stream up to the maximum allowed buffer length. - - -## `function parse_request` - -`function parse_request($message)` - -Parses a request message string into a request object. - - -## `function parse_response` - -`function parse_response($message)` - -Parses a response message string into a response object. - - -## `function parse_query` - -`function parse_query($str, $urlEncoding = true)` - -Parse a query string into an associative array. - -If multiple values are found for the same key, the value of that key value pair -will become an array. This function does not parse nested PHP style arrays into -an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into -`['foo[a]' => '1', 'foo[b]' => '2']`). - - -## `function build_query` - -`function build_query(array $params, $encoding = PHP_QUERY_RFC3986)` - -Build a query string from an array of key value pairs. - -This function can use the return value of parseQuery() to build a query string. -This function does not modify the provided keys when an array is encountered -(like http_build_query would). - - -## `function mimetype_from_filename` - -`function mimetype_from_filename($filename)` - -Determines the mimetype of a file by looking at its extension. - - -## `function mimetype_from_extension` - -`function mimetype_from_extension($extension)` - -Maps a file extensions to a mimetype. - - -# Static URI methods - -The `GuzzleHttp\Psr7\Uri` class has several static methods to manipulate URIs. - - -## `GuzzleHttp\Psr7\Uri::removeDotSegments` - -`public static function removeDotSegments($path) -> UriInterface` - -Removes dot segments from a path and returns the new path. - -See http://tools.ietf.org/html/rfc3986#section-5.2.4 - - -## `GuzzleHttp\Psr7\Uri::resolve` - -`public static function resolve(UriInterface $base, $rel) -> UriInterface` - -Resolve a base URI with a relative URI and return a new URI. - -See http://tools.ietf.org/html/rfc3986#section-5 - - -## `GuzzleHttp\Psr7\Uri::withQueryValue` - -`public static function withQueryValue(UriInterface $uri, $key, $value) -> UriInterface` - -Create a new URI with a specific query string value. - -Any existing query string values that exactly match the provided key are -removed and replaced with the given key value pair. - -Note: this function will convert "=" to "%3D" and "&" to "%26". - - -## `GuzzleHttp\Psr7\Uri::withoutQueryValue` - -`public static function withoutQueryValue(UriInterface $uri, $key, $value) -> UriInterface` - -Create a new URI with a specific query string value removed. - -Any existing query string values that exactly match the provided key are -removed. - -Note: this function will convert "=" to "%3D" and "&" to "%26". - - -## `GuzzleHttp\Psr7\Uri::fromParts` - -`public static function fromParts(array $parts) -> UriInterface` - -Create a `GuzzleHttp\Psr7\Uri` object from a hash of `parse_url` parts. - - -# Not Implemented - -A few aspects of PSR-7 are not implemented in this project. A pull request for -any of these features is welcome: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/composer.json b/lib/influxdb-php/vendor/guzzlehttp/psr7/composer.json deleted file mode 100644 index c1fe18f08b..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "guzzlehttp/psr7", - "type": "library", - "description": "PSR-7 message implementation", - "keywords": ["message", "stream", "http", "uri"], - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": ["src/functions.php"] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/phpunit.xml.dist b/lib/influxdb-php/vendor/guzzlehttp/psr7/phpunit.xml.dist deleted file mode 100644 index 500cd53a0f..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - tests - - - - - src - - src/ - - - - diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/AppendStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/AppendStream.php deleted file mode 100644 index 23039fd794..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/AppendStream.php +++ /dev/null @@ -1,233 +0,0 @@ -addStream($stream); - } - } - - public function __toString() - { - try { - $this->rewind(); - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream) - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents() - { - return copy_to_string($this); - } - - /** - * Closes each attached stream. - * - * {@inheritdoc} - */ - public function close() - { - $this->pos = $this->current = 0; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream - * - * {@inheritdoc} - */ - public function detach() - { - $this->close(); - $this->detached = true; - } - - public function tell() - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * If any of the streams do not return a valid number, then the size of the - * append stream cannot be determined and null is returned. - * - * {@inheritdoc} - */ - public function getSize() - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof() - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - public function rewind() - { - $this->seek(0); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - * - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if (!$this->seekable) { - throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { - throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); - } - - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $i => $stream) { - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); - } - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $result = $this->read(min(8096, $offset - $this->pos)); - if ($result === '') { - break; - } - } - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - * - * {@inheritdoc} - */ - public function read($length) - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - $progressToNext = false; - - while ($remaining > 0) { - - // Progress to the next stream if needed. - if ($progressToNext || $this->streams[$this->current]->eof()) { - $progressToNext = false; - if ($this->current === $total) { - break; - } - $this->current++; - } - - $result = $this->streams[$this->current]->read($remaining); - - // Using a loose comparison here to match on '', false, and null - if ($result == null) { - $progressToNext = true; - continue; - } - - $buffer .= $result; - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return false; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to an AppendStream'); - } - - public function getMetadata($key = null) - { - return $key ? null : []; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/BufferStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/BufferStream.php deleted file mode 100644 index af4d4c2277..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/BufferStream.php +++ /dev/null @@ -1,137 +0,0 @@ -hwm = $hwm; - } - - public function __toString() - { - return $this->getContents(); - } - - public function getContents() - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close() - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - } - - public function getSize() - { - return strlen($this->buffer); - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return true; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a BufferStream'); - } - - public function eof() - { - return strlen($this->buffer) === 0; - } - - public function tell() - { - throw new \RuntimeException('Cannot determine the position of a BufferStream'); - } - - /** - * Reads data from the buffer. - */ - public function read($length) - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string) - { - $this->buffer .= $string; - - // TODO: What should happen here? - if (strlen($this->buffer) >= $this->hwm) { - return false; - } - - return strlen($string); - } - - public function getMetadata($key = null) - { - if ($key == 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/CachingStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/CachingStream.php deleted file mode 100644 index 8fc9d2a68f..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/CachingStream.php +++ /dev/null @@ -1,125 +0,0 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); - } - - public function getSize() - { - return max($this->stream->getSize(), $this->remoteStream->getSize()); - } - - public function rewind() - { - $this->seek(0); - } - - /** - * {@inheritdoc} - * @throws \RuntimeException When seeking with SEEK_END or when seeking - * past the total size of the buffer stream - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence == SEEK_SET) { - $byte = $offset; - } elseif ($whence == SEEK_CUR) { - $byte = $offset + $this->tell(); - } else { - throw new \RuntimeException('CachingStream::seek() supports SEEK_SET and SEEK_CUR'); - } - - // You cannot skip ahead past where you've read from the remote stream - if ($byte > $this->stream->getSize()) { - throw new \RuntimeException( - sprintf('Cannot seek to byte %d when the buffered stream only' - . ' contains %d bytes', $byte, $this->stream->getSize()) - ); - } - - $this->stream->seek($byte); - } - - public function read($length) - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - public function write($string) - { - // When appending to the end of the currently read stream, you'll want - // to skip bytes from being read from the remote stream to emulate - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof() - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close() - { - $this->remoteStream->close() && $this->stream->close(); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/DroppingStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/DroppingStream.php deleted file mode 100644 index 8935c80d72..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ /dev/null @@ -1,42 +0,0 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string) - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning 0 when the underlying stream is too large. - if ($diff <= 0) { - return 0; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - return $this->stream->write(substr($string, 0, $diff)); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/FnStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/FnStream.php deleted file mode 100644 index cc9b4453f7..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/FnStream.php +++ /dev/null @@ -1,149 +0,0 @@ -methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * @throws \BadMethodCallException - */ - public function __get($name) - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * Adds custom functionality to an underlying stream by intercepting - * specific method calls. - * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // If any of the required methods were not provided, then simply - // proxy to the decorated stream. - foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { - $methods[$diff] = [$stream, $diff]; - } - - return new self($methods); - } - - public function __toString() - { - return call_user_func($this->_fn___toString); - } - - public function close() - { - return call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function getSize() - { - return call_user_func($this->_fn_getSize); - } - - public function tell() - { - return call_user_func($this->_fn_tell); - } - - public function eof() - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable() - { - return call_user_func($this->_fn_isSeekable); - } - - public function rewind() - { - call_user_func($this->_fn_rewind); - } - - public function seek($offset, $whence = SEEK_SET) - { - call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable() - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string) - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable() - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length) - { - return call_user_func($this->_fn_read, $length); - } - - public function getContents() - { - return call_user_func($this->_fn_getContents); - } - - public function getMetadata($key = null) - { - return call_user_func($this->_fn_getMetadata, $key); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/InflateStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/InflateStream.php deleted file mode 100644 index 2c8628b07b..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/InflateStream.php +++ /dev/null @@ -1,29 +0,0 @@ -stream = new Stream($resource); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php deleted file mode 100644 index 02cec3af49..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ /dev/null @@ -1,39 +0,0 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - * - * @return StreamInterface - */ - protected function createStream() - { - return stream_for(try_fopen($this->filename, $this->mode)); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LimitStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LimitStream.php deleted file mode 100644 index 7f2298bcb0..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/LimitStream.php +++ /dev/null @@ -1,155 +0,0 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof() - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit == -1) { - return false; - } - - return $this->stream->tell() >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - * {@inheritdoc} - */ - public function getSize() - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit == -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence !== SEEK_SET || $offset < 0) { - throw new \RuntimeException(sprintf( - 'Cannot seek to offset % with whence %s', - $offset, - $whence - )); - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - $this->stream->seek($offset); - } - - /** - * Give a relative tell() - * {@inheritdoc} - */ - public function tell() - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @throws \RuntimeException if the stream cannot be seeked. - */ - public function setOffset($offset) - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if ($this->stream->isSeekable()) { - $this->stream->seek($offset); - } elseif ($current > $offset) { - throw new \RuntimeException("Could not seek to stream offset $offset"); - } else { - $this->stream->read($offset - $current); - } - } - - $this->offset = $offset; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - */ - public function setLimit($limit) - { - $this->limit = $limit; - } - - public function read($length) - { - if ($this->limit == -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } - - return ''; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MessageTrait.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MessageTrait.php deleted file mode 100644 index 123205cf63..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ /dev/null @@ -1,158 +0,0 @@ -protocol; - } - - public function withProtocolVersion($version) - { - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = $version; - return $new; - } - - public function getHeaders() - { - return $this->headerLines; - } - - public function hasHeader($header) - { - return isset($this->headers[strtolower($header)]); - } - - public function getHeader($header) - { - $name = strtolower($header); - return isset($this->headers[$name]) ? $this->headers[$name] : []; - } - - public function getHeaderLine($header) - { - return implode(', ', $this->getHeader($header)); - } - - public function withHeader($header, $value) - { - $new = clone $this; - $header = trim($header); - $name = strtolower($header); - - if (!is_array($value)) { - $new->headers[$name] = [trim($value)]; - } else { - $new->headers[$name] = $value; - foreach ($new->headers[$name] as &$v) { - $v = trim($v); - } - } - - // Remove the header lines. - foreach (array_keys($new->headerLines) as $key) { - if (strtolower($key) === $name) { - unset($new->headerLines[$key]); - } - } - - // Add the header line. - $new->headerLines[$header] = $new->headers[$name]; - - return $new; - } - - public function withAddedHeader($header, $value) - { - if (!$this->hasHeader($header)) { - return $this->withHeader($header, $value); - } - - $new = clone $this; - $new->headers[strtolower($header)][] = $value; - $new->headerLines[$header][] = $value; - return $new; - } - - public function withoutHeader($header) - { - if (!$this->hasHeader($header)) { - return $this; - } - - $new = clone $this; - $name = strtolower($header); - unset($new->headers[$name]); - - foreach (array_keys($new->headerLines) as $key) { - if (strtolower($key) === $name) { - unset($new->headerLines[$key]); - } - } - - return $new; - } - - public function getBody() - { - if (!$this->stream) { - $this->stream = stream_for(''); - } - - return $this->stream; - } - - public function withBody(StreamInterface $body) - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - return $new; - } - - private function setHeaders(array $headers) - { - $this->headerLines = $this->headers = []; - foreach ($headers as $header => $value) { - $header = trim($header); - $name = strtolower($header); - if (!is_array($value)) { - $value = trim($value); - $this->headers[$name][] = $value; - $this->headerLines[$header][] = $value; - } else { - foreach ($value as $v) { - $v = trim($v); - $this->headers[$name][] = $v; - $this->headerLines[$header][] = $v; - } - } - } - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MultipartStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MultipartStream.php deleted file mode 100644 index fd006ecf8a..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ /dev/null @@ -1,153 +0,0 @@ -boundary = $boundary ?: uniqid(); - $this->stream = $this->createStream($elements); - } - - /** - * Get the boundary - * - * @return string - */ - public function getBoundary() - { - return $this->boundary; - } - - public function isWritable() - { - return false; - } - - /** - * Get the headers needed before transferring the content of a POST file - */ - private function getHeaders(array $headers) - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - protected function createStream(array $elements) - { - $stream = new AppendStream(); - - foreach ($elements as $element) { - $this->addElement($stream, $element); - } - - // Add the trailing boundary with CRLF - $stream->addStream(stream_for("--{$this->boundary}--\r\n")); - - return $stream; - } - - private function addElement(AppendStream $stream, array $element) - { - foreach (['contents', 'name'] as $key) { - if (!array_key_exists($key, $element)) { - throw new \InvalidArgumentException("A '{$key}' key is required"); - } - } - - $element['contents'] = stream_for($element['contents']); - - if (empty($element['filename'])) { - $uri = $element['contents']->getMetadata('uri'); - if (substr($uri, 0, 6) !== 'php://') { - $element['filename'] = $uri; - } - } - - list($body, $headers) = $this->createElement( - $element['name'], - $element['contents'], - isset($element['filename']) ? $element['filename'] : null, - isset($element['headers']) ? $element['headers'] : [] - ); - - $stream->addStream(stream_for($this->getHeaders($headers))); - $stream->addStream($body); - $stream->addStream(stream_for("\r\n")); - } - - /** - * @return array - */ - private function createElement($name, $stream, $filename, array $headers) - { - // Set a default content-disposition header if one was no provided - $disposition = $this->getHeader($headers, 'content-disposition'); - if (!$disposition) { - $headers['Content-Disposition'] = $filename - ? sprintf('form-data; name="%s"; filename="%s"', - $name, - basename($filename)) - : "form-data; name=\"{$name}\""; - } - - // Set a default content-length header if one was no provided - $length = $this->getHeader($headers, 'content-length'); - if (!$length) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // Set a default Content-Type if one was not supplied - $type = $this->getHeader($headers, 'content-type'); - if (!$type && $filename) { - if ($type = mimetype_from_filename($filename)) { - $headers['Content-Type'] = $type; - } - } - - return [$stream, $headers]; - } - - private function getHeader(array $headers, $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return $v; - } - } - - return null; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php deleted file mode 100644 index 233221805e..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ /dev/null @@ -1,22 +0,0 @@ -source = $source; - $this->size = isset($options['size']) ? $options['size'] : null; - $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; - $this->buffer = new BufferStream(); - } - - public function __toString() - { - try { - return copy_to_string($this); - } catch (\Exception $e) { - return ''; - } - } - - public function close() - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = false; - $this->source = null; - } - - public function getSize() - { - return $this->size; - } - - public function tell() - { - return $this->tellPos; - } - - public function eof() - { - return !$this->source; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a PumpStream'); - } - - public function isWritable() - { - return false; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to a PumpStream'); - } - - public function isReadable() - { - return true; - } - - public function read($length) - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents() - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return isset($this->metadata[$key]) ? $this->metadata[$key] : null; - } - - private function pump($length) - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Request.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Request.php deleted file mode 100644 index 0189b14ce1..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Request.php +++ /dev/null @@ -1,149 +0,0 @@ -method = strtoupper($method); - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $protocolVersion; - - $host = $uri->getHost(); - if ($host && !$this->hasHeader('Host')) { - $this->updateHostFromUri($host); - } - - if ($body) { - $this->stream = stream_for($body); - } - } - - public function getRequestTarget() - { - if ($this->requestTarget !== null) { - return $this->requestTarget; - } - - $target = $this->uri->getPath(); - if ($target == null) { - $target = '/'; - } - if ($this->uri->getQuery()) { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget) - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; cannot contain whitespace' - ); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - return $new; - } - - public function getMethod() - { - return $this->method; - } - - public function withMethod($method) - { - $new = clone $this; - $new->method = strtoupper($method); - return $new; - } - - public function getUri() - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false) - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost) { - if ($host = $uri->getHost()) { - $new->updateHostFromUri($host); - } - } - - return $new; - } - - public function withHeader($header, $value) - { - /** @var Request $newInstance */ - $newInstance = $this->withParentHeader($header, $value); - return $newInstance; - } - - private function updateHostFromUri($host) - { - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - if ($port = $this->uri->getPort()) { - $host .= ':' . $port; - } - - $this->headerLines = ['Host' => [$host]] + $this->headerLines; - $this->headers = ['host' => [$host]] + $this->headers; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Response.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Response.php deleted file mode 100644 index 7a7a4698f8..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Response.php +++ /dev/null @@ -1,130 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-status', - 208 => 'Already Reported', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Switch Proxy', - 307 => 'Temporary Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Time-out', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Requested range not satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 425 => 'Unordered Collection', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Time-out', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 511 => 'Network Authentication Required', - ]; - - /** @var null|string */ - private $reasonPhrase = ''; - - /** @var int */ - private $statusCode = 200; - - /** - * @param int $status Status code for the response, if any. - * @param array $headers Headers for the response, if any. - * @param mixed $body Stream body. - * @param string $version Protocol version. - * @param string $reason Reason phrase (a default will be used if possible). - */ - public function __construct( - $status = 200, - array $headers = [], - $body = null, - $version = '1.1', - $reason = null - ) { - $this->statusCode = (int) $status; - - if ($body) { - $this->stream = stream_for($body); - } - - $this->setHeaders($headers); - if (!$reason && isset(self::$phrases[$this->statusCode])) { - $this->reasonPhrase = self::$phrases[$status]; - } else { - $this->reasonPhrase = (string) $reason; - } - - $this->protocol = $version; - } - - public function getStatusCode() - { - return $this->statusCode; - } - - public function getReasonPhrase() - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = '') - { - $new = clone $this; - $new->statusCode = (int) $code; - if (!$reasonPhrase && isset(self::$phrases[$new->statusCode])) { - $reasonPhrase = self::$phrases[$new->statusCode]; - } - $new->reasonPhrase = $reasonPhrase; - return $new; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Stream.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Stream.php deleted file mode 100644 index 0b0db0110b..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Stream.php +++ /dev/null @@ -1,245 +0,0 @@ - [ - 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, - 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, - 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a+' => true - ], - 'write' => [ - 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, - 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, - 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true - ] - ]; - - /** - * This constructor accepts an associative array of options. - * - * - size: (int) If a read stream would otherwise have an indeterminate - * size, but the size is known due to foreknownledge, then you can - * provide that size, in bytes. - * - metadata: (array) Any additional metadata to return when the metadata - * of the stream is accessed. - * - * @param resource $stream Stream resource to wrap. - * @param array $options Associative array of options. - * - * @throws \InvalidArgumentException if the stream is not a stream resource - */ - public function __construct($stream, $options = []) - { - if (!is_resource($stream)) { - throw new \InvalidArgumentException('Stream must be a resource'); - } - - if (isset($options['size'])) { - $this->size = $options['size']; - } - - $this->customMetadata = isset($options['metadata']) - ? $options['metadata'] - : []; - - $this->stream = $stream; - $meta = stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable']; - $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]); - $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]); - $this->uri = $this->getMetadata('uri'); - } - - public function __get($name) - { - if ($name == 'stream') { - throw new \RuntimeException('The stream is detached'); - } - - throw new \BadMethodCallException('No value for ' . $name); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString() - { - try { - $this->seek(0); - return (string) stream_get_contents($this->stream); - } catch (\Exception $e) { - return ''; - } - } - - public function getContents() - { - $contents = stream_get_contents($this->stream); - - if ($contents === false) { - throw new \RuntimeException('Unable to read stream contents'); - } - - return $contents; - } - - public function close() - { - if (isset($this->stream)) { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function getSize() - { - if ($this->size !== null) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function eof() - { - return !$this->stream || feof($this->stream); - } - - public function tell() - { - $result = ftell($this->stream); - - if ($result === false) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } elseif (fseek($this->stream, $offset, $whence) === -1) { - throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); - } - } - - public function read($length) - { - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - - return fread($this->stream, $length); - } - - public function write($string) - { - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - $result = fwrite($this->stream, $string); - - if ($result === false) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return isset($meta[$key]) ? $meta[$key] : null; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php deleted file mode 100644 index daec6f52ea..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,149 +0,0 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - * - * @param string $name Name of the property (allows "stream" only). - * - * @return StreamInterface - */ - public function __get($name) - { - if ($name == 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Exception $e) { - // Really, PHP? https://bugs.php.net/bug.php?id=53648 - trigger_error('StreamDecorator::__toString exception: ' - . (string) $e, E_USER_ERROR); - return ''; - } - } - - public function getContents() - { - return copy_to_string($this); - } - - /** - * Allow decorators to implement custom methods - * - * @param string $method Missing method name - * @param array $args Method arguments - * - * @return mixed - */ - public function __call($method, array $args) - { - $result = call_user_func_array([$this->stream, $method], $args); - - // Always return the wrapped object if the result is a return $this - return $result === $this->stream ? $this : $result; - } - - public function close() - { - $this->stream->close(); - } - - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function getSize() - { - return $this->stream->getSize(); - } - - public function eof() - { - return $this->stream->eof(); - } - - public function tell() - { - return $this->stream->tell(); - } - - public function isReadable() - { - return $this->stream->isReadable(); - } - - public function isWritable() - { - return $this->stream->isWritable(); - } - - public function isSeekable() - { - return $this->stream->isSeekable(); - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - $this->stream->seek($offset, $whence); - } - - public function read($length) - { - return $this->stream->read($length); - } - - public function write($string) - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @return StreamInterface - * @throws \BadMethodCallException - */ - protected function createStream() - { - throw new \BadMethodCallException('Not implemented'); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php deleted file mode 100644 index cf7b2232e4..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ /dev/null @@ -1,121 +0,0 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, null, stream_context_create([ - 'guzzle' => ['stream' => $stream] - ])); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register() - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open($path, $mode, $options, &$opened_path) - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read($count) - { - return $this->stream->read($count); - } - - public function stream_write($data) - { - return (int) $this->stream->write($data); - } - - public function stream_tell() - { - return $this->stream->tell(); - } - - public function stream_eof() - { - return $this->stream->eof(); - } - - public function stream_seek($offset, $whence) - { - $this->stream->seek($offset, $whence); - - return true; - } - - public function stream_stat() - { - static $modeMap = [ - 'r' => 33060, - 'r+' => 33206, - 'w' => 33188 - ]; - - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Uri.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Uri.php deleted file mode 100644 index 58c3066720..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/Uri.php +++ /dev/null @@ -1,604 +0,0 @@ - 80, - 'https' => 443, - ]; - - private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; - private static $charSubDelims = '!\$&\'\(\)\*\+,;='; - private static $replaceQuery = ['=' => '%3D', '&' => '%26']; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - /** - * @param string $uri URI to parse and wrap. - */ - public function __construct($uri = '') - { - if ($uri != null) { - $parts = parse_url($uri); - if ($parts === false) { - throw new \InvalidArgumentException("Unable to parse URI: $uri"); - } - $this->applyParts($parts); - } - } - - public function __toString() - { - return self::createUriString( - $this->scheme, - $this->getAuthority(), - $this->getPath(), - $this->query, - $this->fragment - ); - } - - /** - * Removes dot segments from a path and returns the new path. - * - * @param string $path - * - * @return string - * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 - */ - public static function removeDotSegments($path) - { - static $noopPaths = ['' => true, '/' => true, '*' => true]; - static $ignoreSegments = ['.' => true, '..' => true]; - - if (isset($noopPaths[$path])) { - return $path; - } - - $results = []; - $segments = explode('/', $path); - foreach ($segments as $segment) { - if ($segment == '..') { - array_pop($results); - } elseif (!isset($ignoreSegments[$segment])) { - $results[] = $segment; - } - } - - $newPath = implode('/', $results); - // Add the leading slash if necessary - if (substr($path, 0, 1) === '/' && - substr($newPath, 0, 1) !== '/' - ) { - $newPath = '/' . $newPath; - } - - // Add the trailing slash if necessary - if ($newPath != '/' && isset($ignoreSegments[end($segments)])) { - $newPath .= '/'; - } - - return $newPath; - } - - /** - * Resolve a base URI with a relative URI and return a new URI. - * - * @param UriInterface $base Base URI - * @param string $rel Relative URI - * - * @return UriInterface - */ - public static function resolve(UriInterface $base, $rel) - { - if ($rel === null || $rel === '') { - return $base; - } - - if ($rel instanceof UriInterface) { - $relParts = [ - 'scheme' => $rel->getScheme(), - 'host' => $rel->getHost(), - 'port' => $rel->getPort(), - 'path' => $rel->getPath(), - 'query' => $rel->getQuery(), - 'fragment' => $rel->getFragment() - ]; - } else { - $relParts = parse_url($rel) + [ - 'scheme' => '', - 'host' => '', - 'port' => '', - 'path' => '', - 'query' => '', - 'fragment' => '' - ]; - } - - if (!empty($relParts['scheme']) && !empty($relParts['host'])) { - return $rel instanceof UriInterface - ? $rel - : self::fromParts($relParts); - } - - $parts = [ - 'scheme' => $base->getScheme(), - 'host' => $base->getHost(), - 'port' => $base->getPort(), - 'path' => $base->getPath(), - 'query' => $base->getQuery(), - 'fragment' => $base->getFragment() - ]; - - if (!empty($relParts['host'])) { - $parts['host'] = $relParts['host']; - $parts['port'] = $relParts['port']; - $parts['path'] = self::removeDotSegments($relParts['path']); - $parts['query'] = $relParts['query']; - $parts['fragment'] = $relParts['fragment']; - } elseif (!empty($relParts['path'])) { - if (substr($relParts['path'], 0, 1) == '/') { - $parts['path'] = self::removeDotSegments($relParts['path']); - $parts['query'] = $relParts['query']; - $parts['fragment'] = $relParts['fragment']; - } else { - if (!empty($parts['host']) && empty($parts['path'])) { - $mergedPath = '/'; - } else { - $mergedPath = substr($parts['path'], 0, strrpos($parts['path'], '/') + 1); - } - $parts['path'] = self::removeDotSegments($mergedPath . $relParts['path']); - $parts['query'] = $relParts['query']; - $parts['fragment'] = $relParts['fragment']; - } - } elseif (!empty($relParts['query'])) { - $parts['query'] = $relParts['query']; - } elseif ($relParts['fragment'] != null) { - $parts['fragment'] = $relParts['fragment']; - } - - return static::fromParts($parts); - } - - /** - * Create a new URI with a specific query string value removed. - * - * Any existing query string values that exactly match the provided key are - * removed. - * - * Note: this function will convert "=" to "%3D" and "&" to "%26". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key value pair to remove. - * - * @return UriInterface - */ - public static function withoutQueryValue(UriInterface $uri, $key) - { - $current = $uri->getQuery(); - if (!$current) { - return $uri; - } - - $result = []; - foreach (explode('&', $current) as $part) { - if (explode('=', $part)[0] !== $key) { - $result[] = $part; - }; - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Create a new URI with a specific query string value. - * - * Any existing query string values that exactly match the provided key are - * removed and replaced with the given key value pair. - * - * Note: this function will convert "=" to "%3D" and "&" to "%26". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string $value Value to set. - * - * @return UriInterface - */ - public static function withQueryValue(UriInterface $uri, $key, $value) - { - $current = $uri->getQuery(); - $key = strtr($key, self::$replaceQuery); - - if (!$current) { - $result = []; - } else { - $result = []; - foreach (explode('&', $current) as $part) { - if (explode('=', $part)[0] !== $key) { - $result[] = $part; - }; - } - } - - if ($value !== null) { - $result[] = $key . '=' . strtr($value, self::$replaceQuery); - } else { - $result[] = $key; - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Create a URI from a hash of parse_url parts. - * - * @param array $parts - * - * @return self - */ - public static function fromParts(array $parts) - { - $uri = new self(); - $uri->applyParts($parts); - return $uri; - } - - public function getScheme() - { - return $this->scheme; - } - - public function getAuthority() - { - if (empty($this->host)) { - return ''; - } - - $authority = $this->host; - if (!empty($this->userInfo)) { - $authority = $this->userInfo . '@' . $authority; - } - - if ($this->isNonStandardPort($this->scheme, $this->host, $this->port)) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo() - { - return $this->userInfo; - } - - public function getHost() - { - return $this->host; - } - - public function getPort() - { - return $this->port; - } - - public function getPath() - { - return $this->path == null ? '' : $this->path; - } - - public function getQuery() - { - return $this->query; - } - - public function getFragment() - { - return $this->fragment; - } - - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - - if ($this->scheme === $scheme) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->port = $new->filterPort($new->scheme, $new->host, $new->port); - return $new; - } - - public function withUserInfo($user, $password = null) - { - $info = $user; - if ($password) { - $info .= ':' . $password; - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - return $new; - } - - public function withHost($host) - { - if ($this->host === $host) { - return $this; - } - - $new = clone $this; - $new->host = $host; - return $new; - } - - public function withPort($port) - { - $port = $this->filterPort($this->scheme, $this->host, $port); - - if ($this->port === $port) { - return $this; - } - - $new = clone $this; - $new->port = $port; - return $new; - } - - public function withPath($path) - { - if (!is_string($path)) { - throw new \InvalidArgumentException( - 'Invalid path provided; must be a string' - ); - } - - $path = $this->filterPath($path); - - if ($this->path === $path) { - return $this; - } - - $new = clone $this; - $new->path = $path; - return $new; - } - - public function withQuery($query) - { - if (!is_string($query) && !method_exists($query, '__toString')) { - throw new \InvalidArgumentException( - 'Query string must be a string' - ); - } - - $query = (string) $query; - if (substr($query, 0, 1) === '?') { - $query = substr($query, 1); - } - - $query = $this->filterQueryAndFragment($query); - - if ($this->query === $query) { - return $this; - } - - $new = clone $this; - $new->query = $query; - return $new; - } - - public function withFragment($fragment) - { - if (substr($fragment, 0, 1) === '#') { - $fragment = substr($fragment, 1); - } - - $fragment = $this->filterQueryAndFragment($fragment); - - if ($this->fragment === $fragment) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - return $new; - } - - /** - * Apply parse_url parts to a URI. - * - * @param $parts Array of parse_url parts to apply. - */ - private function applyParts(array $parts) - { - $this->scheme = isset($parts['scheme']) - ? $this->filterScheme($parts['scheme']) - : ''; - $this->userInfo = isset($parts['user']) ? $parts['user'] : ''; - $this->host = isset($parts['host']) ? $parts['host'] : ''; - $this->port = !empty($parts['port']) - ? $this->filterPort($this->scheme, $this->host, $parts['port']) - : null; - $this->path = isset($parts['path']) - ? $this->filterPath($parts['path']) - : ''; - $this->query = isset($parts['query']) - ? $this->filterQueryAndFragment($parts['query']) - : ''; - $this->fragment = isset($parts['fragment']) - ? $this->filterQueryAndFragment($parts['fragment']) - : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $parts['pass']; - } - } - - /** - * Create a URI string from its various parts - * - * @param string $scheme - * @param string $authority - * @param string $path - * @param string $query - * @param string $fragment - * @return string - */ - private static function createUriString($scheme, $authority, $path, $query, $fragment) - { - $uri = ''; - - if (!empty($scheme)) { - $uri .= $scheme . '://'; - } - - if (!empty($authority)) { - $uri .= $authority; - } - - if ($path != null) { - // Add a leading slash if necessary. - if ($uri && substr($path, 0, 1) !== '/') { - $uri .= '/'; - } - $uri .= $path; - } - - if ($query != null) { - $uri .= '?' . $query; - } - - if ($fragment != null) { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Is a given port non-standard for the current scheme? - * - * @param string $scheme - * @param string $host - * @param int $port - * @return bool - */ - private static function isNonStandardPort($scheme, $host, $port) - { - if (!$scheme && $port) { - return true; - } - - if (!$host || !$port) { - return false; - } - - return !isset(static::$schemes[$scheme]) || $port !== static::$schemes[$scheme]; - } - - /** - * @param string $scheme - * - * @return string - */ - private function filterScheme($scheme) - { - $scheme = strtolower($scheme); - $scheme = rtrim($scheme, ':/'); - - return $scheme; - } - - /** - * @param string $scheme - * @param string $host - * @param int $port - * - * @return int|null - * - * @throws \InvalidArgumentException If the port is invalid. - */ - private function filterPort($scheme, $host, $port) - { - if (null !== $port) { - $port = (int) $port; - if (1 > $port || 0xffff < $port) { - throw new \InvalidArgumentException( - sprintf('Invalid port: %d. Must be between 1 and 65535', $port) - ); - } - } - - return $this->isNonStandardPort($scheme, $host, $port) ? $port : null; - } - - /** - * Filters the path of a URI - * - * @param $path - * - * @return string - */ - private function filterPath($path) - { - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . ':@\/%]+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $path - ); - } - - /** - * Filters the query string or fragment of a URI. - * - * @param $str - * - * @return string - */ - private function filterQueryAndFragment($str) - { - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $str - ); - } - - private function rawurlencodeMatchZero(array $match) - { - return rawurlencode($match[0]); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/functions.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/src/functions.php deleted file mode 100644 index a1cec41786..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/src/functions.php +++ /dev/null @@ -1,799 +0,0 @@ -getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - - foreach ($message->getHeaders() as $name => $values) { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - - return "{$msg}\r\n\r\n" . $message->getBody(); -} - -/** - * Returns a UriInterface for the given value. - * - * This function accepts a string or {@see Psr\Http\Message\UriInterface} and - * returns a UriInterface for the given value. If the value is already a - * `UriInterface`, it is returned as-is. - * - * @param string|UriInterface $uri - * - * @return UriInterface - * @throws \InvalidArgumentException - */ -function uri_for($uri) -{ - if ($uri instanceof UriInterface) { - return $uri; - } elseif (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); -} - -/** - * Create a new stream based on the input type. - * - * Options is an associative array that can contain the following keys: - * - metadata: Array of custom metadata. - * - size: Size of the stream. - * - * @param resource|string|StreamInterface $resource Entity body data - * @param array $options Additional options - * - * @return Stream - * @throws \InvalidArgumentException if the $resource arg is not valid. - */ -function stream_for($resource = '', array $options = []) -{ - switch (gettype($resource)) { - case 'string': - $stream = fopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - case 'resource': - return new Stream($resource, $options); - case 'object': - if ($resource instanceof StreamInterface) { - return $resource; - } elseif ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return stream_for((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(fopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); -} - -/** - * Parse an array of header values containing ";" separated data into an - * array of associative arrays representing the header key value pair - * data of the header. When a parameter does not contain a value, but just - * contains a key, this function will inject a key with a '' string value. - * - * @param string|array $header Header to parse into components. - * - * @return array Returns the parsed header values. - */ -function parse_header($header) -{ - static $trimmed = "\"' \n\t\r"; - $params = $matches = []; - - foreach (normalize_header($header) as $val) { - $part = []; - foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { - if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); - } - } - } - if ($part) { - $params[] = $part; - } - } - - return $params; -} - -/** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param string|array $header Header to normalize. - * - * @return array Returns the normalized header field values. - */ -function normalize_header($header) -{ - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); - } - - $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); - } - } - } - - return $result; -} - -/** - * Clone and modify a request with the given changes. - * - * The changes can be one of: - * - method: (string) Changes the HTTP method. - * - set_headers: (array) Sets the given headers. - * - remove_headers: (array) Remove the given headers. - * - body: (mixed) Sets the given body. - * - uri: (UriInterface) Set the URI. - * - query: (string) Set the query string value of the URI. - * - version: (string) Set the protocol version. - * - * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. - * - * @return RequestInterface - */ -function modify_request(RequestInterface $request, array $changes) -{ - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = _caseless_remove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = _caseless_remove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - return new Request( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion() - ); -} - -/** - * Attempts to rewind a message body and throws an exception on failure. - * - * The body of the message will only be rewound if a call to `tell()` returns a - * value other than `0`. - * - * @param MessageInterface $message Message to rewind - * - * @throws \RuntimeException - */ -function rewind_body(MessageInterface $message) -{ - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } -} - -/** - * Safely opens a PHP stream resource using a filename. - * - * When fopen fails, PHP normally raises a warning. This function adds an - * error handler that checks for errors and throws an exception instead. - * - * @param string $filename File to open - * @param string $mode Mode used to open the file - * - * @return resource - * @throws \RuntimeException if the file cannot be opened - */ -function try_fopen($filename, $mode) -{ - $ex = null; - set_error_handler(function () use ($filename, $mode, &$ex) { - $ex = new \RuntimeException(sprintf( - 'Unable to open %s using mode %s: %s', - $filename, - $mode, - func_get_args()[1] - )); - }); - - $handle = fopen($filename, $mode); - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - return $handle; -} - -/** - * Copy the contents of a stream into a string until the given number of - * bytes have been read. - * - * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * @return string - * @throws \RuntimeException on error. - */ -function copy_to_string(StreamInterface $stream, $maxLen = -1) -{ - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; -} - -/** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ -function copy_to_stream( - StreamInterface $source, - StreamInterface $dest, - $maxLen = -1 -) { - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read(1048576))) { - break; - } - } - return; - } - - $bytes = 0; - while (!$source->eof()) { - $buf = $source->read($maxLen - $bytes); - if (!($len = strlen($buf))) { - break; - } - $bytes += $len; - $dest->write($buf); - if ($bytes == $maxLen) { - break; - } - } -} - -/** - * Calculate a hash of a Stream - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @return string Returns the hash of the stream - * @throws \RuntimeException on error. - */ -function hash( - StreamInterface $stream, - $algo, - $rawOutput = false -) { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; -} - -/** - * Read a line from the stream up to the maximum allowed buffer length - * - * @param StreamInterface $stream Stream to read from - * @param int $maxLength Maximum buffer length - * - * @return string|bool - */ -function readline(StreamInterface $stream, $maxLength = null) -{ - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - // Using a loose equality here to match on '' and false. - if (null == ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte == PHP_EOL || ++$size == $maxLength - 1) { - break; - } - } - - return $buffer; -} - -/** - * Parses a request message string into a request object. - * - * @param string $message Request message string. - * - * @return Request - */ -function parse_request($message) -{ - $data = _parse_message($message); - if (!preg_match('/^[a-zA-Z]+\s+\/.*/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - return new Request( - $parts[0], - _parse_request_uri($parts[1], $data['headers']), - $data['headers'], - $data['body'], - $version - ); -} - -/** - * Parses a response message string into a response object. - * - * @param string $message Response message string. - * - * @return Response - */ -function parse_response($message) -{ - $data = _parse_message($message); - if (!preg_match('/^HTTP\/.* [0-9]{3} .*/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string'); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - isset($parts[2]) ? $parts[2] : null - ); -} - -/** - * Parse a query string into an associative array. - * - * If multiple values are found for the same key, the value of that key - * value pair will become an array. This function does not parse nested - * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will - * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). - * - * @param string $str Query string to parse - * @param bool|string $urlEncoding How the query string is encoded - * - * @return array - */ -function parse_query($str, $urlEncoding = true) -{ - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', $value)); - }; - } elseif ($urlEncoding == PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding == PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { return $str; }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; -} - -/** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of parseQuery() to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like http_build_query would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - * @return string - */ -function build_query(array $params, $encoding = PHP_QUERY_RFC3986) -{ - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function ($str) { return $str; }; - } elseif ($encoding == PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding == PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder($k); - if (!is_array($v)) { - $qs .= $k; - if ($v !== null) { - $qs .= '=' . $encoder($v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - if ($vv !== null) { - $qs .= '=' . $encoder($vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; -} - -/** - * Determines the mimetype of a file by looking at its extension. - * - * @param $filename - * - * @return null|string - */ -function mimetype_from_filename($filename) -{ - return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION)); -} - -/** - * Maps a file extensions to a mimetype. - * - * @param $extension string The file extension. - * - * @return string|null - * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - */ -function mimetype_from_extension($extension) -{ - static $mimetypes = [ - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', - ]; - - $extension = strtolower($extension); - - return isset($mimetypes[$extension]) - ? $mimetypes[$extension] - : null; -} - -/** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - * - * @return array - * @internal - */ -function _parse_message($message) -{ - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - // Iterate over each line in the message, accounting for line endings - $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE); - $result = ['start-line' => array_shift($lines), 'headers' => [], 'body' => '']; - array_shift($lines); - - for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) { - $line = $lines[$i]; - // If two line breaks were encountered, then this is the end of body - if (empty($line)) { - if ($i < $totalLines - 1) { - $result['body'] = implode('', array_slice($lines, $i + 2)); - } - break; - } - if (strpos($line, ':')) { - $parts = explode(':', $line, 2); - $key = trim($parts[0]); - $value = isset($parts[1]) ? trim($parts[1]) : ''; - $result['headers'][$key][] = $value; - } - } - - return $result; -} - -/** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - * - * @return string - * @internal - */ -function _parse_request_uri($path, array $headers) -{ - $hostKey = array_filter(array_keys($headers), function ($k) { - return strtolower($k) === 'host'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); -} - -/** @internal */ -function _caseless_remove($keys, array $data) -{ - $result = []; - - foreach ($keys as &$key) { - $key = strtolower($key); - } - - foreach ($data as $k => $v) { - if (!in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php deleted file mode 100644 index 3c197dcea8..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php +++ /dev/null @@ -1,186 +0,0 @@ -getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $a->addStream($s); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage The AppendStream can only seek with SEEK_SET - */ - public function testValidatesSeekType() - { - $a = new AppendStream(); - $a->seek(100, SEEK_CUR); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to seek stream 0 of the AppendStream - */ - public function testTriesToRewindOnSeek() - { - $a = new AppendStream(); - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'rewind', 'isSeekable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('rewind') - ->will($this->throwException(new \RuntimeException())); - $a->addStream($s); - $a->seek(10); - } - - public function testSeeksToPositionByReading() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar'), - Psr7\stream_for('baz'), - ]); - - $a->seek(3); - $this->assertEquals(3, $a->tell()); - $this->assertEquals('bar', $a->read(3)); - - $a->seek(6); - $this->assertEquals(6, $a->tell()); - $this->assertEquals('baz', $a->read(3)); - } - - public function testDetachesEachStream() - { - $s1 = Psr7\stream_for('foo'); - $s2 = Psr7\stream_for('bar'); - $a = new AppendStream([$s1, $s2]); - $this->assertSame('foobar', (string) $a); - $a->detach(); - $this->assertSame('', (string) $a); - $this->assertSame(0, $a->getSize()); - } - - public function testClosesEachStream() - { - $s1 = Psr7\stream_for('foo'); - $a = new AppendStream([$s1]); - $a->close(); - $this->assertSame('', (string) $a); - } - - /** - * @expectedExceptionMessage Cannot write to an AppendStream - * @expectedException \RuntimeException - */ - public function testIsNotWritable() - { - $a = new AppendStream([Psr7\stream_for('foo')]); - $this->assertFalse($a->isWritable()); - $this->assertTrue($a->isSeekable()); - $this->assertTrue($a->isReadable()); - $a->write('foo'); - } - - public function testDoesNotNeedStreams() - { - $a = new AppendStream(); - $this->assertEquals('', (string) $a); - } - - public function testCanReadFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar'), - Psr7\stream_for('baz'), - ]); - $this->assertFalse($a->eof()); - $this->assertSame(0, $a->tell()); - $this->assertEquals('foo', $a->read(3)); - $this->assertEquals('bar', $a->read(3)); - $this->assertEquals('baz', $a->read(3)); - $this->assertSame('', $a->read(1)); - $this->assertTrue($a->eof()); - $this->assertSame(9, $a->tell()); - $this->assertEquals('foobarbaz', (string) $a); - } - - public function testCanDetermineSizeFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar') - ]); - $this->assertEquals(6, $a->getSize()); - - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(null)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $a->addStream($s); - $this->assertNull($a->getSize()); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'read', 'isReadable', 'eof']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \RuntimeException('foo'))); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->any()) - ->method('eof') - ->will($this->returnValue(false)); - $a = new AppendStream([$s]); - $this->assertFalse($a->eof()); - $this->assertSame('', (string) $a); - } - - public function testCanDetach() - { - $s = new AppendStream(); - $s->detach(); - } - - public function testReturnsEmptyMetadata() - { - $s = new AppendStream(); - $this->assertEquals([], $s->getMetadata()); - $this->assertNull($s->getMetadata('foo')); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php deleted file mode 100644 index 0a635d4671..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php +++ /dev/null @@ -1,63 +0,0 @@ -assertTrue($b->isReadable()); - $this->assertTrue($b->isWritable()); - $this->assertFalse($b->isSeekable()); - $this->assertEquals(null, $b->getMetadata('foo')); - $this->assertEquals(10, $b->getMetadata('hwm')); - $this->assertEquals([], $b->getMetadata()); - } - - public function testRemovesReadDataFromBuffer() - { - $b = new BufferStream(); - $this->assertEquals(3, $b->write('foo')); - $this->assertEquals(3, $b->getSize()); - $this->assertFalse($b->eof()); - $this->assertEquals('foo', $b->read(10)); - $this->assertTrue($b->eof()); - $this->assertEquals('', $b->read(10)); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot determine the position of a BufferStream - */ - public function testCanCastToStringOrGetContents() - { - $b = new BufferStream(); - $b->write('foo'); - $b->write('baz'); - $this->assertEquals('foo', $b->read(3)); - $b->write('bar'); - $this->assertEquals('bazbar', (string) $b); - $b->tell(); - } - - public function testDetachClearsBuffer() - { - $b = new BufferStream(); - $b->write('foo'); - $b->detach(); - $this->assertTrue($b->eof()); - $this->assertEquals(3, $b->write('abc')); - $this->assertEquals('abc', $b->read(10)); - } - - public function testExceedingHighwaterMarkReturnsFalseButStillBuffers() - { - $b = new BufferStream(5); - $this->assertEquals(3, $b->write('hi ')); - $this->assertFalse($b->write('hello')); - $this->assertEquals('hi hello', (string) $b); - $this->assertEquals(4, $b->write('test')); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php deleted file mode 100644 index e2ed0a744c..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php +++ /dev/null @@ -1,137 +0,0 @@ -decorated = Psr7\stream_for('testing'); - $this->body = new CachingStream($this->decorated); - } - - public function tearDown() - { - $this->decorated->close(); - $this->body->close(); - } - - public function testUsesRemoteSizeIfPossible() - { - $body = Psr7\stream_for('test'); - $caching = new CachingStream($body); - $this->assertEquals(4, $caching->getSize()); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot seek to byte 10 - */ - public function testCannotSeekPastWhatHasBeenRead() - { - $this->body->seek(10); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage CachingStream::seek() supports SEEK_SET and SEEK_CUR - */ - public function testCannotUseSeekEnd() - { - $this->body->seek(2, SEEK_END); - } - - public function testRewindUsesSeek() - { - $a = Psr7\stream_for('foo'); - $d = $this->getMockBuilder('GuzzleHttp\Psr7\CachingStream') - ->setMethods(array('seek')) - ->setConstructorArgs(array($a)) - ->getMock(); - $d->expects($this->once()) - ->method('seek') - ->with(0) - ->will($this->returnValue(true)); - $d->seek(0); - } - - public function testCanSeekToReadBytes() - { - $this->assertEquals('te', $this->body->read(2)); - $this->body->seek(0); - $this->assertEquals('test', $this->body->read(4)); - $this->assertEquals(4, $this->body->tell()); - $this->body->seek(2); - $this->assertEquals(2, $this->body->tell()); - $this->body->seek(2, SEEK_CUR); - $this->assertEquals(4, $this->body->tell()); - $this->assertEquals('ing', $this->body->read(3)); - } - - public function testWritesToBufferStream() - { - $this->body->read(2); - $this->body->write('hi'); - $this->body->seek(0); - $this->assertEquals('tehiing', (string) $this->body); - } - - public function testSkipsOverwrittenBytes() - { - $decorated = Psr7\stream_for( - implode("\n", array_map(function ($n) { - return str_pad($n, 4, '0', STR_PAD_LEFT); - }, range(0, 25))) - ); - - $body = new CachingStream($decorated); - - $this->assertEquals("0000\n", Psr7\readline($body)); - $this->assertEquals("0001\n", Psr7\readline($body)); - // Write over part of the body yet to be read, so skip some bytes - $this->assertEquals(5, $body->write("TEST\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - // Read, which skips bytes, then reads - $this->assertEquals("0003\n", Psr7\readline($body)); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("0004\n", Psr7\readline($body)); - $this->assertEquals("0005\n", Psr7\readline($body)); - - // Overwrite part of the cached body (so don't skip any bytes) - $body->seek(5); - $this->assertEquals(5, $body->write("ABCD\n")); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("TEST\n", Psr7\readline($body)); - $this->assertEquals("0003\n", Psr7\readline($body)); - $this->assertEquals("0004\n", Psr7\readline($body)); - $this->assertEquals("0005\n", Psr7\readline($body)); - $this->assertEquals("0006\n", Psr7\readline($body)); - $this->assertEquals(5, $body->write("1234\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - - // Seek to 0 and ensure the overwritten bit is replaced - $body->seek(0); - $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); - - // Ensure that casting it to a string does not include the bit that was overwritten - $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); - } - - public function testClosesBothStreams() - { - $s = fopen('php://temp', 'r'); - $a = Psr7\stream_for($s); - $d = new CachingStream($a); - $d->close(); - $this->assertFalse(is_resource($s)); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php deleted file mode 100644 index 915b215237..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertEquals(3, $drop->write('hel')); - $this->assertEquals(2, $drop->write('lo')); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('hello', $drop->read(5)); - $this->assertEquals(0, $drop->getSize()); - $drop->write('12345678910'); - $this->assertEquals(5, $stream->getSize()); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('12345', (string) $drop); - $this->assertEquals(0, $drop->getSize()); - $drop->write('hello'); - $this->assertSame(0, $drop->write('test')); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FnStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FnStreamTest.php deleted file mode 100644 index 66ae90a04a..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FnStreamTest.php +++ /dev/null @@ -1,90 +0,0 @@ -seek(1); - } - - public function testProxiesToFunction() - { - $s = new FnStream([ - 'read' => function ($len) { - $this->assertEquals(3, $len); - return 'foo'; - } - ]); - - $this->assertEquals('foo', $s->read(3)); - } - - public function testCanCloseOnDestruct() - { - $called = false; - $s = new FnStream([ - 'close' => function () use (&$called) { - $called = true; - } - ]); - unset($s); - $this->assertTrue($called); - } - - public function testDoesNotRequireClose() - { - $s = new FnStream([]); - unset($s); - } - - public function testDecoratesStream() - { - $a = Psr7\stream_for('foo'); - $b = FnStream::decorate($a, []); - $this->assertEquals(3, $b->getSize()); - $this->assertEquals($b->isWritable(), true); - $this->assertEquals($b->isReadable(), true); - $this->assertEquals($b->isSeekable(), true); - $this->assertEquals($b->read(3), 'foo'); - $this->assertEquals($b->tell(), 3); - $this->assertEquals($a->tell(), 3); - $this->assertSame('', $a->read(1)); - $this->assertEquals($b->eof(), true); - $this->assertEquals($a->eof(), true); - $b->seek(0); - $this->assertEquals('foo', (string) $b); - $b->seek(0); - $this->assertEquals('foo', $b->getContents()); - $this->assertEquals($a->getMetadata(), $b->getMetadata()); - $b->seek(0, SEEK_END); - $b->write('bar'); - $this->assertEquals('foobar', (string) $b); - $this->assertInternalType('resource', $b->detach()); - $b->close(); - } - - public function testDecoratesWithCustomizations() - { - $called = false; - $a = Psr7\stream_for('foo'); - $b = FnStream::decorate($a, [ - 'read' => function ($len) use (&$called, $a) { - $called = true; - return $a->read($len); - } - ]); - $this->assertEquals('foo', $b->read(3)); - $this->assertTrue($called); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FunctionsTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FunctionsTest.php deleted file mode 100644 index 6675039abe..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/FunctionsTest.php +++ /dev/null @@ -1,574 +0,0 @@ -assertEquals('foobaz', Psr7\copy_to_string($s)); - $s->seek(0); - $this->assertEquals('foo', Psr7\copy_to_string($s, 3)); - $this->assertEquals('baz', Psr7\copy_to_string($s, 3)); - $this->assertEquals('', Psr7\copy_to_string($s)); - } - - public function testCopiesToStringStopsWhenReadFails() - { - $s1 = Psr7\stream_for('foobaz'); - $s1 = FnStream::decorate($s1, [ - 'read' => function () { return ''; } - ]); - $result = Psr7\copy_to_string($s1); - $this->assertEquals('', $result); - } - - public function testCopiesToStream() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - Psr7\copy_to_stream($s1, $s2); - $this->assertEquals('foobaz', (string) $s2); - $s2 = Psr7\stream_for(''); - $s1->seek(0); - Psr7\copy_to_stream($s1, $s2, 3); - $this->assertEquals('foo', (string) $s2); - Psr7\copy_to_stream($s1, $s2, 3); - $this->assertEquals('foobaz', (string) $s2); - } - - public function testStopsCopyToStreamWhenWriteFails() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Psr7\copy_to_stream($s1, $s2); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenWriteFailsWithMaxLen() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Psr7\copy_to_stream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenReadFailsWithMaxLen() - { - $s1 = Psr7\stream_for('foobaz'); - $s1 = FnStream::decorate($s1, ['read' => function () { return ''; }]); - $s2 = Psr7\stream_for(''); - Psr7\copy_to_stream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testReadsLines() - { - $s = Psr7\stream_for("foo\nbaz\nbar"); - $this->assertEquals("foo\n", Psr7\readline($s)); - $this->assertEquals("baz\n", Psr7\readline($s)); - $this->assertEquals("bar", Psr7\readline($s)); - } - - public function testReadsLinesUpToMaxLength() - { - $s = Psr7\stream_for("12345\n"); - $this->assertEquals("123", Psr7\readline($s, 4)); - $this->assertEquals("45\n", Psr7\readline($s)); - } - - public function testReadsLineUntilFalseReturnedFromRead() - { - $s = $this->getMockBuilder('GuzzleHttp\Psr7\Stream') - ->setMethods(['read', 'eof']) - ->disableOriginalConstructor() - ->getMock(); - $s->expects($this->exactly(2)) - ->method('read') - ->will($this->returnCallback(function () { - static $c = false; - if ($c) { - return false; - } - $c = true; - return 'h'; - })); - $s->expects($this->exactly(2)) - ->method('eof') - ->will($this->returnValue(false)); - $this->assertEquals("h", Psr7\readline($s)); - } - - public function testCalculatesHash() - { - $s = Psr7\stream_for('foobazbar'); - $this->assertEquals(md5('foobazbar'), Psr7\hash($s, 'md5')); - } - - /** - * @expectedException \RuntimeException - */ - public function testCalculatesHashThrowsWhenSeekFails() - { - $s = new NoSeekStream(Psr7\stream_for('foobazbar')); - $s->read(2); - Psr7\hash($s, 'md5'); - } - - public function testCalculatesHashSeeksToOriginalPosition() - { - $s = Psr7\stream_for('foobazbar'); - $s->seek(4); - $this->assertEquals(md5('foobazbar'), Psr7\hash($s, 'md5')); - $this->assertEquals(4, $s->tell()); - } - - public function testOpensFilesSuccessfully() - { - $r = Psr7\try_fopen(__FILE__, 'r'); - $this->assertInternalType('resource', $r); - fclose($r); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r - */ - public function testThrowsExceptionNotWarning() - { - Psr7\try_fopen('/path/to/does/not/exist', 'r'); - } - - public function parseQueryProvider() - { - return [ - // Does not need to parse when the string is empty - ['', []], - // Can parse mult-values items - ['q=a&q=b', ['q' => ['a', 'b']]], - // Can parse multi-valued items that use numeric indices - ['q[0]=a&q[1]=b', ['q[0]' => 'a', 'q[1]' => 'b']], - // Can parse duplicates and does not include numeric indices - ['q[]=a&q[]=b', ['q[]' => ['a', 'b']]], - // Ensures that the value of "q" is an array even though one value - ['q[]=a', ['q[]' => 'a']], - // Does not modify "." to "_" like PHP's parse_str() - ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']], - // Can decode %20 to " " - ['q%20a=a%20b', ['q a' => 'a b']], - // Can parse funky strings with no values by assigning each to null - ['q&a', ['q' => null, 'a' => null]], - // Does not strip trailing equal signs - ['data=abc=', ['data' => 'abc=']], - // Can store duplicates without affecting other values - ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']], - // Sets value to null when no "=" is present - ['foo', ['foo' => null]], - // Preserves "0" keys. - ['0', ['0' => null]], - // Sets the value to an empty string when "=" is present - ['0=', ['0' => '']], - // Preserves falsey keys - ['var=0', ['var' => '0']], - ['a[b][c]=1&a[b][c]=2', ['a[b][c]' => ['1', '2']]], - ['a[b]=c&a[d]=e', ['a[b]' => 'c', 'a[d]' => 'e']], - // Ensure it doesn't leave things behind with repeated values - // Can parse mult-values items - ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]], - ]; - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesQueries($input, $output) - { - $result = Psr7\parse_query($input); - $this->assertSame($output, $result); - } - - public function testDoesNotDecode() - { - $str = 'foo%20=bar'; - $data = Psr7\parse_query($str, false); - $this->assertEquals(['foo%20' => 'bar'], $data); - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesAndBuildsQueries($input, $output) - { - $result = Psr7\parse_query($input, false); - $this->assertSame($input, Psr7\build_query($result, false)); - } - - public function testEncodesWithRfc1738() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], PHP_QUERY_RFC1738); - $this->assertEquals('foo+bar=baz%2B', $str); - } - - public function testEncodesWithRfc3986() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], PHP_QUERY_RFC3986); - $this->assertEquals('foo%20bar=baz%2B', $str); - } - - public function testDoesNotEncode() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], false); - $this->assertEquals('foo bar=baz+', $str); - } - - public function testCanControlDecodingType() - { - $result = Psr7\parse_query('var=foo+bar', PHP_QUERY_RFC3986); - $this->assertEquals('foo+bar', $result['var']); - $result = Psr7\parse_query('var=foo+bar', PHP_QUERY_RFC1738); - $this->assertEquals('foo bar', $result['var']); - } - - public function testParsesRequestMessages() - { - $req = "GET /abc HTTP/1.0\r\nHost: foo.com\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $request = Psr7\parse_request($req); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('/abc', $request->getRequestTarget()); - $this->assertEquals('1.0', $request->getProtocolVersion()); - $this->assertEquals('foo.com', $request->getHeaderLine('Host')); - $this->assertEquals('Bar', $request->getHeaderLine('Foo')); - $this->assertEquals('Bam, Qux', $request->getHeaderLine('Baz')); - $this->assertEquals('Test', (string) $request->getBody()); - $this->assertEquals('http://foo.com/abc', (string) $request->getUri()); - } - - public function testParsesRequestMessagesWithHttpsScheme() - { - $req = "PUT /abc?baz=bar HTTP/1.1\r\nHost: foo.com:443\r\n\r\n"; - $request = Psr7\parse_request($req); - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('/abc?baz=bar', $request->getRequestTarget()); - $this->assertEquals('1.1', $request->getProtocolVersion()); - $this->assertEquals('foo.com:443', $request->getHeaderLine('Host')); - $this->assertEquals('', (string) $request->getBody()); - $this->assertEquals('https://foo.com/abc?baz=bar', (string) $request->getUri()); - } - - public function testParsesRequestMessagesWithUriWhenHostIsNotFirst() - { - $req = "PUT / HTTP/1.1\r\nFoo: Bar\r\nHost: foo.com\r\n\r\n"; - $request = Psr7\parse_request($req); - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('/', $request->getRequestTarget()); - $this->assertEquals('http://foo.com/', (string) $request->getUri()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRequestMessages() - { - Psr7\parse_request("HTTP/1.1 200 OK\r\n\r\n"); - } - - public function testParsesResponseMessages() - { - $res = "HTTP/1.0 200 OK\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $response = Psr7\parse_response($res); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals('1.0', $response->getProtocolVersion()); - $this->assertEquals('Bar', $response->getHeaderLine('Foo')); - $this->assertEquals('Bam, Qux', $response->getHeaderLine('Baz')); - $this->assertEquals('Test', (string) $response->getBody()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesResponseMessages() - { - Psr7\parse_response("GET / HTTP/1.1\r\n\r\n"); - } - - public function testDetermineMimetype() - { - $this->assertNull(Psr7\mimetype_from_extension('not-a-real-extension')); - $this->assertEquals( - 'application/json', - Psr7\mimetype_from_extension('json') - ); - $this->assertEquals( - 'image/jpeg', - Psr7\mimetype_from_filename('/tmp/images/IMG034821.JPEG') - ); - } - - public function testCreatesUriForValue() - { - $this->assertInstanceOf('GuzzleHttp\Psr7\Uri', Psr7\uri_for('/foo')); - $this->assertInstanceOf( - 'GuzzleHttp\Psr7\Uri', - Psr7\uri_for(new Psr7\Uri('/foo')) - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUri() - { - Psr7\uri_for([]); - } - - public function testKeepsPositionOfResource() - { - $h = fopen(__FILE__, 'r'); - fseek($h, 10); - $stream = Psr7\stream_for($h); - $this->assertEquals(10, $stream->tell()); - $stream->close(); - } - - public function testCreatesWithFactory() - { - $stream = Psr7\stream_for('foo'); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $stream); - $this->assertEquals('foo', $stream->getContents()); - $stream->close(); - } - - public function testFactoryCreatesFromEmptyString() - { - $s = Psr7\stream_for(); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromNull() - { - $s = Psr7\stream_for(null); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromResource() - { - $r = fopen(__FILE__, 'r'); - $s = Psr7\stream_for($r); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - $this->assertSame(file_get_contents(__FILE__), (string) $s); - } - - public function testFactoryCreatesFromObjectWithToString() - { - $r = new HasToString(); - $s = Psr7\stream_for($r); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - $this->assertEquals('foo', (string) $s); - } - - public function testCreatePassesThrough() - { - $s = Psr7\stream_for('foo'); - $this->assertSame($s, Psr7\stream_for($s)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionForUnknown() - { - Psr7\stream_for(new \stdClass()); - } - - public function testReturnsCustomMetadata() - { - $s = Psr7\stream_for('foo', ['metadata' => ['hwm' => 3]]); - $this->assertEquals(3, $s->getMetadata('hwm')); - $this->assertArrayHasKey('hwm', $s->getMetadata()); - } - - public function testCanSetSize() - { - $s = Psr7\stream_for('', ['size' => 10]); - $this->assertEquals(10, $s->getSize()); - } - - public function testCanCreateIteratorBasedStream() - { - $a = new \ArrayIterator(['foo', 'bar', '123']); - $p = Psr7\stream_for($a); - $this->assertInstanceOf('GuzzleHttp\Psr7\PumpStream', $p); - $this->assertEquals('foo', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('r12', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('3', $p->getContents()); - $this->assertTrue($p->eof()); - $this->assertEquals(9, $p->tell()); - } - - public function testConvertsRequestsToStrings() - { - $request = new Psr7\Request('PUT', 'http://foo.com/hi?123', [ - 'Baz' => 'bar', - 'Qux' => ' ipsum' - ], 'hello', '1.0'); - $this->assertEquals( - "PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\str($request) - ); - } - - public function testConvertsResponsesToStrings() - { - $response = new Psr7\Response(200, [ - 'Baz' => 'bar', - 'Qux' => ' ipsum' - ], 'hello', '1.0', 'FOO'); - $this->assertEquals( - "HTTP/1.0 200 FOO\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\str($response) - ); - } - - public function parseParamsProvider() - { - $res1 = array( - array( - '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - array( - '', - 'rel' => 'back', - 'type' => 'image/jpeg', - ), - ); - return array( - array( - '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', - $res1 - ), - array( - '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"', - $res1 - ), - array( - 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"', - array( - array('foo' => 'baz', 'bar' => '123'), - array('boo'), - array('test' => '123'), - array('foobar' => 'foo;bar') - ) - ), - array( - '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', - array( - array('', 'rel' => 'side', 'type' => 'image/jpeg'), - array('', 'rel' => 'side', 'type' => 'image/jpeg') - ) - ), - array( - '', - array() - ) - ); - } - /** - * @dataProvider parseParamsProvider - */ - public function testParseParams($header, $result) - { - $this->assertEquals($result, Psr7\parse_header($header)); - } - - public function testParsesArrayHeaders() - { - $header = ['a, b', 'c', 'd, e']; - $this->assertEquals(['a', 'b', 'c', 'd', 'e'], Psr7\normalize_header($header)); - } - - public function testRewindsBody() - { - $body = Psr7\stream_for('abc'); - $res = new Psr7\Response(200, [], $body); - Psr7\rewind_body($res); - $this->assertEquals(0, $body->tell()); - $body->rewind(1); - Psr7\rewind_body($res); - $this->assertEquals(0, $body->tell()); - } - - /** - * @expectedException \RuntimeException - */ - public function testThrowsWhenBodyCannotBeRewound() - { - $body = Psr7\stream_for('abc'); - $body->read(1); - $body = FnStream::decorate($body, [ - 'rewind' => function () { throw new \RuntimeException('a'); } - ]); - $res = new Psr7\Response(200, [], $body); - Psr7\rewind_body($res); - } - - public function testCanModifyRequestWithUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, [ - 'uri' => new Psr7\Uri('http://www.foo.com') - ]); - $this->assertEquals('http://www.foo.com', (string) $r2->getUri()); - $this->assertEquals('www.foo.com', (string) $r2->getHeaderLine('host')); - } - - public function testCanModifyRequestWithCaseInsensitiveHeader() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['User-Agent' => 'foo']); - $r2 = Psr7\modify_request($r1, ['set_headers' => ['User-agent' => 'bar']]); - $this->assertEquals('bar', $r2->getHeaderLine('User-Agent')); - $this->assertEquals('bar', $r2->getHeaderLine('User-agent')); - } - - public function testReturnsAsIsWhenNoChanges() - { - $request = new Psr7\Request('GET', 'http://foo.com'); - $this->assertSame($request, Psr7\modify_request($request, [])); - } - - public function testReturnsUriAsIsWhenNoChanges() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, ['set_headers' => ['foo' => 'bar']]); - $this->assertNotSame($r1, $r2); - $this->assertEquals('bar', $r2->getHeaderLine('foo')); - } - - public function testRemovesHeadersFromMessage() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['foo' => 'bar']); - $r2 = Psr7\modify_request($r1, ['remove_headers' => ['foo']]); - $this->assertNotSame($r1, $r2); - $this->assertFalse($r2->hasHeader('foo')); - } - - public function testAddsQueryToUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, ['query' => 'foo=bar']); - $this->assertNotSame($r1, $r2); - $this->assertEquals('foo=bar', $r2->getUri()->getQuery()); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php deleted file mode 100644 index 927fc0b7bf..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertEquals('test', (string) $b); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php deleted file mode 100644 index fdef1423da..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php +++ /dev/null @@ -1,64 +0,0 @@ -fname = tempnam('/tmp', 'tfile'); - - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function tearDown() - { - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function testOpensLazily() - { - $l = new LazyOpenStream($this->fname, 'w+'); - $l->write('foo'); - $this->assertInternalType('array', $l->getMetadata()); - $this->assertFileExists($this->fname); - $this->assertEquals('foo', file_get_contents($this->fname)); - $this->assertEquals('foo', (string) $l); - } - - public function testProxiesToFile() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $this->assertEquals('foo', $l->read(4)); - $this->assertTrue($l->eof()); - $this->assertEquals(3, $l->tell()); - $this->assertTrue($l->isReadable()); - $this->assertTrue($l->isSeekable()); - $this->assertFalse($l->isWritable()); - $l->seek(1); - $this->assertEquals('oo', $l->getContents()); - $this->assertEquals('foo', (string) $l); - $this->assertEquals(3, $l->getSize()); - $this->assertInternalType('array', $l->getMetadata()); - $l->close(); - } - - public function testDetachesUnderlyingStream() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $r = $l->detach(); - $this->assertInternalType('resource', $r); - fseek($r, 0); - $this->assertEquals('foo', stream_get_contents($r)); - fclose($r); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php deleted file mode 100644 index 2198b7a9b3..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php +++ /dev/null @@ -1,166 +0,0 @@ -decorated = Psr7\stream_for(fopen(__FILE__, 'r')); - $this->body = new LimitStream($this->decorated, 10, 3); - } - - public function testReturnsSubset() - { - $body = new LimitStream(Psr7\stream_for('foo'), -1, 1); - $this->assertEquals('oo', (string) $body); - $this->assertTrue($body->eof()); - $body->seek(0); - $this->assertFalse($body->eof()); - $this->assertEquals('oo', $body->read(100)); - $this->assertSame('', $body->read(1)); - $this->assertTrue($body->eof()); - } - - public function testReturnsSubsetWhenCastToString() - { - $body = Psr7\stream_for('foo_baz_bar'); - $limited = new LimitStream($body, 3, 4); - $this->assertEquals('baz', (string) $limited); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to seek to stream position 10 with whence 0 - */ - public function testEnsuresPositionCanBeekSeekedTo() - { - new LimitStream(Psr7\stream_for(''), 0, 10); - } - - public function testReturnsSubsetOfEmptyBodyWhenCastToString() - { - $body = Psr7\stream_for('01234567891234'); - $limited = new LimitStream($body, 0, 10); - $this->assertEquals('', (string) $limited); - } - - public function testReturnsSpecificSubsetOBodyWhenCastToString() - { - $body = Psr7\stream_for('0123456789abcdef'); - $limited = new LimitStream($body, 3, 10); - $this->assertEquals('abc', (string) $limited); - } - - public function testSeeksWhenConstructed() - { - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - } - - public function testAllowsBoundedSeek() - { - $this->body->seek(100); - $this->assertEquals(10, $this->body->tell()); - $this->assertEquals(13, $this->decorated->tell()); - $this->body->seek(0); - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - try { - $this->body->seek(-10); - $this->fail(); - } catch (\RuntimeException $e) {} - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - $this->body->seek(5); - $this->assertEquals(5, $this->body->tell()); - $this->assertEquals(8, $this->decorated->tell()); - // Fail - try { - $this->body->seek(1000, SEEK_END); - $this->fail(); - } catch (\RuntimeException $e) {} - } - - public function testReadsOnlySubsetOfData() - { - $data = $this->body->read(100); - $this->assertEquals(10, strlen($data)); - $this->assertSame('', $this->body->read(1000)); - - $this->body->setOffset(10); - $newData = $this->body->read(100); - $this->assertEquals(10, strlen($newData)); - $this->assertNotSame($data, $newData); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Could not seek to stream offset 2 - */ - public function testThrowsWhenCurrentGreaterThanOffsetSeek() - { - $a = Psr7\stream_for('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $a->getContents(); - $c->setOffset(2); - } - - public function testCanGetContentsWithoutSeeking() - { - $a = Psr7\stream_for('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $this->assertEquals('foo_bar', $c->getContents()); - } - - public function testClaimsConsumedWhenReadLimitIsReached() - { - $this->assertFalse($this->body->eof()); - $this->body->read(1000); - $this->assertTrue($this->body->eof()); - } - - public function testContentLengthIsBounded() - { - $this->assertEquals(10, $this->body->getSize()); - } - - public function testGetContentsIsBasedOnSubset() - { - $body = new LimitStream(Psr7\stream_for('foobazbar'), 3, 3); - $this->assertEquals('baz', $body->getContents()); - } - - public function testReturnsNullIfSizeCannotBeDetermined() - { - $a = new FnStream([ - 'getSize' => function () { return null; }, - 'tell' => function () { return 0; }, - ]); - $b = new LimitStream($a); - $this->assertNull($b->getSize()); - } - - public function testLengthLessOffsetWhenNoLimitSize() - { - $a = Psr7\stream_for('foo_bar'); - $b = new LimitStream($a, -1, 4); - $this->assertEquals(3, $b->getSize()); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php deleted file mode 100644 index 61edb067a0..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php +++ /dev/null @@ -1,214 +0,0 @@ -assertNotEmpty($b->getBoundary()); - } - - public function testCanProvideBoundary() - { - $b = new MultipartStream([], 'foo'); - $this->assertEquals('foo', $b->getBoundary()); - } - - public function testIsNotWritable() - { - $b = new MultipartStream(); - $this->assertFalse($b->isWritable()); - } - - public function testCanCreateEmptyStream() - { - $b = new MultipartStream(); - $boundary = $b->getBoundary(); - $this->assertSame("--{$boundary}--\r\n", $b->getContents()); - $this->assertSame(strlen($boundary) + 6, $b->getSize()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesFilesArrayElement() - { - new MultipartStream([['foo' => 'bar']]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresFileHasName() - { - new MultipartStream([['contents' => 'bar']]); - } - - public function testSerializesFields() - { - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => 'bar' - ], - [ - 'name' => 'baz', - 'contents' => 'bam' - ] - ], 'boundary'); - $this->assertEquals( - "--boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n\r\n" - . "bar\r\n--boundary\r\nContent-Disposition: form-data; name=\"baz\"\r\nContent-Length: 3" - . "\r\n\r\nbam\r\n--boundary--\r\n", (string) $b); - } - - public function testSerializesFiles() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $f3 = Psr7\FnStream::decorate(Psr7\stream_for('bar'), [ - 'getMetadata' => function () { - return '/foo/bar.gif'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1 - ], - [ - 'name' => 'qux', - 'contents' => $f2 - ], - [ - 'name' => 'qux', - 'contents' => $f3 - ], - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } - - public function testSerializesFilesWithCustomHeaders() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ] - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } - - public function testSerializesFilesWithCustomHeadersAndMultipleValues() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ], - [ - 'name' => 'foo', - 'contents' => $f2, - 'headers' => ['cOntenT-Type' => 'custom'], - ] - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php deleted file mode 100644 index a309317bdf..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php +++ /dev/null @@ -1,40 +0,0 @@ -getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'seek']) - ->getMockForAbstractClass(); - $s->expects($this->never())->method('seek'); - $s->expects($this->never())->method('isSeekable'); - $wrapped = new NoSeekStream($s); - $this->assertFalse($wrapped->isSeekable()); - $wrapped->seek(2); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot write to a non-writable stream - */ - public function testHandlesClose() - { - $s = Psr7\stream_for('foo'); - $wrapped = new NoSeekStream($s); - $wrapped->close(); - $wrapped->write('foo'); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php deleted file mode 100644 index 7358bb6e0b..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php +++ /dev/null @@ -1,72 +0,0 @@ - ['foo' => 'bar'], - 'size' => 100 - ]); - - $this->assertEquals('bar', $p->getMetadata('foo')); - $this->assertEquals(['foo' => 'bar'], $p->getMetadata()); - $this->assertEquals(100, $p->getSize()); - } - - public function testCanReadFromCallable() - { - $p = Psr7\stream_for(function ($size) { - return 'a'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals(1, $p->tell()); - $this->assertEquals('aaaaa', $p->read(5)); - $this->assertEquals(6, $p->tell()); - } - - public function testStoresExcessDataInBuffer() - { - $called = []; - $p = Psr7\stream_for(function ($size) use (&$called) { - $called[] = $size; - return 'abcdef'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('cdef', $p->read(4)); - $this->assertEquals('abcdefabc', $p->read(9)); - $this->assertEquals([1, 9, 3], $called); - } - - public function testInifiniteStreamWrappedInLimitStream() - { - $p = Psr7\stream_for(function () { return 'a'; }); - $s = new LimitStream($p, 5); - $this->assertEquals('aaaaa', (string) $s); - } - - public function testDescribesCapabilities() - { - $p = Psr7\stream_for(function () {}); - $this->assertTrue($p->isReadable()); - $this->assertFalse($p->isSeekable()); - $this->assertFalse($p->isWritable()); - $this->assertNull($p->getSize()); - $this->assertEquals('', $p->getContents()); - $this->assertEquals('', (string) $p); - $p->close(); - $this->assertEquals('', $p->read(10)); - $this->assertTrue($p->eof()); - - try { - $this->assertFalse($p->write('aa')); - $this->fail(); - } catch (\RuntimeException $e) {} - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/RequestTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/RequestTest.php deleted file mode 100644 index 9defe68d9e..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/RequestTest.php +++ /dev/null @@ -1,157 +0,0 @@ -assertEquals('/', (string) $r->getUri()); - } - - public function testRequestUriMayBeUri() - { - $uri = new Uri('/'); - $r = new Request('GET', $uri); - $this->assertSame($uri, $r->getUri()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidateRequestUri() - { - new Request('GET', true); - } - - public function testCanConstructWithBody() - { - $r = new Request('GET', '/', [], 'baz'); - $this->assertEquals('baz', (string) $r->getBody()); - } - - public function testCapitalizesMethod() - { - $r = new Request('get', '/'); - $this->assertEquals('GET', $r->getMethod()); - } - - public function testCapitalizesWithMethod() - { - $r = new Request('GET', '/'); - $this->assertEquals('PUT', $r->withMethod('put')->getMethod()); - } - - public function testWithUri() - { - $r1 = new Request('GET', '/'); - $u1 = $r1->getUri(); - $u2 = new Uri('http://www.example.com'); - $r2 = $r1->withUri($u2); - $this->assertNotSame($r1, $r2); - $this->assertSame($u2, $r2->getUri()); - $this->assertSame($u1, $r1->getUri()); - } - - public function testSameInstanceWhenSameUri() - { - $r1 = new Request('GET', 'http://foo.com'); - $r2 = $r1->withUri($r1->getUri()); - $this->assertSame($r1, $r2); - } - - public function testWithRequestTarget() - { - $r1 = new Request('GET', '/'); - $r2 = $r1->withRequestTarget('*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $this->assertEquals('/', $r1->getRequestTarget()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testRequestTargetDoesNotAllowSpaces() - { - $r1 = new Request('GET', '/'); - $r1->withRequestTarget('/foo bar'); - } - - public function testRequestTargetDefaultsToSlash() - { - $r1 = new Request('GET', ''); - $this->assertEquals('/', $r1->getRequestTarget()); - $r2 = new Request('GET', '*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $r3 = new Request('GET', 'http://foo.com/bar baz/'); - $this->assertEquals('/bar%20baz/', $r3->getRequestTarget()); - } - - public function testBuildsRequestTarget() - { - $r1 = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals('/baz?bar=bam', $r1->getRequestTarget()); - } - - public function testHostIsAddedFirst() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Foo' => 'Bar']); - $this->assertEquals([ - 'Host' => ['foo.com'], - 'Foo' => ['Bar'] - ], $r->getHeaders()); - } - - public function testCanGetHeaderAsCsv() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', [ - 'Foo' => ['a', 'b', 'c'] - ]); - $this->assertEquals('a, b, c', $r->getHeaderLine('Foo')); - $this->assertEquals('', $r->getHeaderLine('Bar')); - } - - public function testHostIsNotOverwrittenWhenPreservingHost() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Host' => 'a.com']); - $this->assertEquals(['Host' => ['a.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.foo.com/bar'), true); - $this->assertEquals('a.com', $r2->getHeaderLine('Host')); - } - - public function testOverridesHostWithUri() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals(['Host' => ['foo.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.baz.com/bar')); - $this->assertEquals('www.baz.com', $r2->getHeaderLine('Host')); - } - - public function testAggregatesHeaders() - { - $r = new Request('GET', 'http://foo.com', [ - 'ZOO' => 'zoobar', - 'zoo' => ['foobar', 'zoobar'] - ]); - $this->assertEquals('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); - } - - public function testAddsPortToHeader() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $this->assertEquals('foo.com:8124', $r->getHeaderLine('host')); - } - - public function testAddsPortToHeaderAndReplacePreviousPort() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $r = $r->withUri(new Uri('http://foo.com:8125/bar')); - $this->assertEquals('foo.com:8125', $r->getHeaderLine('host')); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/ResponseTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/ResponseTest.php deleted file mode 100644 index e8702924b1..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/ResponseTest.php +++ /dev/null @@ -1,139 +0,0 @@ -assertSame(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - } - - public function testCanGiveCustomReason() - { - $r = new Response(200, [], null, '1.1', 'bar'); - $this->assertEquals('bar', $r->getReasonPhrase()); - } - - public function testCanGiveCustomProtocolVersion() - { - $r = new Response(200, [], null, '1000'); - $this->assertEquals('1000', $r->getProtocolVersion()); - } - - public function testCanCreateNewResponseWithStatusAndNoReason() - { - $r = new Response(200); - $r2 = $r->withStatus(201); - $this->assertEquals(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - $this->assertEquals(201, $r2->getStatusCode()); - $this->assertEquals('Created', $r2->getReasonPhrase()); - } - - public function testCanCreateNewResponseWithStatusAndReason() - { - $r = new Response(200); - $r2 = $r->withStatus(201, 'Foo'); - $this->assertEquals(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - $this->assertEquals(201, $r2->getStatusCode()); - $this->assertEquals('Foo', $r2->getReasonPhrase()); - } - - public function testCreatesResponseWithAddedHeaderArray() - { - $r = new Response(); - $r2 = $r->withAddedHeader('foo', ['baz', 'bar']); - $this->assertFalse($r->hasHeader('foo')); - $this->assertEquals('baz, bar', $r2->getHeaderLine('foo')); - } - - public function testReturnsIdentityWhenRemovingMissingHeader() - { - $r = new Response(); - $this->assertSame($r, $r->withoutHeader('foo')); - } - - public function testAlwaysReturnsBody() - { - $r = new Response(); - $this->assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - } - - public function testCanSetHeaderAsArray() - { - $r = new Response(200, [ - 'foo' => ['baz ', ' bar '] - ]); - $this->assertEquals('baz, bar', $r->getHeaderLine('foo')); - $this->assertEquals(['baz', 'bar'], $r->getHeader('foo')); - } - - public function testSameInstanceWhenSameBody() - { - $r = new Response(200, [], 'foo'); - $b = $r->getBody(); - $this->assertSame($r, $r->withBody($b)); - } - - public function testNewInstanceWhenNewBody() - { - $r = new Response(200, [], 'foo'); - $b2 = Psr7\stream_for('abc'); - $this->assertNotSame($r, $r->withBody($b2)); - } - - public function testSameInstanceWhenSameProtocol() - { - $r = new Response(200); - $this->assertSame($r, $r->withProtocolVersion('1.1')); - } - - public function testNewInstanceWhenNewProtocol() - { - $r = new Response(200); - $this->assertNotSame($r, $r->withProtocolVersion('1.0')); - } - - public function testNewInstanceWhenRemovingHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withoutHeader('Foo'); - $this->assertNotSame($r, $r2); - $this->assertFalse($r2->hasHeader('foo')); - } - - public function testNewInstanceWhenAddingHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('Foo', 'Baz'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bar, Baz', $r2->getHeaderLine('foo')); - } - - public function testNewInstanceWhenAddingHeaderThatWasNotThereBefore() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('Baz', 'Bam'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bam', $r2->getHeaderLine('Baz')); - $this->assertEquals('Bar', $r2->getHeaderLine('Foo')); - } - - public function testRemovesPreviouslyAddedHeaderOfDifferentCase() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('foo', 'Bam'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bam', $r2->getHeaderLine('Foo')); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php deleted file mode 100644 index 682079e0cc..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php +++ /dev/null @@ -1,137 +0,0 @@ -c = fopen('php://temp', 'r+'); - fwrite($this->c, 'foo'); - fseek($this->c, 0); - $this->a = Psr7\stream_for($this->c); - $this->b = new Str($this->a); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['read']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \Exception('foo'))); - $msg = ''; - set_error_handler(function ($errNo, $str) use (&$msg) { $msg = $str; }); - echo new Str($s); - restore_error_handler(); - $this->assertContains('foo', $msg); - } - - public function testToString() - { - $this->assertEquals('foo', (string) $this->b); - } - - public function testHasSize() - { - $this->assertEquals(3, $this->b->getSize()); - } - - public function testReads() - { - $this->assertEquals('foo', $this->b->read(10)); - } - - public function testCheckMethods() - { - $this->assertEquals($this->a->isReadable(), $this->b->isReadable()); - $this->assertEquals($this->a->isWritable(), $this->b->isWritable()); - $this->assertEquals($this->a->isSeekable(), $this->b->isSeekable()); - } - - public function testSeeksAndTells() - { - $this->b->seek(1); - $this->assertEquals(1, $this->a->tell()); - $this->assertEquals(1, $this->b->tell()); - $this->b->seek(0); - $this->assertEquals(0, $this->a->tell()); - $this->assertEquals(0, $this->b->tell()); - $this->b->seek(0, SEEK_END); - $this->assertEquals(3, $this->a->tell()); - $this->assertEquals(3, $this->b->tell()); - } - - public function testGetsContents() - { - $this->assertEquals('foo', $this->b->getContents()); - $this->assertEquals('', $this->b->getContents()); - $this->b->seek(1); - $this->assertEquals('oo', $this->b->getContents(1)); - } - - public function testCloses() - { - $this->b->close(); - $this->assertFalse(is_resource($this->c)); - } - - public function testDetaches() - { - $this->b->detach(); - $this->assertFalse($this->b->isReadable()); - } - - public function testWrapsMetadata() - { - $this->assertSame($this->b->getMetadata(), $this->a->getMetadata()); - $this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); - } - - public function testWrapsWrites() - { - $this->b->seek(0, SEEK_END); - $this->b->write('foo'); - $this->assertEquals('foofoo', (string) $this->a); - } - - /** - * @expectedException \UnexpectedValueException - */ - public function testThrowsWithInvalidGetter() - { - $this->b->foo; - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsWhenGetterNotImplemented() - { - $s = new BadStream(); - $s->stream; - } -} - -class BadStream -{ - use StreamDecoratorTrait; - - public function __construct() {} -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamTest.php deleted file mode 100644 index 4fe92cc6b5..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamTest.php +++ /dev/null @@ -1,161 +0,0 @@ -assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertTrue($stream->isSeekable()); - $this->assertEquals('php://temp', $stream->getMetadata('uri')); - $this->assertInternalType('array', $stream->getMetadata()); - $this->assertEquals(4, $stream->getSize()); - $this->assertFalse($stream->eof()); - $stream->close(); - } - - public function testStreamClosesHandleOnDestruct() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - unset($stream); - $this->assertFalse(is_resource($handle)); - } - - public function testConvertsToString() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('data', (string) $stream); - $this->assertEquals('data', (string) $stream); - $stream->close(); - } - - public function testGetsContents() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('', $stream->getContents()); - $stream->seek(0); - $this->assertEquals('data', $stream->getContents()); - $this->assertEquals('', $stream->getContents()); - } - - public function testChecksEof() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertFalse($stream->eof()); - $stream->read(4); - $this->assertTrue($stream->eof()); - $stream->close(); - } - - public function testGetSize() - { - $size = filesize(__FILE__); - $handle = fopen(__FILE__, 'r'); - $stream = new Stream($handle); - $this->assertEquals($size, $stream->getSize()); - // Load from cache - $this->assertEquals($size, $stream->getSize()); - $stream->close(); - } - - public function testEnsuresSizeIsConsistent() - { - $h = fopen('php://temp', 'w+'); - $this->assertEquals(3, fwrite($h, 'foo')); - $stream = new Stream($h); - $this->assertEquals(3, $stream->getSize()); - $this->assertEquals(4, $stream->write('test')); - $this->assertEquals(7, $stream->getSize()); - $this->assertEquals(7, $stream->getSize()); - $stream->close(); - } - - public function testProvidesStreamPosition() - { - $handle = fopen('php://temp', 'w+'); - $stream = new Stream($handle); - $this->assertEquals(0, $stream->tell()); - $stream->write('foo'); - $this->assertEquals(3, $stream->tell()); - $stream->seek(1); - $this->assertEquals(1, $stream->tell()); - $this->assertSame(ftell($handle), $stream->tell()); - $stream->close(); - } - - public function testCanDetachStream() - { - $r = fopen('php://temp', 'w+'); - $stream = new Stream($r); - $stream->write('foo'); - $this->assertTrue($stream->isReadable()); - $this->assertSame($r, $stream->detach()); - $stream->detach(); - - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertFalse($stream->isSeekable()); - - $throws = function (callable $fn) use ($stream) { - try { - $fn($stream); - $this->fail(); - } catch (\Exception $e) {} - }; - - $throws(function ($stream) { $stream->read(10); }); - $throws(function ($stream) { $stream->write('bar'); }); - $throws(function ($stream) { $stream->seek(10); }); - $throws(function ($stream) { $stream->tell(); }); - $throws(function ($stream) { $stream->eof(); }); - $throws(function ($stream) { $stream->getSize(); }); - $throws(function ($stream) { $stream->getContents(); }); - $this->assertSame('', (string) $stream); - $stream->close(); - } - - public function testCloseClearProperties() - { - $handle = fopen('php://temp', 'r+'); - $stream = new Stream($handle); - $stream->close(); - - $this->assertFalse($stream->isSeekable()); - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertNull($stream->getSize()); - $this->assertEmpty($stream->getMetadata()); - } - - public function testDoesNotThrowInToString() - { - $s = \GuzzleHttp\Psr7\stream_for('foo'); - $s = new NoSeekStream($s); - $this->assertEquals('foo', (string) $s); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php deleted file mode 100644 index 0156e5988e..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertSame('foo', fread($handle, 3)); - $this->assertSame(3, ftell($handle)); - $this->assertSame(3, fwrite($handle, 'bar')); - $this->assertSame(0, fseek($handle, 0)); - $this->assertSame('foobar', fread($handle, 6)); - $this->assertSame('', fread($handle, 1)); - $this->assertTrue(feof($handle)); - - // This fails on HHVM for some reason - if (!defined('HHVM_VERSION')) { - $this->assertEquals([ - 'dev' => 0, - 'ino' => 0, - 'mode' => 33206, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 6, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0, - 0 => 0, - 1 => 0, - 2 => 33206, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 6, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 0, - 12 => 0, - ], fstat($handle)); - } - - $this->assertTrue(fclose($handle)); - $this->assertSame('foobar', (string) $stream); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(false)); - StreamWrapper::getResource($stream); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ - public function testReturnsFalseWhenStreamDoesNotExist() - { - fopen('guzzle://foo', 'r'); - } - - public function testCanOpenReadonlyStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(true)); - $r = StreamWrapper::getResource($stream); - $this->assertInternalType('resource', $r); - fclose($r); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/UriTest.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/UriTest.php deleted file mode 100644 index 80755da0f6..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/UriTest.php +++ /dev/null @@ -1,245 +0,0 @@ -assertEquals( - 'https://michael:test@test.com/path/123?q=abc#test', - (string) $uri - ); - - $this->assertEquals('test', $uri->getFragment()); - $this->assertEquals('test.com', $uri->getHost()); - $this->assertEquals('/path/123', $uri->getPath()); - $this->assertEquals(null, $uri->getPort()); - $this->assertEquals('q=abc', $uri->getQuery()); - $this->assertEquals('https', $uri->getScheme()); - $this->assertEquals('michael:test', $uri->getUserInfo()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unable to parse URI - */ - public function testValidatesUriCanBeParsed() - { - new Uri('///'); - } - - public function testCanTransformAndRetrievePartsIndividually() - { - $uri = (new Uri('')) - ->withFragment('#test') - ->withHost('example.com') - ->withPath('path/123') - ->withPort(8080) - ->withQuery('?q=abc') - ->withScheme('http') - ->withUserInfo('user', 'pass'); - - // Test getters. - $this->assertEquals('user:pass@example.com:8080', $uri->getAuthority()); - $this->assertEquals('test', $uri->getFragment()); - $this->assertEquals('example.com', $uri->getHost()); - $this->assertEquals('path/123', $uri->getPath()); - $this->assertEquals(8080, $uri->getPort()); - $this->assertEquals('q=abc', $uri->getQuery()); - $this->assertEquals('http', $uri->getScheme()); - $this->assertEquals('user:pass', $uri->getUserInfo()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPortMustBeValid() - { - (new Uri(''))->withPort(100000); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPathMustBeValid() - { - (new Uri(''))->withPath([]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testQueryMustBeValid() - { - (new Uri(''))->withQuery(new \stdClass); - } - - public function testAllowsFalseyUrlParts() - { - $url = new Uri('http://a:1/0?0#0'); - $this->assertSame('a', $url->getHost()); - $this->assertEquals(1, $url->getPort()); - $this->assertSame('/0', $url->getPath()); - $this->assertEquals('0', (string) $url->getQuery()); - $this->assertSame('0', $url->getFragment()); - $this->assertEquals('http://a:1/0?0#0', (string) $url); - $url = new Uri(''); - $this->assertSame('', (string) $url); - $url = new Uri('0'); - $this->assertSame('0', (string) $url); - $url = new Uri('/'); - $this->assertSame('/', (string) $url); - } - - /** - * @dataProvider getResolveTestCases - */ - public function testResolvesUris($base, $rel, $expected) - { - $uri = new Uri($base); - $actual = Uri::resolve($uri, $rel); - $this->assertEquals($expected, (string) $actual); - } - - public function getResolveTestCases() - { - return [ - //[self::RFC3986_BASE, 'g:h', 'g:h'], - [self::RFC3986_BASE, 'g', 'http://a/b/c/g'], - [self::RFC3986_BASE, './g', 'http://a/b/c/g'], - [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'], - [self::RFC3986_BASE, '/g', 'http://a/g'], - [self::RFC3986_BASE, '//g', 'http://g'], - [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'], - [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'], - [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'], - [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'], - [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'], - [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'], - [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'], - [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'], - [self::RFC3986_BASE, '', self::RFC3986_BASE], - [self::RFC3986_BASE, '.', 'http://a/b/c/'], - [self::RFC3986_BASE, './', 'http://a/b/c/'], - [self::RFC3986_BASE, '..', 'http://a/b/'], - [self::RFC3986_BASE, '../', 'http://a/b/'], - [self::RFC3986_BASE, '../g', 'http://a/b/g'], - [self::RFC3986_BASE, '../..', 'http://a/'], - [self::RFC3986_BASE, '../../', 'http://a/'], - [self::RFC3986_BASE, '../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../../g', 'http://a/g'], - [self::RFC3986_BASE, '/./g', 'http://a/g'], - [self::RFC3986_BASE, '/../g', 'http://a/g'], - [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'], - [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'], - [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'], - [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'], - [self::RFC3986_BASE, './../g', 'http://a/b/g'], - [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'], - [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'], - [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'], - [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'], - [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'], - [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'], - //[self::RFC3986_BASE, 'http:g', 'http:g'], - ]; - } - - public function testAddAndRemoveQueryValues() - { - $uri = new Uri('http://foo.com/bar'); - $uri = Uri::withQueryValue($uri, 'a', 'b'); - $uri = Uri::withQueryValue($uri, 'c', 'd'); - $uri = Uri::withQueryValue($uri, 'e', null); - $this->assertEquals('a=b&c=d&e', $uri->getQuery()); - - $uri = Uri::withoutQueryValue($uri, 'c'); - $uri = Uri::withoutQueryValue($uri, 'e'); - $this->assertEquals('a=b', $uri->getQuery()); - $uri = Uri::withoutQueryValue($uri, 'a'); - $uri = Uri::withoutQueryValue($uri, 'a'); - $this->assertEquals('', $uri->getQuery()); - } - - public function testGetAuthorityReturnsCorrectPort() - { - // HTTPS non-standard port - $uri = new Uri('https://foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // HTTP non-standard port - $uri = new Uri('http://foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // No scheme - $uri = new Uri('foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // No host or port - $uri = new Uri('http:'); - $this->assertEquals('', $uri->getAuthority()); - - // No host or port - $uri = new Uri('http://foo.co'); - $this->assertEquals('foo.co', $uri->getAuthority()); - } - - public function pathTestProvider() - { - return [ - // Percent encode spaces. - ['http://foo.com/baz bar', 'http://foo.com/baz%20bar'], - // Don't encoding something that's already encoded. - ['http://foo.com/baz%20bar', 'http://foo.com/baz%20bar'], - // Percent encode invalid percent encodings - ['http://foo.com/baz%2-bar', 'http://foo.com/baz%252-bar'], - // Don't encode path segments - ['http://foo.com/baz/bar/bam?a', 'http://foo.com/baz/bar/bam?a'], - ['http://foo.com/baz+bar', 'http://foo.com/baz+bar'], - ['http://foo.com/baz:bar', 'http://foo.com/baz:bar'], - ['http://foo.com/baz@bar', 'http://foo.com/baz@bar'], - ['http://foo.com/baz(bar);bam/', 'http://foo.com/baz(bar);bam/'], - ['http://foo.com/a-zA-Z0-9.-_~!$&\'()*+,;=:@', 'http://foo.com/a-zA-Z0-9.-_~!$&\'()*+,;=:@'], - ]; - } - - /** - * @dataProvider pathTestProvider - */ - public function testUriEncodesPathProperly($input, $output) - { - $uri = new Uri($input); - $this->assertEquals((string) $uri, $output); - } - - public function testDoesNotAddPortWhenNoPort() - { - $this->assertEquals('bar', new Uri('//bar')); - $this->assertEquals('bar', (new Uri('//bar'))->getHost()); - } - - public function testAllowsForRelativeUri() - { - $uri = (new Uri)->withPath('foo'); - $this->assertEquals('foo', $uri->getPath()); - $this->assertEquals('foo', (string) $uri); - } - - public function testAddsSlashForRelativeUriStringWithHost() - { - $uri = (new Uri)->withPath('foo')->withHost('bar.com'); - $this->assertEquals('foo', $uri->getPath()); - $this->assertEquals('bar.com/foo', (string) $uri); - } -} diff --git a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/bootstrap.php b/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/bootstrap.php deleted file mode 100644 index 8601dd3302..0000000000 --- a/lib/influxdb-php/vendor/guzzlehttp/psr7/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * @return null - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * @return null - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * @return null - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * @return null - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * @return null - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * @return null - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * @return null - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/lib/influxdb-php/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/lib/influxdb-php/vendor/psr/log/Psr/Log/InvalidArgumentException.php deleted file mode 100644 index 67f852d1db..0000000000 --- a/lib/influxdb-php/vendor/psr/log/Psr/Log/InvalidArgumentException.php +++ /dev/null @@ -1,7 +0,0 @@ -logger = $logger; - } -} diff --git a/lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerInterface.php b/lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerInterface.php deleted file mode 100644 index 476bb962af..0000000000 --- a/lib/influxdb-php/vendor/psr/log/Psr/Log/LoggerInterface.php +++ /dev/null @@ -1,114 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * @return null - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * @return null - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * @return null - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * @return null - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * @return null - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * @return null - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * @return null - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * @return null - */ - abstract public function log($level, $message, array $context = array()); -} diff --git a/lib/influxdb-php/vendor/psr/log/Psr/Log/NullLogger.php b/lib/influxdb-php/vendor/psr/log/Psr/Log/NullLogger.php deleted file mode 100644 index 553a3c593a..0000000000 --- a/lib/influxdb-php/vendor/psr/log/Psr/Log/NullLogger.php +++ /dev/null @@ -1,27 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * @return null - */ - public function log($level, $message, array $context = array()) - { - // noop - } -} diff --git a/lib/influxdb-php/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/lib/influxdb-php/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php deleted file mode 100644 index a932815111..0000000000 --- a/lib/influxdb-php/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +++ /dev/null @@ -1,116 +0,0 @@ - " - * - * Example ->error('Foo') would yield "error Foo" - * - * @return string[] - */ - abstract function getLogs(); - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - } - - public function testContextCanContainAnything() - { - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest), - 'object' => new \DateTime, - 'resource' => fopen('php://memory', 'r'), - ); - - $this->getLogger()->warning('Crazy context data', $context); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $this->getLogger()->warning('Random message', array('exception' => 'oops')); - $this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - } -} - -class DummyTest -{ -} \ No newline at end of file diff --git a/lib/influxdb-php/vendor/psr/log/README.md b/lib/influxdb-php/vendor/psr/log/README.md deleted file mode 100644 index 574bc1cb2a..0000000000 --- a/lib/influxdb-php/vendor/psr/log/README.md +++ /dev/null @@ -1,45 +0,0 @@ -PSR Log -======= - -This repository holds all interfaces/classes/traits related to -[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). - -Note that this is not a logger of its own. It is merely an interface that -describes a logger. See the specification for more details. - -Usage ------ - -If you need a logger, you can use the interface like this: - -```php -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/lib/influxdb-php/vendor/psr/log/composer.json b/lib/influxdb-php/vendor/psr/log/composer.json deleted file mode 100644 index 6bdcc2194b..0000000000 --- a/lib/influxdb-php/vendor/psr/log/composer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/.travis.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/.travis.yml deleted file mode 100644 index 84ceadfa65..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: php -php: - - 5.5 - - 5.4 - - 5.3 - -matrix: - allow_failures: - - php: 5.5 - -before_script: - - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ~/xdebug.ini - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev --no-interaction --prefer-source - -script: - - mkdir -p build/logs - - php vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml --ignore=*.html.php,*.config.php,*.twig.php src - - php vendor/bin/phpmd src xml build/config/phpmd.xml --reportfile build/logs/pmd.xml - - cp ~/xdebug.ini ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - - php vendor/bin/phpunit -c travis.phpunit.xml - - rm ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - -after_script: - - curl -s https://gist.github.com/satooshi/4750401/raw > travis/ColorCLI.php - - curl -s https://gist.github.com/satooshi/4752226/raw > travis/junit.php - - curl -s https://gist.github.com/satooshi/4958593/raw > travis/pmd.php - - curl -s https://gist.github.com/satooshi/4958909/raw > travis/checkstyle.php - - php travis/checkstyle.php - - php travis/pmd.php - - php travis/junit.php - - php composer/bin/coveralls -v --exclude-no-stmt - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/CHANGELOG.md b/lib/influxdb-php/vendor/satooshi/php-coveralls/CHANGELOG.md deleted file mode 100644 index bc9502025d..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -CHANGELOG -============= - -## 0.7.0 (WIP) - -- Support environment prop in json_file (issue #15) -- Support commands: push, open, service, last (issue #16) -- Show helpful message if the requirements are not satisfied (issue #24) - -## 0.6.1 - -- Add CLI option: `--exclude-no-stmt` (issue #23) -- Add .coveralls.yml configuration: `exclude_no_stmt` (issue #23) -- Fix issue #27: Response message is not shown if exception occurred - -## 0.6 - -- Support configuration for multiple clover.xml (issue #11) -- Fix issue #12: end of file should not be included in code coverage -- Show exception log at sending a request instead of exception backtrace -- Log enhancement (issue #14): - - show file size of `json_file` - - show number of included source files - - show elapsed time and memory usage - - show coverage - - show response message -- Relax dependent libs version (issue #18) -- Add connection error handling (issue #21) - -## 0.5 - -- `--verbose (-v)` CLI option enables logging -- Fix: only existing file lines should be included in coverage data -- Support standardized env vars ([Codeship](https://www.codeship.io) supported these env vars) - - CI_NAME - - CI_BUILD_NUMBER - - CI_BUILD_URL - - CI_BRANCH - - CI_PULL_REQUEST -- Refactor console logging (PSR-3 compliant) -- Change composer's minimal stability from dev to stable - -## 0.4 - -- Replace REST client implementation by [guzzle/guzzle](https://github.com/guzzle/guzzle) -- Change: `repo_token` is required on CircleCI, Jenkins - -## 0.3 - -- Better CLI implementation by using [symfony/Console](https://github.com/symfony/Console) component -- Support `--dry-run`, `--config (-c)` CLI option - -## 0.2 - -- Support .coveralls.yml - -## 0.1 - -- First release -- Support Travis CI (tested) -- Implement CircleCI, Jenkins, local environment (but not tested on these CI environments) -- Collect coverage information from clover.xml -- Collect git repository information - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/LICENSE b/lib/influxdb-php/vendor/satooshi/php-coveralls/LICENSE deleted file mode 100644 index c70ef21cfa..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Kitamura Satoshi - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/README.md b/lib/influxdb-php/vendor/satooshi/php-coveralls/README.md deleted file mode 100644 index 78fcb5ace8..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/README.md +++ /dev/null @@ -1,263 +0,0 @@ -php-coveralls -============= - -[![Build Status](https://travis-ci.org/satooshi/php-coveralls.png?branch=master)](https://travis-ci.org/satooshi/php-coveralls) -[![Coverage Status](https://coveralls.io/repos/satooshi/php-coveralls/badge.png?branch=master)](https://coveralls.io/r/satooshi/php-coveralls) -[![Dependencies Status](https://d2xishtp1ojlk0.cloudfront.net/d/9407192)](http://depending.in/satooshi/php-coveralls) - -PHP client library for [Coveralls](https://coveralls.io). - -# API doc - -[API doc](http://satooshi.github.io/php-coveralls/api/) is generated by [ApiGen](http://apigen.org/) - -# Prerequisites - -- PHP 5.3 or later -- On [GitHub](https://github.com/) -- Building on [Travis CI](http://travis-ci.org/), [CircleCI](https://circleci.com/), [Jenkins](http://jenkins-ci.org/) or [Codeship](https://www.codeship.io/) -- Testing by [PHPUnit](https://github.com/sebastianbergmann/phpunit/) or other testing framework that can generate clover style coverage report - -# Installation - -To install php-coveralls with Composer, just add the following to your composer.json file: - -```js -// composer.json -{ - "require-dev": { - "satooshi/php-coveralls": "dev-master" - } -} -``` - -Then, you can install the new dependencies by running Composer’s update command from the directory where your `composer.json` file is located: - -```sh -# install -$ php composer.phar install --dev -# update -$ php composer.phar update satooshi/php-coveralls --dev - -# or you can simply execute composer command if you set it to -# your PATH environment variable -$ composer install --dev -$ composer update satooshi/php-coveralls --dev -``` - -You can see this library on [Packagist](https://packagist.org/packages/satooshi/php-coveralls). - -Composer installs autoloader at `./vendor/autoloader.php`. If you use php-coveralls in your php script, add: - -```php -require_once 'vendor/autoload.php'; -``` - -If you use Symfony2, autoloader has to be detected automatically. - -Or you can use git clone command: - -```sh -# HTTP -$ git clone https://github.com/satooshi/php-coveralls.git -# SSH -$ git clone git@github.com:satooshi/php-coveralls.git -``` - -# Configuration - -Currently support clover style coverage report. php-coveralls collect coverage information from `clover.xml`. - -## PHPUnit - -Make sure that `phpunit.xml.dist` is configured to generate "coverage-clover" type log named `clover.xml` like the following configuration: - -```xml - - - - ... - - ... - - -``` - -### clover.xml - -php-coveralls collects `count` attribute in a `line` tag from `clover.xml` if its `type` attribute equals to `stmt`. When `type` attribute equals to `method`, php-coveralls excludes its `count` attribute from coverage collection because abstract method in an abstract class is never counted though subclasses implement that method which is executed in test cases. - -```xml - - - - -``` - -## Travis CI - -Add `php vendor/bin/coveralls` to your `.travis.yml` at `after_script`. - -*Please note that `--dev` must be set to `composer install` option.* - -```yml -# .travis.yml -language: php -php: - - 5.5 - - 5.4 - - 5.3 - -matrix: - allow_failures: - - php: 5.5 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev --no-interaction - -script: - - mkdir -p build/logs - - php vendor/bin/phpunit -c phpunit.xml.dist - -after_script: - - php vendor/bin/coveralls - # or enable logging - - php vendor/bin/coveralls -v -``` - -## CircleCI - -Add `pecl install xdebug` to your `circle.yml` at `dependencies` section since currently Xdebug extension is not pre-installed. `composer` and `phpunit` are pre-installed but you can install them manually in this dependencies section. The following sample uses default ones. - -```yml -machine: - php: - version: 5.4.10 - -## Customize dependencies -dependencies: - override: - - mkdir -p build/logs - - composer install --dev --no-interaction - - pecl install xdebug - - cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini | sed -e "s/;//" > xdebug.ini - - mv xdebug.ini ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - -## Customize test commands -test: - override: - - phpunit -c phpunit.xml.dist -``` - -Add `php vendor/bin/coveralls` to the "Test commands" textarea on Web UI (Edit settings > Tests > Test commands textarea). - -```sh -COVERALLS_REPO_TOKEN=your_token php vendor/bin/coveralls -``` - -*Please note that `COVERALLS_REPO_TOKEN` should be set in the same line before coveralls command execution. You can not export this variable before coveralls command execution in other command since each command runs in its own shell and does not share environment variables ([see reference on CircleCI](https://circleci.com/docs/environment-variables)).* - -## Codeship - -You can configure CI process for Coveralls by adding the following commands to the textarea on Web UI (Project settings > Test tab). - -In the "Modify your Setup Commands" section: - -```sh -curl -s http://getcomposer.org/installer | php -php composer.phar install --dev --no-interaction -mkdir -p build/logs -``` - -In the "Modify your Test Commands" section: - -```sh -php vendor/bin/phpunit -c phpunit.xml.dist -php vendor/bin/coveralls -``` - -Next, open Project settings > Environment tab, you can set `COVERALLS_REPO_TOKEN` environment variable. - -In the "Configure your environment variables" section: - -```sh -COVERALLS_REPO_TOKEN=your_token -``` - -## From local environment - -If you would like to call Coveralls API from your local environment, you can set `COVERALLS_RUN_LOCALLY` envrionment variable. This configuration requires `repo_token` to specify which project on Coveralls your project maps to. This can be done by configuring `.coveralls.yml` or `COVERALLS_REPO_TOKEN` environment variable. - -```sh -$ export COVERALLS_RUN_LOCALLY=1 - -# either env var -$ export COVERALLS_REPO_TOKEN=your_token - -# or .coveralls.yml configuration -$ vi .coveralls.yml -repo_token: your_token # should be kept secret! -``` - -php-coveralls set the following properties to `json_file` which is sent to Coveralls API (same behaviour as the Ruby library will do except for the service name). - -- service_name: php-coveralls -- service_event_type: manual - -## CLI options - -You can get help information for `coveralls` with the `--help (-h)` option. - -```sh -php vendor/bin/coveralls --help -``` - -## .coveralls.yml - -php-coveralls can use optional `.coveralls.yml` file to configure options. This configuration file is usually at the root level of your repository, but you can specify other path by `--config (or -c)` CLI option. Following options are the same as Ruby library ([see reference on coveralls.io](https://coveralls.io/docs/ruby)). - -- `repo_token`: Used to specify which project on Coveralls your project maps to. This is only needed for repos not using CI and should be kept secret -- `service_name`: Allows you to specify where Coveralls should look to find additional information about your builds. This can be any string, but using `travis-ci` or `travis-pro` will allow Coveralls to fetch branch data, comment on pull requests, and more. - -Following options can be used for php-coveralls. - -- `src_dir`: Used to specify where the root level of your source files directory is. Default is `src`. -- `coverage_clover`: Used to specify the path to `clover.xml`. Default is `build/logs/clover.xml` -- `json_path`: Used to specify where to output `json_file` that will be uploaded to Coveralls API. Default is `build/logs/coveralls-upload.json`. - -```yml -# .coveralls.yml example configuration - -# same as Ruby lib -repo_token: your_token # should be kept secret! -service_name: travis-pro # travis-ci or travis-pro - -# for php-coveralls -src_dir: src -coverage_clover: build/logs/clover.xml -json_path: build/logs/coveralls-upload.json -``` - -You can specify multiple `clover.xml` logs at `coverage_clover`. This is useful for a project that has more than two test suites if all of the test results should be merged into one `json_file`. - -```yml -#.coveralls.yml - -# single file -coverage_clover: build/logs/clover.xml - -# glob -coverage_clover: build/logs/clover-*.xml - -# array -# specify files -coverage_clover: - - build/logs/clover-Auth.xml - - build/logs/clover-Db.xml - - build/logs/clover-Validator.xml -``` - -# Changelog - -[See changelog](CHANGELOG.md) diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/build.xml b/lib/influxdb-php/vendor/satooshi/php-coveralls/build.xml deleted file mode 100644 index 35c877e8b1..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/build.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/apigen.neon b/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/apigen.neon deleted file mode 100644 index c067c2c290..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/apigen.neon +++ /dev/null @@ -1,5 +0,0 @@ -main: Contrib -title: php-coveralls -internal: yes -todo: yes -wipeout: yes diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpcs.xml b/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpcs.xml deleted file mode 100644 index 82a58e1b32..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpcs.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - The coding standard for standard PHP application - */img/* - */images/* - */less/* - */css/* - */js/* - *.html - *.twig - *.yml - *.xml - *.txt - *.less - *.css - *.js - *.jpg - *.jpeg - *.png - *.gif - - - - - - - - - - - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpmd.xml b/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpmd.xml deleted file mode 100644 index 27d3193e74..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/build/config/phpmd.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - My custom rule set that checks my code... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/composer.json b/lib/influxdb-php/vendor/satooshi/php-coveralls/composer.json deleted file mode 100644 index 414a2f488d..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "satooshi/php-coveralls", - "description": "PHP client library for Coveralls API", - "keywords": ["coverage", "github", "test", "ci"], - "homepage": "https://github.com/satooshi/php-coveralls", - "type": "library", - "license": "MIT", - "minimum-stability": "stable", - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "require": { - "php": ">=5.3", - "ext-json": "*", - "ext-curl": "*", - "ext-simplexml": "*", - "symfony/yaml": ">=2.0", - "symfony/console": ">=2.0", - "symfony/config": ">=2.0", - "symfony/stopwatch": ">=2.2", - "guzzle/guzzle": ">=3.0", - "psr/log": "1.0.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*@stable", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "sebastian/finder-facade": "dev-master", - "theseer/fdomdocument": "dev-master", - "squizlabs/php_codesniffer": "1.4.*@stable", - "apigen/apigen": "2.8.*@stable" - }, - "autoload": { - "psr-0": { "Contrib\\Component": "src/", "Contrib\\Bundle": "src/" } - }, - "bin": ["composer/bin/coveralls"] -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/composer/bin/coveralls b/lib/influxdb-php/vendor/satooshi/php-coveralls/composer/bin/coveralls deleted file mode 100755 index f0bed25533..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/composer/bin/coveralls +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env php -run(); diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/phpunit.xml.dist b/lib/influxdb-php/vendor/satooshi/php-coveralls/phpunit.xml.dist deleted file mode 100644 index c4cc224b03..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/phpunit.xml.dist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - ./tests/ - - - - - - ./src - - ./vendor - ./tests - ./travis - ./composer - - - - - - - - - - - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php deleted file mode 100644 index 908fab6113..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ -class Application extends BaseApplication -{ - /** - * Path to project root directory. - * - * @var string - */ - private $rootDir; - - /** - * Constructor. - * - * @param string $rootDir Path to project root directory. - * @param string $name The name of the application - * @param string $version The version of the application - */ - public function __construct($rootDir, $name = 'UNKNOWN', $version = 'UNKNOWN') - { - $this->rootDir = $rootDir; - - parent::__construct($name, $version); - } - - // internal method - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Console\Application::getCommandName() - */ - protected function getCommandName(InputInterface $input) - { - return 'coveralls:v1:jobs'; - } - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Console\Application::getDefaultCommands() - */ - protected function getDefaultCommands() - { - // Keep the core default commands to have the HelpCommand - // which is used when using the --help option - $defaultCommands = parent::getDefaultCommands(); - - $defaultCommands[] = $this->createCoverallsV1JobsCommand(); - - return $defaultCommands; - } - - /** - * Create CoverallsV1JobsCommand. - * - * @return \Contrib\Bundle\CoverallsBundle\Console\CoverallsV1JobsCommand - */ - protected function createCoverallsV1JobsCommand() - { - $command = new CoverallsV1JobsCommand(); - $command->setRootDir($this->rootDir); - - return $command; - } - - // accessor - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Console\Application::getDefinition() - */ - public function getDefinition() - { - $inputDefinition = parent::getDefinition(); - // clear out the normal first argument, which is the command name - $inputDefinition->setArguments(); - - return $inputDefinition; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php deleted file mode 100644 index 8bc7aedfc4..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ -interface ArrayConvertable -{ - /** - * Convert to an array. - * - * @return array - */ - public function toArray(); -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php deleted file mode 100644 index 1a6641d04c..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -abstract class CoverallsApi -{ - /** - * Configuration. - * - * @var Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - protected $config; - - /** - * HTTP client. - * - * @var \Guzzle\Http\Client - */ - protected $client; - - /** - * Constructor. - * - * @param Configuration $config Configuration. - * @param \Guzzle\Http\Client $client HTTP client. - */ - public function __construct(Configuration $config, Client $client = null) - { - $this->config = $config; - $this->client = $client; - } - - // accessor - - /** - * Return configuration. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function getConfiguration() - { - return $this->config; - } - - /** - * Set HTTP client. - * - * @param \Guzzle\Http\Client $client HTTP client. - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\CoverallsApi - */ - public function setHttpClient(Client $client) - { - $this->client = $client; - - return $this; - } - - /** - * Return HTTP client. - * - * @return \Guzzle\Http\Client - */ - public function getHttpClient() - { - return $this->client; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php deleted file mode 100644 index 7270d80039..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php +++ /dev/null @@ -1,175 +0,0 @@ - - */ -class Jobs extends CoverallsApi -{ - /** - * URL for jobs API. - * - * @var string - */ - const URL = 'https://coveralls.io/api/v1/jobs'; - - /** - * Filename as a POST parameter. - * - * @var string - */ - const FILENAME = 'json_file'; - - /** - * JsonFile. - * - * @var Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - */ - protected $jsonFile; - - // API - - /** - * Collect clover XML into json_file. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - public function collectCloverXml() - { - $srcDir = $this->config->getSrcDir(); - $cloverXmlPaths = $this->config->getCloverXmlPaths(); - $xmlCollector = new CloverXmlCoverageCollector(); - - foreach ($cloverXmlPaths as $cloverXmlPath) { - $xml = simplexml_load_file($cloverXmlPath); - - $xmlCollector->collect($xml, $srcDir); - } - - $this->jsonFile = $xmlCollector->getJsonFile(); - - if ($this->config->isExcludeNoStatements()) { - $this->jsonFile->excludeNoStatementsFiles(); - } - - $this->jsonFile->sortSourceFiles(); - - return $this; - } - - /** - * Collect git repository info into json_file. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - public function collectGitInfo() - { - $command = new GitCommand(); - $gitCollector = new GitInfoCollector($command); - - $this->jsonFile->setGit($gitCollector->collect()); - - return $this; - } - - /** - * Collect environment variables. - * - * @param array $env $_SERVER environment. - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - public function collectEnvVars(array $env) - { - $envCollector = new CiEnvVarsCollector($this->config); - - $this->jsonFile->fillJobs($envCollector->collect($env)); - - return $this; - } - - /** - * Dump uploading json file. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - public function dumpJsonFile() - { - $jsonPath = $this->config->getJsonPath(); - - file_put_contents($jsonPath, $this->jsonFile); - - return $this; - } - - /** - * Send json_file to jobs API. - * - * @return \Guzzle\Http\Message\Response|null - * @throws \RuntimeException - */ - public function send() - { - if ($this->config->isDryRun()) { - return; - } - - $jsonPath = $this->config->getJsonPath(); - - return $this->upload(static::URL, $jsonPath, static::FILENAME); - } - - // internal method - - /** - * Upload a file. - * - * @param string $url URL to upload. - * @param string $path File path. - * @param string $filename Filename. - * @return \Guzzle\Http\Message\Response Response. - * @throws \RuntimeException - */ - protected function upload($url, $path, $filename) - { - $request = $this->client->post($url)->addPostFiles(array($filename => $path)); - - return $request->send(); - } - - // accessor - - /** - * Set JsonFile. - * - * @param JsonFile $jsonFile json_file content. - * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - public function setJsonFile(JsonFile $jsonFile) - { - $this->jsonFile = $jsonFile; - - return $this; - } - - /** - * Return JsonFile. - * - * @return JsonFile - */ - public function getJsonFile() - { - if (isset($this->jsonFile)) { - return $this->jsonFile; - } - - return null; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php deleted file mode 100644 index e7706c9701..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php +++ /dev/null @@ -1,152 +0,0 @@ - - */ -class CiEnvVarsCollector -{ - /** - * Configuration. - * - * @var Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - protected $config; - - /** - * Environment variables. - * - * Overwritten through collection process. - * - * @var array - */ - protected $env; - - /** - * Constructor. - * - * @param Configuration $config Configuration. - */ - public function __construct(Configuration $config) - { - $this->config = $config; - } - - // API - - /** - * Collect environment variables. - * - * @param array $env $_SERVER environment. - * @return array - */ - public function collect(array $env) - { - $this->env = $env; - - $this->fillTravisCi() - ->fillCircleCi() - ->fillJenkins() - ->fillLocal() - ->fillRepoToken(); - - return $this->env; - } - - // internal method - - /** - * Fill Travis CI environment variables. - * - * "TRAVIS", "TRAVIS_JOB_ID" must be set. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector - */ - protected function fillTravisCi() - { - if (isset($this->env['TRAVIS']) && $this->env['TRAVIS'] && isset($this->env['TRAVIS_JOB_ID'])) { - $this->env['CI_JOB_ID'] = $this->env['TRAVIS_JOB_ID']; - - if ($this->config->hasServiceName()) { - $this->env['CI_NAME'] = $this->config->getServiceName(); - } else { - $this->env['CI_NAME'] = 'travis-ci'; - } - } - - return $this; - } - - /** - * Fill CircleCI environment variables. - * - * "CIRCLECI", "CIRCLE_BUILD_NUM" must be set. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector - */ - protected function fillCircleCi() - { - if (isset($this->env['CIRCLECI']) && $this->env['CIRCLECI'] && isset($this->env['CIRCLE_BUILD_NUM'])) { - $this->env['CI_BUILD_NUMBER'] = $this->env['CIRCLE_BUILD_NUM']; - $this->env['CI_NAME'] = 'circleci'; - } - - return $this; - } - - /** - * Fill Jenkins environment variables. - * - * "JENKINS_URL", "BUILD_NUMBER" must be set. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector - */ - protected function fillJenkins() - { - if (isset($this->env['JENKINS_URL']) && isset($this->env['BUILD_NUMBER'])) { - $this->env['CI_BUILD_NUMBER'] = $this->env['BUILD_NUMBER']; - $this->env['CI_BUILD_URL'] = $this->env['JENKINS_URL']; - $this->env['CI_NAME'] = 'jenkins'; - } - - return $this; - } - - /** - * Fill local environment variables. - * - * "COVERALLS_RUN_LOCALLY" must be set. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector - */ - protected function fillLocal() - { - if (isset($this->env['COVERALLS_RUN_LOCALLY']) && $this->env['COVERALLS_RUN_LOCALLY']) { - $this->env['CI_JOB_ID'] = null; - $this->env['CI_NAME'] = 'php-coveralls'; - $this->env['COVERALLS_EVENT_TYPE'] = 'manual'; - } - - return $this; - } - - /** - * Fill repo_token for unsupported CI service. - * - * "COVERALLS_REPO_TOKEN" must be set. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector - */ - protected function fillRepoToken() - { - if ($this->config->hasRepoToken()) { - $this->env['COVERALLS_REPO_TOKEN'] = $this->config->getRepoToken(); - } - - return $this; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php deleted file mode 100644 index 31eaf16910..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php +++ /dev/null @@ -1,137 +0,0 @@ - - */ -class CloverXmlCoverageCollector -{ - /** - * JsonFile. - * - * @var \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - */ - protected $jsonFile; - - // API - - /** - * Collect coverage from XML object. - * - * @param SimpleXMLElement $xml Clover XML object. - * @param string $rootDir Path to src directory. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - */ - public function collect(\SimpleXMLElement $xml, $rootDir) - { - $root = $rootDir . DIRECTORY_SEPARATOR; - - if (!isset($this->jsonFile)) { - $this->jsonFile = new JsonFile(); - } - - // overwrite if run_at has already been set - $runAt = $this->collectRunAt($xml); - $this->jsonFile->setRunAt($runAt); - - $xpaths = array( - '/coverage/project/file', - '/coverage/project/package/file', - ); - - foreach ($xpaths as $xpath) { - foreach ($xml->xpath($xpath) as $file) { - $srcFile = $this->collectFileCoverage($file, $root); - - if ($srcFile !== null) { - $this->jsonFile->addSourceFile($srcFile); - } - } - } - - return $this->jsonFile; - } - - // Internal method - - /** - * Collect timestamp when the job ran. - * - * @param SimpleXMLElement $xml Clover XML object of a file. - * @param string $format DateTime format. - * @return string - */ - protected function collectRunAt(\SimpleXMLElement $xml, $format = 'Y-m-d H:i:s O') - { - $timestamp = $xml->project['timestamp']; - $runAt = new \DateTime('@' . $timestamp); - - return $runAt->format($format); - } - - /** - * Collect coverage data of a file. - * - * @param SimpleXMLElement $file Clover XML object of a file. - * @param string $root Path to src directory. - * @return NULL|\Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile - */ - protected function collectFileCoverage(\SimpleXMLElement $file, $root) - { - $absolutePath = (string) $file['name']; - - if (false === strpos($absolutePath, $root)) { - return null; - } - - $filename = str_replace($root, '', $absolutePath); - - return $this->collectCoverage($file, $absolutePath, $filename); - } - - /** - * Collect coverage data. - * - * @param SimpleXMLElement $file Clover XML object of a file. - * @param string $path Path to source file. - * @param string $filename Filename. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile - */ - protected function collectCoverage(\SimpleXMLElement $file, $path, $filename) - { - if ($this->jsonFile->hasSourceFile($path)) { - $srcFile = $this->jsonFile->getSourceFile($path); - } else { - $srcFile = new SourceFile($path, $filename); - } - - foreach ($file->line as $line) { - if ((string) $line['type'] === 'stmt') { - $lineNum = (int) $line['num']; - - if ($lineNum > 0) { - $srcFile->addCoverage($lineNum - 1, (int) $line['count']); - } - } - } - - return $srcFile; - } - - // accessor - - /** - * Return json file. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - */ - public function getJsonFile() - { - return $this->jsonFile; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php deleted file mode 100644 index c150661810..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php +++ /dev/null @@ -1,151 +0,0 @@ - - */ -class GitInfoCollector -{ - /** - * Git command. - * - * @var GitCommand - */ - protected $command; - - /** - * Constructor. - * - * @param GitCommand $gitCommand Git command - */ - public function __construct(GitCommand $command) - { - $this->command = $command; - } - - // API - - /** - * Collect git repository info. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Git - */ - public function collect() - { - $branch = $this->collectBranch(); - $commit = $this->collectCommit(); - $remotes = $this->collectRemotes(); - - return new Git($branch, $commit, $remotes); - } - - // internal method - - /** - * Collect branch name. - * - * @return string - * @throws \RuntimeException - */ - protected function collectBranch() - { - $branchesResult = $this->command->getBranches(); - - foreach ($branchesResult as $result) { - if (strpos($result, '* ') === 0) { - $exploded = explode('* ', $result, 2); - - return $exploded[1]; - } - } - - throw new \RuntimeException(); - } - - /** - * Collect commit info. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - * @throws \RuntimeException - */ - protected function collectCommit() - { - $commitResult = $this->command->getHeadCommit(); - - if (count($commitResult) !== 6 || array_keys($commitResult) !== range(0, 5)) { - throw new \RuntimeException(); - } - - $commit = new Commit(); - - return $commit - ->setId($commitResult[0]) - ->setAuthorName($commitResult[1]) - ->setAuthorEmail($commitResult[2]) - ->setCommitterName($commitResult[3]) - ->setCommitterEmail($commitResult[4]) - ->setMessage($commitResult[5]); - } - - /** - * Collect remotes info. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote[] - * @throws \RuntimeException - */ - protected function collectRemotes() - { - $remotesResult = $this->command->getRemotes(); - - if (count($remotesResult) === 0) { - throw new \RuntimeException(); - } - - // parse command result - $results = array(); - - foreach ($remotesResult as $result) { - if (strpos($result, ' ') !== false) { - list($remote) = explode(' ', $result, 2); - - $results[] = $remote; - } - } - - // filter - $results = array_unique($results); - - // create Remote instances - $remotes = array(); - - foreach ($results as $result) { - if (strpos($result, "\t") !== false) { - list($name, $url) = explode("\t", $result, 2); - - $remote = new Remote(); - $remotes[] = $remote->setName($name)->setUrl($url); - } - } - - return $remotes; - } - - // accessor - - /** - * Return git command. - * - * @return \Contrib\Component\System\Git\GitCommand - */ - public function getCommand() - { - return $this->command; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php deleted file mode 100644 index f388569b46..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php +++ /dev/null @@ -1,359 +0,0 @@ - - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CoverallsV1JobsCommand extends Command -{ - /** - * Path to project root directory. - * - * @var string - */ - protected $rootDir; - - /** - * Coveralls Jobs API. - * - * @var \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs - */ - protected $api; - - /** - * Logger. - * - * @var \Psr\Log\LoggerInterface - */ - protected $logger; - - // internal method - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Console\Command\Command::configure() - */ - protected function configure() - { - $this - ->setName('coveralls:v1:jobs') - ->setDescription('Coveralls Jobs API v1') - ->addOption( - 'config', - '-c', - InputOption::VALUE_OPTIONAL, - '.coveralls.yml path', - '.coveralls.yml' - ) - ->addOption( - 'dry-run', - null, - InputOption::VALUE_NONE, - 'Do not send json_file to Jobs API' - ) - ->addOption( - 'exclude-no-stmt', - null, - InputOption::VALUE_NONE, - 'Exclude source files that have no executable statements' - ) - ->addOption( - 'env', - '-e', - InputOption::VALUE_OPTIONAL, - 'Runtime environment name: test, dev, prod', - 'prod' - ); - } - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Console\Command\Command::execute() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $stopwatch = new Stopwatch(); - $stopwatch->start(__CLASS__); - - $config = $this->loadConfiguration($input, $this->rootDir); - $this->logger = $config->isVerbose() && !$config->isTestEnv() ? new ConsoleLogger($output) : new NullLogger(); - - $this->runApi($config); - - $event = $stopwatch->stop(__CLASS__); - $time = number_format($event->getDuration() / 1000, 3); // sec - $mem = number_format($event->getMemory() / (1024 * 1024), 2); // MB - $this->logger->info(sprintf('elapsed time: %s sec memory: %s MB', $time, $mem)); - - return 0; - } - - // for Jobs API - - /** - * Load configuration. - * - * @param InputInterface $input Input arguments. - * @param string $rootDir Path to project root directory. - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - protected function loadConfiguration(InputInterface $input, $rootDir) - { - $coverallsYmlPath = $input->getOption('config'); - - $ymlPath = $this->rootDir . DIRECTORY_SEPARATOR . $coverallsYmlPath; - $configurator = new Configurator(); - - return $configurator - ->load($ymlPath, $rootDir) - ->setDryRun($input->getOption('dry-run')) - ->setExcludeNoStatementsUnlessFalse($input->getOption('exclude-no-stmt')) - ->setVerbose($input->getOption('verbose')) - ->setEnv($input->getOption('env')); - } - - /** - * Run Jobs API. - * - * @param Configuration $config Configuration. - * @return void - */ - protected function runApi(Configuration $config) - { - $client = new Client(); - $this->api = new Jobs($config, $client); - - $this - ->collectCloverXml($config) - ->collectGitInfo() - ->collectEnvVars() - ->dumpJsonFile($config) - ->send(); - } - - /** - * Collect clover XML into json_file. - * - * @param Configuration $config Configuration. - * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand - */ - protected function collectCloverXml(Configuration $config) - { - $this->logger->info('Load coverage clover log:'); - - foreach ($config->getCloverXmlPaths() as $path) { - $this->logger->info(sprintf(' - %s', $path)); - } - - $this->api->collectCloverXml(); - - $jsonFile = $this->api->getJsonFile(); - - if ($jsonFile->hasSourceFiles()) { - $this->logCollectedSourceFiles($jsonFile); - } - - return $this; - } - - /** - * Log collected source files. - * - * @param JsonFile $jsonFile - * @return void - */ - protected function logCollectedSourceFiles(JsonFile $jsonFile) - { - // @codeCoverageIgnoreStart - $color = function ($coverage, $format) { - // green 90% - 100% - // yellow 80% - 90% - // red 0% - 80% - if ($coverage >= 90) { - return sprintf('%s', $format); - } elseif ($coverage >= 80) { - return sprintf('%s', $format); - } else { - return sprintf('%s', $format); - } - }; - // @codeCoverageIgnoreEnd - - $sourceFiles = $jsonFile->getSourceFiles(); - $numFiles = count($sourceFiles); - - $this->logger->info(sprintf('Found %s source file%s:', number_format($numFiles), $numFiles > 1 ? 's' : '')); - - foreach ($sourceFiles as $sourceFile) { - /* @var $sourceFile \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile */ - $coverage = $sourceFile->reportLineCoverage(); - $template = ' - ' . $color($coverage, '%6.2f%%') . ' %s'; - - $this->logger->info(sprintf($template, $coverage, $sourceFile->getName())); - } - - $coverage = $jsonFile->reportLineCoverage(); - $template = 'Coverage: ' . $color($coverage, '%6.2f%% (%d/%d)'); - $metrics = $jsonFile->getMetrics(); - - $this->logger->info(sprintf($template, $coverage, $metrics->getCoveredStatements(), $metrics->getStatements())); - } - - /** - * Collect git repository info into json_file. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand - */ - protected function collectGitInfo() - { - $this->logger->info('Collect git info'); - - $this->api->collectGitInfo(); - - return $this; - } - - /** - * Collect environment variables. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand - */ - protected function collectEnvVars() - { - $this->logger->info('Read environment variables'); - - $this->api->collectEnvVars($_SERVER); - - return $this; - } - - /** - * Dump uploading json file. - * - * @param Configuration $config Configuration. - * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand - */ - protected function dumpJsonFile(Configuration $config) - { - $jsonPath = $config->getJsonPath(); - $this->logger->info(sprintf('Dump uploading json file: %s', $jsonPath)); - - $this->api->dumpJsonFile(); - - $filesize = number_format(filesize($jsonPath) / 1024, 2); // kB - $this->logger->info(sprintf('File size: %s kB', $filesize)); - - return $this; - } - - /** - * Send json_file to jobs API. - * - * @return void - */ - protected function send() - { - $this->logger->info(sprintf('Submitting to %s', Jobs::URL)); - - try { - $response = $this->api->send(); - - $message = $response - ? sprintf('Finish submitting. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase()) - : 'Finish dry run'; - - $this->logger->info($message); - - // @codeCoverageIgnoreStart - if ($response instanceof Response) { - $this->logResponse($response); - } - - return; - } catch (CurlException $e) { - // connection error - // tested with network disconnected and got message: - // Connection error occurred. - // [curl] 6: Could not resolve host: - // (nil); nodename nor servname provided, or not known [url] https://coveralls.io/api/v1/jobs - $message = sprintf("Connection error occurred. %s\n\n%s", $e->getMessage(), $e->getTraceAsString()); - } catch (ClientErrorResponseException $e) { - // 422 Unprocessable Entity - $response = $e->getResponse(); - $message = sprintf('Client error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase()); - } catch (ServerErrorResponseException $e) { - // 503 Service Unavailable - $response = $e->getResponse(); - $message = sprintf('Server error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase()); - } catch (\Exception $e) { - $message = sprintf("%s\n\n%s", $e->getMessage(), $e->getTraceAsString()); - } - - $this->logger->error($message); - - if (isset($response)) { - $this->logResponse($response); - } - } // @codeCoverageIgnoreEnd - - /** - * Log response. - * - * @param Response $response API response. - * @return void - * - * @codeCoverageIgnore - */ - protected function logResponse(Response $response) - { - $body = $response->json(); - - if (isset($body['error'])) { - if (isset($body['message'])) { - $this->logger->error($body['message']); - } - } else { - if (isset($body['message'])) { - $this->logger->info(sprintf('Accepted %s', $body['message'])); - } - - if (isset($body['url'])) { - $this->logger->info(sprintf('You can see the build on %s', $body['url'])); - } - } - } - - // accessor - - /** - * Set root directory. - * - * @param string $rootDir Path to project root directory. - */ - public function setRootDir($rootDir) - { - $this->rootDir = $rootDir; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php deleted file mode 100644 index a4ae19012c..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php +++ /dev/null @@ -1,366 +0,0 @@ - - */ -class Configuration -{ - // same as ruby lib - - /** - * repo_token. - * - * @var string - */ - protected $repoToken; - - /** - * service_name. - * - * @var string - */ - protected $serviceName; - - // only for php lib - - /** - * Absolute path to src directory to include coverage report. - * - * @var string - */ - protected $srcDir; - - /** - * Absolute paths to clover.xml. - * - * @var array - */ - protected $cloverXmlPaths = array(); - - /** - * Absolute path to output json_file. - * - * @var string - */ - protected $jsonPath; - - // from command option - - /** - * Whether to send json_file to jobs API. - * - * @var boolean - */ - protected $dryRun = true; - - /** - * Whether to exclude source files that have no executable statements. - * - * @var boolean - */ - protected $excludeNoStatements = false; - - /** - * Whether to show log. - * - * @var boolean - */ - protected $verbose = false; - - /** - * Runtime environment name. - * - * @var string - */ - protected $env = 'prod'; - - // accessor - - /** - * Set repository token. - * - * @param string $repoToken - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setRepoToken($repoToken) - { - $this->repoToken = $repoToken; - - return $this; - } - - /** - * Return whether repository token is configured. - * - * @return boolean - */ - public function hasRepoToken() - { - return isset($this->repoToken); - } - - /** - * Return repository token. - * - * @return string|NULL - */ - public function getRepoToken() - { - return $this->repoToken; - } - - /** - * Set service name. - * - * @param string $serviceName - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setServiceName($serviceName) - { - $this->serviceName = $serviceName; - - return $this; - } - - /** - * Return whether the service name is configured. - * - * @return boolean - */ - public function hasServiceName() - { - return isset($this->serviceName); - } - - /** - * Return service name. - * - * @return string|NULL - */ - public function getServiceName() - { - return $this->serviceName; - } - - /** - * Set absolute path to src directory to include coverage report. - * - * @param string $srcDir - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setSrcDir($srcDir) - { - $this->srcDir = $srcDir; - - return $this; - } - - /** - * Return absolute path to src directory to include coverage report. - * - * @return string - */ - public function getSrcDir() - { - return $this->srcDir; - } - - /** - * Set absolute paths to clover.xml. - * - * @param string $cloverXmlPaths - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setCloverXmlPaths(array $cloverXmlPaths) - { - $this->cloverXmlPaths = $cloverXmlPaths; - - return $this; - } - - /** - * Add absolute path to clover.xml. - * - * @param string $cloverXmlPath - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function addCloverXmlPath($cloverXmlPath) - { - $this->cloverXmlPaths[] = $cloverXmlPath; - - return $this; - } - - /** - * Return absolute path to clover.xml. - * - * @return string - */ - public function getCloverXmlPaths() - { - return $this->cloverXmlPaths; - } - - /** - * Set absolute path to output json_file. - * - * @param string $jsonPath - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setJsonPath($jsonPath) - { - $this->jsonPath = $jsonPath; - - return $this; - } - - /** - * Return absolute path to output json_file. - * - * @return string - */ - public function getJsonPath() - { - return $this->jsonPath; - } - - /** - * Set whether to send json_file to jobs API. - * - * @param boolean $dryRun - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setDryRun($dryRun) - { - $this->dryRun = $dryRun; - - return $this; - } - - /** - * Return whether to send json_file to jobs API. - * - * @return boolean - */ - public function isDryRun() - { - return $this->dryRun; - } - - /** - * Set whether to exclude source files that have no executable statements. - * - * @param boolean $excludeNoStatements - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setExcludeNoStatements($excludeNoStatements) - { - $this->excludeNoStatements = $excludeNoStatements; - - return $this; - } - - /** - * Set whether to exclude source files that have no executable statements unless false. - * - * @param boolean $excludeNoStatements - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setExcludeNoStatementsUnlessFalse($excludeNoStatements) - { - if ($excludeNoStatements) { - $this->excludeNoStatements = true; - } - - return $this; - } - - /** - * Return whether to exclude source files that have no executable statements. - * - * @return boolean - */ - public function isExcludeNoStatements() - { - return $this->excludeNoStatements; - } - - /** - * Set whether to show log. - * - * @param boolean $verbose - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setVerbose($verbose) - { - $this->verbose = $verbose; - - return $this; - } - - /** - * Return whether to show log. - * - * @return boolean - */ - public function isVerbose() - { - return $this->verbose; - } - - /** - * Set runtime environment name. - * - * @param string $env Runtime environment name. - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function setEnv($env) - { - $this->env = $env; - - return $this; - } - - /** - * Return runtime environment name. - * - * @return string - */ - public function getEnv() - { - return $this->env; - } - - /** - * Return whether the runtime environment is test. - * - * @return boolean - */ - public function isTestEnv() - { - return $this->env === 'test'; - } - - /** - * Return whether the runtime environment is dev. - * - * @return boolean - */ - public function isDevEnv() - { - return $this->env === 'dev'; - } - - /** - * Return whether the runtime environment is prod. - * - * @return boolean - */ - public function isProdEnv() - { - return $this->env === 'prod'; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php deleted file mode 100644 index 760fec5711..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php +++ /dev/null @@ -1,229 +0,0 @@ - - */ -class Configurator -{ - // API - - /** - * Load configuration. - * - * @param string $coverallsYmlPath Path to .coveralls.yml. - * @param string $rootDir Path to project root directory. - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - public function load($coverallsYmlPath, $rootDir) - { - $yml = $this->parse($coverallsYmlPath); - $options = $this->process($yml); - - return $this->createConfiguration($options, $rootDir); - } - - // Internal method - - /** - * Parse .coveralls.yml. - * - * @param string $coverallsYmlPath Path to .coveralls.yml. - * @return array - */ - protected function parse($coverallsYmlPath) - { - $file = new Path(); - $path = realpath($coverallsYmlPath); - - if ($file->isRealFileReadable($path)) { - $yml = Yaml::parse($path); - - return empty($yml) ? array() : $yml; - } - - return array(); - } - - /** - * Process parsed configuration according to the configuration definition. - * - * @param array $yml Parsed configuration. - * @return array - */ - protected function process(array $yml) - { - $processor = new Processor(); - $configuration = new CoverallsConfiguration(); - - return $processor->processConfiguration($configuration, array('coveralls' => $yml)); - } - - /** - * Create coveralls configuration. - * - * @param array $options Processed configuration. - * @param string $rootDir Path to project root directory. - * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration - */ - protected function createConfiguration(array $options, $rootDir) - { - $configuration = new Configuration(); - $file = new Path(); - - $repoToken = $options['repo_token']; - $repoSecretToken = $options['repo_secret_token']; - - return $configuration - ->setRepoToken($repoToken !== null ? $repoToken : $repoSecretToken) - ->setServiceName($options['service_name']) - // for PHP lib - ->setSrcDir($this->ensureSrcDir($options['src_dir'], $rootDir, $file)) - ->setCloverXmlPaths($this->ensureCloverXmlPaths($options['coverage_clover'], $rootDir, $file)) - ->setJsonPath($this->ensureJsonPath($options['json_path'], $rootDir, $file)) - ->setExcludeNoStatements($options['exclude_no_stmt']); - } - - /** - * Ensure src_dir is valid. - * - * @param string $option src_dir option. - * @param string $rootDir Path to project root directory. - * @param Path $file Path object. - * @return string Valid src_dir. - * @throws InvalidConfigurationException - */ - protected function ensureSrcDir($option, $rootDir, Path $file) - { - // normalize - $realpath = $file->getRealPath($option, $rootDir); - - // validate - if (!$file->isRealDirExist($realpath)) { - throw new InvalidConfigurationException('src directory is not found'); - } - - return $realpath; - } - - /** - * Ensure coverage_clover is valid. - * - * @param string $option coverage_clover option. - * @param string $rootDir Path to project root directory. - * @param Path $file Path object. - * @return array Valid Absolute pathes of coverage_clover. - * @throws InvalidConfigurationException - */ - protected function ensureCloverXmlPaths($option, $rootDir, Path $file) - { - if (is_array($option)) { - return $this->getGlobPathsFromArrayOption($option, $rootDir, $file); - } - - return $this->getGlobPathsFromStringOption($option, $rootDir, $file); - } - - /** - * Return absolute paths from glob path. - * - * @param string $path Absolute path. - * @return array Absolute paths. - * @throws InvalidConfigurationException - */ - protected function getGlobPaths($path) - { - $paths = array(); - $iterator = new \GlobIterator($path); - - foreach ($iterator as $fileInfo) { - /* @var $fileInfo \SplFileInfo */ - $paths[] = $fileInfo->getPathname(); - } - - // validate - if (count($paths) === 0) { - throw new InvalidConfigurationException('coverage_clover XML file is not readable'); - } - - return $paths; - } - - /** - * Return absolute paths from string option value. - * - * @param string $option coverage_clover option value. - * @param string $rootDir Path to project root directory. - * @param Path $file Path object. - * @return array Absolute pathes. - * @throws InvalidConfigurationException - */ - protected function getGlobPathsFromStringOption($option, $rootDir, Path $file) - { - if (!is_string($option)) { - throw new InvalidConfigurationException('coverage_clover XML file is not readable'); - } - - // normalize - $path = $file->toAbsolutePath($option, $rootDir); - - return $this->getGlobPaths($path); - } - - /** - * Return absolute paths from array option values. - * - * @param array $options coverage_clover option values. - * @param string $rootDir Path to project root directory. - * @param Path $file Path object. - * @return array Absolute pathes. - */ - protected function getGlobPathsFromArrayOption(array $options, $rootDir, Path $file) - { - $paths = array(); - - foreach ($options as $option) { - $paths = array_merge($paths, $this->getGlobPathsFromStringOption($option, $rootDir, $file)); - } - - return $paths; - } - - /** - * Ensure json_path is valid. - * - * @param string $option json_path option. - * @param string $rootDir Path to project root directory. - * @param Path $file Path object. - * @return string Valid json_path. - * @throws InvalidConfigurationException - */ - protected function ensureJsonPath($option, $rootDir, Path $file) - { - // normalize - $realpath = $file->getRealWritingFilePath($option, $rootDir); - - // validate file - $realFilePath = $file->getRealPath($realpath, $rootDir); - - if ($realFilePath !== false && !$file->isRealFileWritable($realFilePath)) { - throw new InvalidConfigurationException('json_path is not writable'); - } - - // validate parent dir - $realDir = $file->getRealDir($realpath, $rootDir); - - if (!$file->isRealDirWritable($realDir)) { - throw new InvalidConfigurationException('json_path is not writable'); - } - - return $realpath; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php deleted file mode 100644 index 31f4bf3313..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php +++ /dev/null @@ -1,68 +0,0 @@ - - */ -class CoverallsConfiguration implements ConfigurationInterface -{ - // ConfigurationInterface - - /** - * {@inheritdoc} - * - * @see \Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder() - */ - public function getConfigTreeBuilder() - { - // define configuration - - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('coveralls'); - - $rootNode - ->children() - // same as ruby lib - ->scalarNode('repo_token') - ->defaultNull() - ->end() - ->scalarNode('repo_secret_token') - ->defaultNull() - ->end() - ->scalarNode('service_name') - ->defaultNull() - ->end() - - // for php lib - ->scalarNode('src_dir') - ->defaultValue('src') - ->end() - ->variableNode('coverage_clover') - ->defaultValue('build/logs/clover.xml') - ->end() - ->scalarNode('json_path') - ->defaultValue('build/logs/coveralls-upload.json') - ->end() - ->booleanNode('exclude_no_stmt') - ->defaultFalse() - ->end() - ->end(); - - return $treeBuilder; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php deleted file mode 100644 index 5c7a682fa6..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -abstract class Coveralls implements ArrayConvertable -{ - /** - * String expression (convert to json). - * - * @return string - */ - public function __toString() - { - return json_encode($this->toArray()); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php deleted file mode 100644 index 3a61522d4b..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php +++ /dev/null @@ -1,237 +0,0 @@ - - */ -class Commit extends Coveralls -{ - /** - * Commit ID. - * - * @var string - */ - protected $id; - - /** - * Author name. - * - * @var string - */ - protected $authorName; - - /** - * Author email. - * - * @var string - */ - protected $authorEmail; - - /** - * Committer name. - * - * @var string - */ - protected $committerName; - - /** - * Committer email. - * - * @var string - */ - protected $committerEmail; - - /** - * Commit message. - * - * @var string - */ - protected $message; - - // API - - /** - * {@inheritdoc} - * - * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray() - */ - public function toArray() - { - return array( - 'id' => $this->id, - 'author_name' => $this->authorName, - 'author_email' => $this->authorEmail, - 'committer_name' => $this->committerName, - 'committer_email' => $this->committerEmail, - 'message' => $this->message, - ); - } - - // accessor - - /** - * Set commit ID. - * - * @param string $id - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setId($id) - { - $this->id = $id; - - return $this; - } - - /** - * Return commit ID. - * - * @return string|null - */ - public function getId() - { - if (isset($this->id)) { - return $this->id; - } - - return null; - } - - /** - * Set author name. - * - * @param string $authorName - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setAuthorName($authorName) - { - $this->authorName = $authorName; - - return $this; - } - - /** - * Return author name. - * - * @return string|null - */ - public function getAuthorName() - { - if (isset($this->authorName)) { - return $this->authorName; - } - - return null; - } - - /** - * Set author email. - * - * @param string $authorEmail - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setAuthorEmail($authorEmail) - { - $this->authorEmail = $authorEmail; - - return $this; - } - - /** - * Return author email. - * - * @return string|null - */ - public function getAuthorEmail() - { - if (isset($this->authorEmail)) { - return $this->authorEmail; - } - - return null; - } - - /** - * Set committer name. - * - * @param string $committerName - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setCommitterName($committerName) - { - $this->committerName = $committerName; - - return $this; - } - - /** - * Return committer name. - * - * @return string|null - */ - public function getCommitterName() - { - if (isset($this->committerName)) { - return $this->committerName; - } - - return null; - } - - /** - * Set committer email. - * - * @param string $committerEmail - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setCommitterEmail($committerEmail) - { - $this->committerEmail = $committerEmail; - - return $this; - } - - /** - * Return committer email. - * - * @return string|null - */ - public function getCommitterEmail() - { - if (isset($this->committerEmail)) { - return $this->committerEmail; - } - - return null; - } - - /** - * Set commit message. - * - * @param string $message - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function setMessage($message) - { - $this->message = $message; - - return $this; - } - - /** - * Return commit message. - * - * @return string|null - */ - public function getMessage() - { - if (isset($this->message)) { - return $this->message; - } - - return null; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php deleted file mode 100644 index d823b68840..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php +++ /dev/null @@ -1,119 +0,0 @@ - - */ -class Git extends Coveralls -{ - /** - * Branch name. - * - * @var string - */ - protected $branch; - - /** - * Head. - * - * @var Commit - */ - protected $head; - - /** - * Remote. - * - * @var Remote[] - */ - protected $remotes; - - /** - * Constructor. - * - * @param string $branch Branch name. - * @param Commit $head HEAD commit. - * @param array $remotes Remote repositories. - */ - public function __construct($branch, Commit $head, array $remotes) - { - $this->branch = $branch; - $this->head = $head; - $this->remotes = $remotes; - } - - // API - - /** - * {@inheritdoc} - * - * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray() - */ - public function toArray() - { - $remotes = array(); - - foreach ($this->remotes as $remote) { - $remotes[] = $remote->toArray(); - } - - return array( - 'branch' => $this->branch, - 'head' => $this->head->toArray(), - 'remotes' => $remotes, - ); - } - - // accessor - - /** - * Return branch name. - * - * @return string - */ - public function getBranch() - { - return $this->branch; - } - - /** - * Return HEAD commit. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit - */ - public function getHead() - { - return $this->head; - } - - /** - * Return remote repositories. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote[] - */ - public function getRemotes() - { - return $this->remotes; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php deleted file mode 100644 index eb3590b077..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Remote extends Coveralls -{ - /** - * Remote name. - * - * @var string - */ - protected $name; - - /** - * Remote URL. - * - * @var string - */ - protected $url; - - // API - - /** - * {@inheritdoc} - * - * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray() - */ - public function toArray() - { - return array( - 'name' => $this->name, - 'url' => $this->url, - ); - } - - // accessor - - /** - * Set remote name. - * - * @param string $name Remote name. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Return remote name. - * - * @return string - */ - public function getName() - { - if (isset($this->name)) { - return $this->name; - } - - return null; - } - - /** - * Set remote URL. - * - * @param string $url Remote URL. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote - */ - public function setUrl($url) - { - $this->url = $url; - - return $this; - } - - /** - * Return remote URL. - * - * @return string - */ - public function getUrl() - { - if (isset($this->url)) { - return $this->url; - } - - return null; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php deleted file mode 100644 index 631432132e..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php +++ /dev/null @@ -1,598 +0,0 @@ - - */ -class JsonFile extends Coveralls -{ - /** - * Service name. - * - * @var string - */ - protected $serviceName; - - /** - * Service job id. - * - * @var string - */ - protected $serviceJobId; - - /** - * Service number (not documented). - * - * @var string - */ - protected $serviceNumber; - - /** - * Service event type (not documented). - * - * @var string - */ - protected $serviceEventType; - - /** - * Build URL of the project (not documented). - * - * @var string - */ - protected $serviceBuildUrl; - - /** - * Branch name (not documented). - * - * @var string - */ - protected $serviceBranch; - - /** - * Pull request info (not documented). - * - * @var string - */ - protected $servicePullRequest; - - /** - * Repository token. - * - * @var string - */ - protected $repoToken; - - /** - * Source files. - * - * @var \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile[] - */ - protected $sourceFiles = array(); - - /** - * Git data. - * - * @var array - */ - protected $git; - - /** - * A timestamp when the job ran. Must be parsable by Ruby. - * - * "2013-02-18 00:52:48 -0800" - * - * @var string - */ - protected $runAt; - - /** - * Metrics. - * - * @var Metrics - */ - protected $metrics; - - // API - - /** - * {@inheritdoc} - * - * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray() - */ - public function toArray() - { - $array = array(); - - $arrayMap = array( - // json key => property name - 'service_name' => 'serviceName', - 'service_job_id' => 'serviceJobId', - 'service_number' => 'serviceNumber', - 'service_build_url' => 'serviceBuildUrl', - 'service_branch' => 'serviceBranch', - 'service_pull_request' => 'servicePullRequest', - 'service_event_type' => 'serviceEventType', - 'repo_token' => 'repoToken', - 'git' => 'git', - 'run_at' => 'runAt', - 'source_files' => 'sourceFiles', - ); - - foreach ($arrayMap as $jsonKey => $propName) { - if (isset($this->$propName)) { - $array[$jsonKey] = $this->toJsonProperty($this->$propName); - } - } - - return $array; - } - - /** - * Fill environment variables. - * - * @param array $env $_SERVER environment. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - * @throws \RuntimeException - */ - public function fillJobs(array $env) - { - return $this - ->fillStandardizedEnvVars($env) - ->ensureJobs(); - } - - /** - * Exclude source files that have no executable statements. - * - * @return void - */ - public function excludeNoStatementsFiles() - { - $this->sourceFiles = array_filter( - $this->sourceFiles, - function (SourceFile $sourceFile) { - return $sourceFile->getMetrics()->hasStatements(); - } - ); - } - - /** - * Sort source files by path. - * - * @return void - */ - public function sortSourceFiles() - { - ksort($this->sourceFiles); - } - - /** - * Return line coverage. - * - * @return float - */ - public function reportLineCoverage() - { - $metrics = $this->getMetrics(); - - foreach ($this->sourceFiles as $sourceFile) { - /* @var $sourceFile \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile */ - $metrics->merge($sourceFile->getMetrics()); - } - - return $metrics->getLineCoverage(); - } - - // internal method - - /** - * Convert to json property. - * - * @param mixed $prop - * @return mixed - */ - protected function toJsonProperty($prop) - { - if ($prop instanceof Coveralls) { - return $prop->toArray(); - } elseif (is_array($prop)) { - return $this->toJsonPropertyArray($prop); - } - - return $prop; - } - - /** - * Convert to array as json property. - * - * @param array $propArray - * @return array - */ - protected function toJsonPropertyArray(array $propArray) - { - $array = array(); - - foreach ($propArray as $prop) { - $array[] = $this->toJsonProperty($prop); - } - - return $array; - } - - /** - * Fill standardized environment variables. - * - * "CI_NAME", "CI_BUILD_NUMBER" must be set. - * - * Env vars are: - * - * * CI_NAME - * * CI_BUILD_NUMBER - * * CI_BUILD_URL - * * CI_BRANCH - * * CI_PULL_REQUEST - * - * These vars are supported by Codeship. - * - * @param array $env $_SERVER environment. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - */ - protected function fillStandardizedEnvVars(array $env) - { - $map = array( - // defined in Ruby lib - 'serviceName' => 'CI_NAME', - 'serviceNumber' => 'CI_BUILD_NUMBER', - 'serviceBuildUrl' => 'CI_BUILD_URL', - 'serviceBranch' => 'CI_BRANCH', - 'servicePullRequest' => 'CI_PULL_REQUEST', - - // extends by php-coveralls - 'serviceJobId' => 'CI_JOB_ID', - 'serviceEventType' => 'COVERALLS_EVENT_TYPE', - 'repoToken' => 'COVERALLS_REPO_TOKEN', - ); - - foreach ($map as $propName => $envName) { - if (isset($env[$envName])) { - $this->$propName = $env[$envName]; - } - } - - return $this; - } - - /** - * Ensure data consistency for jobs API. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile - * @throws \RuntimeException - */ - protected function ensureJobs() - { - if (!$this->hasSourceFiles()) { - throw new \RuntimeException('source_files must be set'); - } - - if ($this->requireServiceJobId()) { - return $this; - } - - if ($this->requireServiceNumber()) { - return $this; - } - - if ($this->requireServiceEventType()) { - return $this; - } - - if ($this->isUnsupportedServiceJob()) { - return $this; - } - - $message = 'requirements are not satisfied.'; - - throw new \RuntimeException($message); - } - - /** - * Return whether the job requires "service_job_id" (for Travis CI). - * - * @return boolean - */ - protected function requireServiceJobId() - { - return isset($this->serviceName) && isset($this->serviceJobId) && !isset($this->repoToken); - } - - /** - * Return whether the job requires "service_number" (for CircleCI, Jenkins, Codeship or other CIs). - * - * @return boolean - */ - protected function requireServiceNumber() - { - return isset($this->serviceName) && isset($this->serviceNumber) && isset($this->repoToken); - } - - /** - * Return whether the job requires "service_event_type" (for local environment). - * - * @return boolean - */ - protected function requireServiceEventType() - { - return isset($this->serviceName) && isset($this->serviceEventType) && isset($this->repoToken); - } - - /** - * Return whether the job is running on unsupported service. - * - * @return boolean - */ - protected function isUnsupportedServiceJob() - { - return !isset($this->serviceJobId) && !isset($this->serviceNumber) && !isset($this->serviceEventType) && isset($this->repoToken); - } - - // accessor - - /** - * Return whether the json file has source file. - * - * @param string $path Absolute path to source file. - * @return boolean - */ - public function hasSourceFile($path) - { - return isset($this->sourceFiles[$path]); - } - - /** - * Return source file. - * - * @param string $path Absolute path to source file. - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile|null - */ - public function getSourceFile($path) - { - if ($this->hasSourceFile($path)) { - return $this->sourceFiles[$path]; - } - - return null; - } - - /** - * Add source file. - * - * @param SourceFile $sourceFile - */ - public function addSourceFile(SourceFile $sourceFile) - { - $this->sourceFiles[$sourceFile->getPath()] = $sourceFile; - } - - /** - * Return whether the json file has a source file. - * - * @return boolean - */ - public function hasSourceFiles() - { - return count($this->sourceFiles) > 0; - } - - /** - * Return source files. - * - * @return SourceFile[] - */ - public function getSourceFiles() - { - return $this->sourceFiles; - } - - /** - * Set service name. - * - * @param string $serviceName Service name. - * @return Coveralls - */ - public function setServiceName($serviceName) - { - $this->serviceName = $serviceName; - - return $this; - } - - /** - * Return service name. - * - * @return string - */ - public function getServiceName() - { - if (isset($this->serviceName)) { - return $this->serviceName; - } - - return null; - } - - /** - * Set repository token. - * - * @param string $repoToken Repository token. - * @return Coveralls - */ - public function setRepoToken($repoToken) - { - $this->repoToken = $repoToken; - - return $this; - } - - /** - * Return repository token. - * - * @return string - */ - public function getRepoToken() - { - if (isset($this->repoToken)) { - return $this->repoToken; - } - - return null; - } - - /** - * Set service job id. - * - * @param string $serviceJobId Service job id. - * @return Coveralls - */ - public function setServiceJobId($serviceJobId) - { - $this->serviceJobId = $serviceJobId; - - return $this; - } - - /** - * Return service job id. - * - * @return string - */ - public function getServiceJobId() - { - if (isset($this->serviceJobId)) { - return $this->serviceJobId; - } - - return null; - } - - /** - * Return service number. - * - * @return string - */ - public function getServiceNumber() - { - return $this->serviceNumber; - } - - /** - * Return service event type. - * - * @return string - */ - public function getServiceEventType() - { - return $this->serviceEventType; - } - - /** - * Return build URL of the project. - * - * @return string - */ - public function getServiceBuildUrl() - { - return $this->serviceBuildUrl; - } - - /** - * Return branch name. - * - * @return string - */ - public function getServiceBranch() - { - return $this->serviceBranch; - } - - /** - * Return pull request info. - * - * @return string - */ - public function getServicePullRequest() - { - return $this->servicePullRequest; - } - - /** - * Set git data. - * - * @param array $git Git data. - * @return Coveralls - */ - public function setGit(Git $git) - { - $this->git = $git; - - return $this; - } - - /** - * Return git data. - * - * @return array - */ - public function getGit() - { - if (isset($this->git)) { - return $this->git; - } - - return null; - } - - /** - * Set timestamp when the job ran. - * - * @param string $runAt Timestamp. - * @return Coveralls - */ - public function setRunAt($runAt) - { - $this->runAt = $runAt; - - return $this; - } - - /** - * Return timestamp when the job ran. - * - * @return string - */ - public function getRunAt() - { - if (isset($this->runAt)) { - return $this->runAt; - } - - return null; - } - - /** - * Return metrics. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Metrics - */ - public function getMetrics() - { - if (!isset($this->metrics)) { - $this->metrics = new Metrics(); - } - - return $this->metrics; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php deleted file mode 100644 index 29708d3cde..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php +++ /dev/null @@ -1,143 +0,0 @@ - - */ -class Metrics -{ - /** - * Number of statements. - * - * @var integer - */ - protected $statements; - - /** - * Number of covered statements. - * - * @var integer - */ - protected $coveredStatements; - - /** - * Line coverage. - * - * @var float - */ - protected $lineCoverage; - - /** - * Constructor. - * - * @param array $coverage Coverage data. - */ - public function __construct(array $coverage = array()) - { - if (!empty($coverage)) { - // statements - // not null - $statementsArray = array_filter( - $coverage, - function ($line) { - return $line !== null; - } - ); - $this->statements = count($statementsArray); - - // coveredstatements - // gt 0 - $coveredArray = array_filter( - $statementsArray, - function ($line) { - return $line > 0; - } - ); - $this->coveredStatements = count($coveredArray); - } else { - $this->statements = 0; - $this->coveredStatements = 0; - } - } - - // API - - /** - * Merge other metrics. - * - * @param Metrics $that - * @return void - */ - public function merge(Metrics $that) - { - $this->statements += $that->statements; - $this->coveredStatements += $that->coveredStatements; - $this->lineCoverage = null; // clear previous data - } - - // internal method - - /** - * Calculate line coverage. - * - * @param integer $statements Number of statements. - * @param integer $coveredStatements Number of covered statements. - * @return float - */ - protected function calculateLineCoverage($statements, $coveredStatements) - { - if ($statements === 0) { - return 0; - } - - return ($coveredStatements / $statements) * 100; - } - - // accessor - - /** - * Return whether the source file has executable statements. - * - * @return boolean - */ - public function hasStatements() - { - return $this->statements !== 0; - } - - /** - * Return number of statements. - * - * @return integer - */ - public function getStatements() - { - return $this->statements; - } - - /** - * Return number of covered statements. - * - * @return integer - */ - public function getCoveredStatements() - { - return $this->coveredStatements; - } - - /** - * Return line coverage. - * - * @return float - */ - public function getLineCoverage() - { - if (!isset($this->lineCoverage)) { - $this->lineCoverage = $this->calculateLineCoverage($this->statements, $this->coveredStatements); - } - - return $this->lineCoverage; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php deleted file mode 100644 index 3672da4a88..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php +++ /dev/null @@ -1,176 +0,0 @@ - - */ -class SourceFile extends Coveralls -{ - /** - * Source filename. - * - * @var string - */ - protected $name; - - /** - * Source content. - * - * @var string - */ - protected $source; - - /** - * Coverage data of the source file. - * - * @var array - */ - protected $coverage; - - /** - * Absolute path. - * - * @var string - */ - protected $path; - - /** - * Line number of the source file. - * - * @var integer - */ - protected $fileLines; - - /** - * Metrics. - * - * @var Metrics - */ - protected $metrics; - - /** - * Constructor. - * - * @param string $path Absolute path. - * @param string $name Source filename. - * @param string $eol End of line. - */ - public function __construct($path, $name, $eol = "\n") - { - $this->path = $path; - $this->name = $name; - $this->source = trim(file_get_contents($path)); - - $lines = explode($eol, $this->source); - $this->fileLines = count($lines); - $this->coverage = array_fill(0, $this->fileLines, null); - } - - /** - * {@inheritdoc} - * - * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray() - */ - public function toArray() - { - return array( - 'name' => $this->name, - 'source' => $this->source, - 'coverage' => $this->coverage, - ); - } - - // API - - /** - * Add coverage. - * - * @param integer $lineNum Line number. - * @param integer $count Number of covered. - * @return void - */ - public function addCoverage($lineNum, $count) - { - if (array_key_exists($lineNum, $this->coverage)) { - $this->coverage[$lineNum] += $count; - } - } - - /** - * Return line coverage. - * - * @return float - */ - public function reportLineCoverage() - { - return $this->getMetrics()->getLineCoverage(); - } - - // accessor - - /** - * Return source filename. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Return source content. - * - * @return string - */ - public function getSource() - { - return $this->source; - } - - /** - * Return coverage data of the source file. - * - * @return array - */ - public function getCoverage() - { - return $this->coverage; - } - - /** - * Return absolute path. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Return line number of the source file. - * - * @return integer - */ - public function getFileLines() - { - return $this->fileLines; - } - - /** - * Return metrics. - * - * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Metrics - */ - public function getMetrics() - { - if (!isset($this->metrics)) { - $this->metrics = new Metrics($this->coverage); - } - - return $this->metrics; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/File/Path.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/File/Path.php deleted file mode 100644 index e96fa6dd3e..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/File/Path.php +++ /dev/null @@ -1,165 +0,0 @@ - - */ -class Path -{ - /** - * Return whether the path is relative path. - * - * @param string $path Path. - * @return boolean true if the path is relative path, false otherwise. - */ - public function isRelativePath($path) - { - return strlen($path) === 0 || strpos($path, DIRECTORY_SEPARATOR) !== 0; - } - - /** - * Cat file path. - * - * @param string $path File path. - * @param string $rootDir Absolute path to project root directory. - * @return string|false Absolute path. - */ - public function toAbsolutePath($path, $rootDir) - { - if (!is_string($path)) { - return false; - } - - if ($this->isRelativePath($path)) { - return $rootDir . DIRECTORY_SEPARATOR . $path; - } - - return $path; - } - - /** - * Return real file path. - * - * @param string $path File path. - * @param string $rootDir Absolute path to project root directory. - * @return string|false Real path string if the path string is passed and real path exists, false otherwise. - */ - public function getRealPath($path, $rootDir) - { - if (!is_string($path)) { - return false; - } - - if ($this->isRelativePath($path)) { - return realpath($rootDir . DIRECTORY_SEPARATOR . $path); - } - - return realpath($path); - } - - /** - * Return real directory path. - * - * @param string $path Path. - * @param string $rootDir Absolute path to project root directory. - * @return string|false Real directory path string if the path string is passed and real directory exists, false otherwise. - */ - public function getRealDir($path, $rootDir) - { - if (!is_string($path)) { - return false; - } - - if ($this->isRelativePath($path)) { - return realpath($rootDir . DIRECTORY_SEPARATOR . dirname($path)); - } - - return realpath(dirname($path)); - } - - /** - * Return real file path to write. - * - * @param string $path File path. - * @param string $rootDir Absolute path to project root directory. - * @return string|false Real file path string if the parent directory exists, false otherwise. - */ - public function getRealWritingFilePath($path, $rootDir) - { - $realDir = $this->getRealDir($path, $rootDir); - - if (!is_string($realDir)) { - return false; - } - - return $realDir . DIRECTORY_SEPARATOR . basename($path); - } - - /** - * Return whether the real path exists. - * - * @param string|boolean $realpath Real path. - * @return boolean true if the real path exists, false otherwise. - */ - public function isRealPathExist($realpath) - { - return $realpath !== false && file_exists($realpath); - } - - /** - * Return whether the real file path exists. - * - * @param string|boolean $realpath Real file path. - * @return boolean true if the real file path exists, false otherwise. - */ - public function isRealFileExist($realpath) - { - return $this->isRealPathExist($realpath) && is_file($realpath); - } - - /** - * Return whether the real file path is readable. - * - * @param string|boolean $realpath Real file path. - * @return boolean true if the real file path is readable, false otherwise. - */ - public function isRealFileReadable($realpath) - { - return $this->isRealFileExist($realpath) && is_readable($realpath); - } - - /** - * Return whether the real file path is writable. - * - * @param string|boolean $realpath Real file path. - * @return boolean true if the real file path is writable, false otherwise. - */ - public function isRealFileWritable($realpath) - { - return $this->isRealFileExist($realpath) && is_writable($realpath); - } - - /** - * Return whether the real directory exists. - * - * @param string|boolean $realpath Real directory path. - * @return boolean true if the real directory exists, false otherwise. - */ - public function isRealDirExist($realpath) - { - return $this->isRealPathExist($realpath) && is_dir($realpath); - } - - /** - * Return whether the real directory is writable. - * - * @param string|boolean $realpath Real directory path. - * @return boolean true if the real directory is writable, false otherwise. - */ - public function isRealDirWritable($realpath) - { - return $this->isRealDirExist($realpath) && is_writable($realpath); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php deleted file mode 100644 index e8302d85b2..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class ConsoleLogger extends AbstractLogger -{ - /** - * Output. - * - * @var \Symfony\Component\Console\Output\OutputInterface - */ - protected $output; - - /** - * Constructor. - * - * @param OutputInterface $output - */ - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - /** - * {@inheritdoc} - * - * @return void - * @see \Psr\Log\LoggerInterface::log() - */ - public function log($level, $message, array $context = array()) - { - $this->output->writeln($message); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php deleted file mode 100644 index 63de1d50af..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class GitCommand extends SystemCommand -{ - /** - * Command name or path. - * - * @var string - */ - protected $commandPath = 'git'; - - // API - - /** - * Return branch names. - * - * @return array - */ - public function getBranches() - { - $command = $this->createCommand('branch'); - - return $this->executeCommand($command); - } - - /** - * Return HEAD commit. - * - * @return array - */ - public function getHeadCommit() - { - $command = $this->createCommand("log -1 --pretty=format:'%H\n%aN\n%ae\n%cN\n%ce\n%s'"); - - return $this->executeCommand($command); - } - - /** - * Return remote repositories. - * - * @return array - */ - public function getRemotes() - { - $command = $this->createCommand('remote -v'); - - return $this->executeCommand($command); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php deleted file mode 100644 index 934c0fe5a5..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php +++ /dev/null @@ -1,90 +0,0 @@ - - */ -abstract class SystemCommand -{ - /** - * Command name or path. - * - * @var string - */ - protected $commandPath; - - // API - - /** - * Execute command. - * - * @return array - */ - public function execute() - { - $command = $this->createCommand(); - - return $this->executeCommand($command); - } - - // internal method - - /** - * Execute command. - * - * @param string $command - * @return array - * @throws \RuntimeException - */ - protected function executeCommand($command) - { - exec($command, $result, $returnValue); - - if ($returnValue === 0) { - return $result; - } - - throw new \RuntimeException(sprintf('Failed to execute command: %s', $command), $returnValue); - } - - /** - * Create command. - * - * @param string $args Command arguments. - * @return string - */ - protected function createCommand($args = null) - { - if ($args === null) { - return $this->commandPath; - } - - // escapeshellarg($args) ? - return sprintf('%s %s', $this->commandPath, $args); - } - - // accessor - - /** - * Set command path. - * - * @param string $commandPath Command name or path. - * @return void - */ - public function setCommandPath($commandPath) - { - $this->commandPath = $commandPath; - } - - /** - * Return command path. - * - * @return string - */ - public function getCommandPath() - { - return $this->commandPath; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php deleted file mode 100644 index 03012a0532..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php +++ /dev/null @@ -1,119 +0,0 @@ - - */ -class ApplicationTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->rootDir = realpath(__DIR__ . '/../../../../prj'); - $this->srcDir = $this->rootDir . '/files'; - $this->buildDir = $this->rootDir . '/build'; - $this->logsDir = $this->rootDir . '/build/logs'; - $this->cloverXmlPath = $this->logsDir . '/clover.xml'; - $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json'; - } - - protected function tearDown() - { - $this->rmFile($this->cloverXmlPath); - $this->rmFile($this->jsonPath); - $this->rmDir($this->logsDir); - $this->rmDir($this->buildDir); - } - - protected function rmFile($file) - { - if (is_file($file)) { - chmod(dirname($file), 0777); - unlink($file); - } - } - - protected function rmDir($dir) - { - if (is_dir($dir)) { - chmod($dir, 0777); - rmdir($dir); - } - } - - protected function makeProjectDir($logsDir, $cloverXmlPath, $logsDirUnwritable = false, $jsonPathUnwritable = false) - { - if ($logsDir !== null) { - mkdir($logsDir, 0777, true); - } - - if ($cloverXmlPath !== null) { - file_put_contents($cloverXmlPath, $this->getCloverXml()); - } - - if ($logsDirUnwritable) { - chmod($logsDir, 0577); - } - - if ($jsonPathUnwritable) { - touch($this->jsonPath); - chmod($this->jsonPath, 0577); - } - } - - protected function getCloverXml() - { - $xml = << - - - - - - - - - - - - - - - - - - - - -XML; - return sprintf($xml, $this->srcDir, $this->srcDir); - } - - /** - * @test - */ - public function shouldExecuteCoverallsV1JobsCommand() - { - $this->makeProjectDir($this->logsDir, $this->cloverXmlPath); - - $app = new Application($this->rootDir, 'Coveralls API client for PHP', '1.0.0'); - $app->setAutoExit(false); // avoid to call exit() in Application - - // run - $_SERVER['TRAVIS'] = true; - $_SERVER['TRAVIS_JOB_ID'] = 'application_test'; - - $tester = new ApplicationTester($app); - $actual = $tester->run( - array( - '--dry-run' => true, - '--config' => 'coveralls.yml', - ) - ); - - $this->assertEquals(0, $actual); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php deleted file mode 100644 index 552e07490f..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php +++ /dev/null @@ -1,655 +0,0 @@ - - */ -class JobsTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->dir = realpath(__DIR__ . '/../../../../'); - $this->rootDir = realpath($this->dir . '/prj/files'); - $this->srcDir = $this->rootDir; - $this->url = 'https://coveralls.io/api/v1/jobs'; - $this->jsonPath = __DIR__ . '/coveralls.json'; - $this->filename = 'json_file'; - $this->cloverXmlPath = $this->rootDir . 'clover.xml'; - } - - protected function tearDown() - { - $this->rmFile($this->jsonPath); - $this->rmFile($this->cloverXmlPath); - } - - protected function rmFile($file) - { - if (is_file($file)) { - unlink($file); - } - } - - protected function createJobsWith() - { - $this->config = new Configuration($this->rootDir); - - $this->config - ->setJsonPath($this->jsonPath) - ->setDryRun(false); - - $this->client = $this->createAdapterMockWith($this->url, $this->filename, $this->jsonPath); - - return new Jobs($this->config, $this->client); - } - - protected function createJobsNeverSend() - { - $this->config = new Configuration($this->rootDir); - $this->config - ->setJsonPath($this->jsonPath) - ->setDryRun(false); - - $this->client = $this->createAdapterMockNeverCalled(); - - return new Jobs($this->config, $this->client); - } - - protected function createJobsNeverSendOnDryRun() - { - $this->config = new Configuration($this->rootDir); - $this->config - ->setJsonPath($this->jsonPath) - ->setDryRun(true); - - $this->client = $this->createAdapterMockNeverCalled(); - - return new Jobs($this->config, $this->client); - } - - - protected function createAdapterMockNeverCalled() - { - $client = $this->getMock('Guzzle\Http\Client', array('send')); - - $client - ->expects($this->never()) - ->method('send'); - - return $client; - } - - protected function createAdapterMockWith($url, $filename, $jsonPath) - { - $client = $this->getMock('Guzzle\Http\Client', array('post', 'addPostFiles')); - $request = $this->getMockBuilder('Guzzle\Http\Message\EntityEnclosingRequest') - ->disableOriginalConstructor() - ->getMock(); - - $client - ->expects($this->once()) - ->method('post') - ->with($this->equalTo($url)) - ->will($this->returnSelf()); - - $client - ->expects($this->once()) - ->method('addPostFiles') - ->with($this->equalTo(array($filename => $jsonPath))) - ->will($this->returnValue($request)); - - $request - ->expects($this->once()) - ->method('send') - ->with() - ; - - return $client; - } - - protected function createConfiguration() - { - $config = new Configuration($this->rootDir); - - return $config - ->setSrcDir($this->srcDir) - ->addCloverXmlPath($this->cloverXmlPath); - } - - protected function getCloverXml() - { - $xml = << - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -XML; - return sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir, $this->rootDir); - } - - protected function createCloverXml() - { - $xml = $this->getCloverXml(); - - return simplexml_load_string($xml); - } - - protected function getNoSourceCloverXml() - { - return << - - - - - - - - - - - -XML; - } - - protected function createNoSourceCloverXml() - { - $xml = $this->getNoSourceCloverXml(); - - return simplexml_load_string($xml); - } - - protected function collectJsonFile() - { - $xml = $this->createCloverXml(); - $collector = new CloverXmlCoverageCollector(); - - return $collector->collect($xml, $this->rootDir); - } - - protected function collectJsonFileWithoutSourceFiles() - { - $xml = $this->createNoSourceCloverXml(); - $collector = new CloverXmlCoverageCollector(); - - return $collector->collect($xml, $this->rootDir); - } - - protected function createCiEnvVarsCollector($config = null) - { - if ($config === null) { - $config = $this->createConfiguration(); - } - - return new CiEnvVarsCollector($config); - } - - // getJsonFile() - - /** - * @test - */ - public function shouldNotHaveJsonFileOnConstruction() - { - $object = $this->createJobsNeverSendOnDryRun(); - - $this->assertNull($object->getJsonFile()); - } - - // setJsonFile() - - /** - * @test - */ - public function setJsonFile() - { - $jsonFile = $this->collectJsonFile(); - - $object = $this->createJobsNeverSendOnDryRun()->setJsonFile($jsonFile); - - $this->assertSame($jsonFile, $object->getJsonFile()); - } - - // getConfiguration() - - /** - * @test - */ - public function getConfiguration() - { - $config = $this->createConfiguration(); - - $object = new Jobs($config); - - $this->assertSame($config, $object->getConfiguration()); - } - - // getHttpClient() - - /** - * @test - */ - public function shouldNotHaveHttpClientOnConstructionWithoutHttpClient() - { - $config = $this->createConfiguration(); - - $object = new Jobs($config); - - $this->assertNull($object->getHttpClient()); - } - - /** - * @test - */ - public function shouldHaveHttpClientOnConstructionWithHttpClient() - { - $config = $this->createConfiguration(); - $client = $this->createAdapterMockNeverCalled(); - - $object = new Jobs($config, $client); - - $this->assertSame($client, $object->getHttpClient()); - } - - // setHttpClient() - - /** - * @test - */ - public function setHttpClient() - { - $config = $this->createConfiguration(); - $client = $this->createAdapterMockNeverCalled(); - - $object = new Jobs($config); - $object->setHttpClient($client); - - $this->assertSame($client, $object->getHttpClient()); - } - - // collectCloverXml() - - /** - * @test - */ - public function collectCloverXml() - { - $xml = $this->getCloverXml(); - - file_put_contents($this->cloverXmlPath, $xml); - - $config = $this->createConfiguration(); - - $object = new Jobs($config); - - $same = $object->collectCloverXml(); - - // return $this - $this->assertSame($same, $object); - - return $object; - } - - /** - * @test - * @depends collectCloverXml - */ - public function shouldHaveJsonFileAfterCollectCloverXml(Jobs $object) - { - $jsonFile = $object->getJsonFile(); - - $this->assertNotNull($jsonFile); - $sourceFiles = $jsonFile->getSourceFiles(); - $this->assertCount(4, $sourceFiles); - - return $jsonFile; - } - - /** - * @test - * @depends shouldHaveJsonFileAfterCollectCloverXml - */ - public function shouldNotHaveGitAfterCollectCloverXml(JsonFile $jsonFile) - { - $git = $jsonFile->getGit(); - - $this->assertNull($git); - } - - /** - * @test - */ - public function collectCloverXmlExcludingNoStatementsFiles() - { - $xml = $this->getCloverXml(); - - file_put_contents($this->cloverXmlPath, $xml); - - $config = $this->createConfiguration()->setExcludeNoStatements(true); - - $object = new Jobs($config); - - $same = $object->collectCloverXml(); - - // return $this - $this->assertSame($same, $object); - - return $object; - } - - /** - * @test - * @depends collectCloverXmlExcludingNoStatementsFiles - */ - public function shouldHaveJsonFileAfterCollectCloverXmlExcludingNoStatementsFiles(Jobs $object) - { - $jsonFile = $object->getJsonFile(); - - $this->assertNotNull($jsonFile); - $sourceFiles = $jsonFile->getSourceFiles(); - $this->assertCount(2, $sourceFiles); - - return $jsonFile; - } - - // collectGitInfo() - - /** - * @test - * @depends collectCloverXml - */ - public function collectGitInfo(Jobs $object) - { - $same = $object->collectGitInfo(); - - // return $this - $this->assertSame($same, $object); - - return $object; - } - - /** - * @test - * @depends collectGitInfo - */ - public function shouldHaveJsonFileAfterCollectGitInfo(Jobs $object) - { - $jsonFile = $object->getJsonFile(); - - $this->assertNotNull($jsonFile); - - return $jsonFile; - } - - /** - * @test - * @depends shouldHaveJsonFileAfterCollectGitInfo - */ - public function shouldHaveGitAfterCollectGitInfo(JsonFile $jsonFile) - { - $git = $jsonFile->getGit(); - - $this->assertNotNull($git); - } - - // send() - - /** - * @test - */ - public function sendTravisCiJob() - { - $serviceName = 'travis-ci'; - $serviceJobId = '1.1'; - - $server = array(); - $server['TRAVIS'] = true; - $server['TRAVIS_JOB_ID'] = $serviceJobId; - - $object = $this->createJobsWith(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function sendTravisProJob() - { - $serviceName = 'travis-pro'; - $serviceJobId = '1.1'; - - $server = array(); - $server['TRAVIS'] = true; - $server['TRAVIS_JOB_ID'] = $serviceJobId; - - $object = $this->createJobsWith(); - $config = $object->getConfiguration()->setServiceName($serviceName); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - - $this->assertEquals($serviceName, $jsonFile->getServiceName()); - $this->assertEquals($serviceJobId, $jsonFile->getServiceJobId()); - } - - /** - * @test - */ - public function sendCircleCiJob() - { - $serviceName = 'circleci'; - $serviceNumber = '123'; - $repoToken = 'token'; - - $server = array(); - $server['COVERALLS_REPO_TOKEN'] = $repoToken; - $server['CIRCLECI'] = 'true'; - $server['CIRCLE_BUILD_NUM'] = $serviceNumber; - - $object = $this->createJobsWith(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function sendJenkinsJob() - { - $serviceName = 'jenkins'; - $serviceNumber = '123'; - $repoToken = 'token'; - - $server = array(); - $server['COVERALLS_REPO_TOKEN'] = $repoToken; - $server['JENKINS_URL'] = 'http://localhost:8080'; - $server['BUILD_NUMBER'] = $serviceNumber; - - $object = $this->createJobsWith(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function sendLocalJob() - { - $serviceName = 'php-coveralls'; - $serviceEventType = 'manual'; - - $server = array(); - $server['COVERALLS_RUN_LOCALLY'] = '1'; - - $object = $this->createJobsWith(); - $config = $object->getConfiguration()->setRepoToken('token'); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function sendUnsupportedJob() - { - $server = array(); - $server['COVERALLS_REPO_TOKEN'] = 'token'; - - $object = $this->createJobsWith(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function sendUnsupportedGitJob() - { - $server = array(); - $server['COVERALLS_REPO_TOKEN'] = 'token'; - $server['GIT_COMMIT'] = 'abc123'; - - $object = $this->createJobsWith(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - */ - public function shouldNotSendJobIfTestEnv() - { - $server = array(); - $server['TRAVIS'] = true; - $server['TRAVIS_JOB_ID'] = '1.1'; - - $object = $this->createJobsNeverSendOnDryRun(); - $config = $object->getConfiguration()->setEnv('test'); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfInvalidEnv() - { - $server = array(); - - $object = $this->createJobsNeverSend(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfNoSourceFiles() - { - $server = array(); - $server['TRAVIS'] = true; - $server['TRAVIS_JOB_ID'] = '1.1'; - $server['COVERALLS_REPO_TOKEN'] = 'token'; - $server['GIT_COMMIT'] = 'abc123'; - - $object = $this->createJobsNeverSend(); - $jsonFile = $this->collectJsonFile(); - - $object - ->setJsonFile($jsonFile) - ->collectEnvVars($server) - ->dumpJsonFile() - ->send(); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php deleted file mode 100644 index 5b61e2e8bf..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php +++ /dev/null @@ -1,206 +0,0 @@ - - */ -class CiEnvVarsCollectorTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->dir = realpath(__DIR__ . '/../../../../'); - $this->rootDir = realpath($this->dir . '/prj/files'); - $this->srcDir = $this->rootDir; - //$this->url = 'https://coveralls.io/api/v1/jobs'; - //$this->jsonPath = __DIR__ . '/coveralls.json'; - //$this->filename = 'json_file'; - $this->cloverXmlPath = $this->rootDir . 'clover.xml'; - } - - protected function createConfiguration() - { - $config = new Configuration($this->rootDir); - - return $config->setSrcDir($this->srcDir)->addCloverXmlPath($this->cloverXmlPath); - } - - protected function createCiEnvVarsCollector($config = null) - { - if ($config === null) { - $config = $this->createConfiguration(); - } - - return new CiEnvVarsCollector($config); - } - - // collect() - - /** - * @test - */ - public function collectTravisCiEnvVars() - { - $serviceName = 'travis-ci'; - $serviceJobId = '1.1'; - - $env = array(); - $env['TRAVIS'] = true; - $env['TRAVIS_JOB_ID'] = $serviceJobId; - - $object = $this->createCiEnvVarsCollector(); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('CI_NAME', $actual); - $this->assertEquals($serviceName, $actual['CI_NAME']); - - $this->assertArrayHasKey('CI_JOB_ID', $actual); - $this->assertEquals($serviceJobId, $actual['CI_JOB_ID']); - } - - /** - * @test - */ - public function collectTravisProEnvVars() - { - $serviceName = 'travis-pro'; - $serviceJobId = '1.2'; - - $env = array(); - $env['TRAVIS'] = true; - $env['TRAVIS_JOB_ID'] = $serviceJobId; - - $config = $this->createConfiguration(); - $config->setServiceName($serviceName); - - $object = $this->createCiEnvVarsCollector($config); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('CI_NAME', $actual); - $this->assertEquals($serviceName, $actual['CI_NAME']); - - $this->assertArrayHasKey('CI_JOB_ID', $actual); - $this->assertEquals($serviceJobId, $actual['CI_JOB_ID']); - } - - /** - * @test - */ - public function collectCircleCiEnvVars() - { - $serviceName = 'circleci'; - $serviceNumber = '123'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = 'token'; - $env['CIRCLECI'] = 'true'; - $env['CIRCLE_BUILD_NUM'] = $serviceNumber; - - $object = $this->createCiEnvVarsCollector(); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('CI_NAME', $actual); - $this->assertEquals($serviceName, $actual['CI_NAME']); - - $this->assertArrayHasKey('CI_BUILD_NUMBER', $actual); - $this->assertEquals($serviceNumber, $actual['CI_BUILD_NUMBER']); - } - - /** - * @test - */ - public function collectJenkinsEnvVars() - { - $serviceName = 'jenkins'; - $serviceNumber = '123'; - $buildUrl = 'http://localhost:8080'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = 'token'; - $env['JENKINS_URL'] = $buildUrl; - $env['BUILD_NUMBER'] = $serviceNumber; - - $object = $this->createCiEnvVarsCollector(); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('CI_NAME', $actual); - $this->assertEquals($serviceName, $actual['CI_NAME']); - - $this->assertArrayHasKey('CI_BUILD_NUMBER', $actual); - $this->assertEquals($serviceNumber, $actual['CI_BUILD_NUMBER']); - - $this->assertArrayHasKey('CI_BUILD_URL', $actual); - $this->assertEquals($buildUrl, $actual['CI_BUILD_URL']); - } - - /** - * @test - */ - public function collectLocalEnvVars() - { - $serviceName = 'php-coveralls'; - $serviceEventType = 'manual'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = 'token'; - $env['COVERALLS_RUN_LOCALLY'] = '1'; - - $object = $this->createCiEnvVarsCollector(); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('CI_NAME', $actual); - $this->assertEquals($serviceName, $actual['CI_NAME']); - - $this->assertArrayHasKey('COVERALLS_EVENT_TYPE', $actual); - $this->assertEquals($serviceEventType, $actual['COVERALLS_EVENT_TYPE']); - - $this->assertArrayHasKey('CI_JOB_ID', $actual); - $this->assertNull($actual['CI_JOB_ID']); - } - - /** - * @test - */ - public function collectUnsupportedConfig() - { - $repoToken = 'token'; - - $env = array(); - - $config = $this->createConfiguration(); - $config->setRepoToken($repoToken); - - $object = $this->createCiEnvVarsCollector($config); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('COVERALLS_REPO_TOKEN', $actual); - $this->assertEquals($repoToken, $actual['COVERALLS_REPO_TOKEN']); - } - - /** - * @test - */ - public function collectUnsupportedEnvVars() - { - $repoToken = 'token'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = $repoToken; - - $object = $this->createCiEnvVarsCollector(); - - $actual = $object->collect($env); - - $this->assertArrayHasKey('COVERALLS_REPO_TOKEN', $actual); - $this->assertEquals($repoToken, $actual['COVERALLS_REPO_TOKEN']); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php deleted file mode 100644 index c6dc4085a7..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php +++ /dev/null @@ -1,177 +0,0 @@ - - */ -class CloverXmlCoverageCollectorTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->dir = realpath(__DIR__ . '/../../../../'); - $this->rootDir = realpath($this->dir . '/prj/files'); - - $this->object = new CloverXmlCoverageCollector(); - } - - protected function createCloverXml() - { - $xml = << - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -XML; - - return simplexml_load_string(sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir)); - } - - // getJsonFile() - - /** - * @test - */ - public function shouldNotHaveJsonFileOnConstruction() - { - $this->assertNull($this->object->getJsonFile()); - } - - // collect() - - /** - * @test - */ - public function collect() - { - $xml = $this->createCloverXml(); - $jsonFile = $this->object->collect($xml, $this->rootDir); - - $this->assertSame($jsonFile, $this->object->getJsonFile()); - $this->assertJsonFile($jsonFile, null, null, null, null, '2013-04-13 10:28:13 +0000'); - - return $jsonFile; - } - - /** - * @test - * @depends collect - */ - public function collectSourceFiles(JsonFile $jsonFile) - { - $sourceFiles = $jsonFile->getSourceFiles(); - - $this->assertCount(2, $sourceFiles); - - return $jsonFile; - } - - /** - * @test - * @depends collectSourceFiles - */ - public function collectSourceFileTest1(JsonFile $jsonFile) - { - $sourceFiles = $jsonFile->getSourceFiles(); - - $name1 = 'test.php'; - $path1 = $this->rootDir . DIRECTORY_SEPARATOR . $name1; - - $this->assertArrayHasKey($path1, $sourceFiles); - $this->assertSourceFileTest1($sourceFiles[$path1]); - } - - /** - * @test - * @depends collectSourceFiles - */ - public function collectSourceFileTest2(JsonFile $jsonFile) - { - $sourceFiles = $jsonFile->getSourceFiles(); - - $name2 = 'test2.php'; - $path2 = $this->rootDir . DIRECTORY_SEPARATOR . $name2; - - $this->assertArrayHasKey($path2, $sourceFiles); - $this->assertSourceFileTest2($sourceFiles[$path2]); - } - - // custom assert - - protected function assertJsonFile($jsonFile, $serviceName, $serviceJobId, $repoToken, $git, $runAt) - { - $this->assertEquals($serviceName, $jsonFile->getServiceName()); - $this->assertEquals($serviceJobId, $jsonFile->getServiceJobId()); - $this->assertEquals($repoToken, $jsonFile->getRepoToken()); - $this->assertSame($git, $jsonFile->getGit()); - $this->assertEquals($runAt, $jsonFile->getRunAt()); - } - - protected function assertSourceFile(SourceFile $sourceFile, $name, $path, $fileLines, array $coverage, $source) - { - $this->assertEquals($name, $sourceFile->getName()); - $this->assertEquals($path, $sourceFile->getPath()); - $this->assertEquals($fileLines, $sourceFile->getFileLines()); - $this->assertSame($coverage, $sourceFile->getCoverage()); - $this->assertEquals($source, $sourceFile->getSource()); - } - - protected function assertSourceFileTest1(SourceFile $sourceFile) - { - $name1 = 'test.php'; - $path1 = $this->rootDir . DIRECTORY_SEPARATOR . $name1; - $fileLines1 = 9; - $coverage1 = array_fill(0, $fileLines1, null); - $coverage1[6] = 3; - $source1 = trim(file_get_contents($path1)); - - $this->assertSourceFile($sourceFile, $name1, $path1, $fileLines1, $coverage1, $source1); - } - - protected function assertSourceFileTest2(SourceFile $sourceFile) - { - $name2 = 'test2.php'; - $path2 = $this->rootDir . DIRECTORY_SEPARATOR . $name2; - $fileLines2 = 10; - $coverage2 = array_fill(0, $fileLines2, null); - $coverage2[7] = 0; - $source2 = trim(file_get_contents($path2)); - - $this->assertSourceFile($sourceFile, $name2, $path2, $fileLines2, $coverage2, $source2); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php deleted file mode 100644 index 368d830fe6..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php +++ /dev/null @@ -1,226 +0,0 @@ - - */ -class GitInfoCollectorTest extends \PHPUnit_Framework_TestCase -{ - public function setUp() - { - $this->getBranchesValue = array( - ' master', - '* branch1', - ' branch2', - ); - $this->getHeadCommitValue = array( - 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'Author Name', - 'author@satooshi.jp', - 'Committer Name', - 'committer@satooshi.jp', - 'commit message', - ); - $this->getRemotesValue = array( - "origin\tgit@github.com:satooshi/php-coveralls.git (fetch)", - "origin\tgit@github.com:satooshi/php-coveralls.git (push)", - ); - } - - protected function createGitCommandStub() - { - $class = 'Contrib\Component\System\Git\GitCommand'; - - return $this->getMock($class); - } - - protected function createGitCommandStubWith($getBranchesValue, $getHeadCommitValue, $getRemotesValue) - { - $stub = $this->createGitCommandStub(); - - $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue); - $this->setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue); - $this->setUpGitCommandStubWithGetRemotesOnce($stub, $getRemotesValue); - - return $stub; - } - - protected function createGitCommandStubCalledBranches($getBranchesValue, $getHeadCommitValue, $getRemotesValue) - { - $stub = $this->createGitCommandStub(); - - $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue); - $this->setUpGitCommandStubWithGetHeadCommitNeverCalled($stub, $getHeadCommitValue); - $this->setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue); - - return $stub; - } - - protected function createGitCommandStubCalledHeadCommit($getBranchesValue, $getHeadCommitValue, $getRemotesValue) - { - $stub = $this->createGitCommandStub(); - - $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue); - $this->setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue); - $this->setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue); - - return $stub; - } - - protected function setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue) - { - $stub->expects($this->once()) - ->method('getBranches') - ->will($this->returnValue($getBranchesValue)); - } - - protected function setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue) - { - $stub->expects($this->once()) - ->method('getHeadCommit') - ->will($this->returnValue($getHeadCommitValue)); - } - - protected function setUpGitCommandStubWithGetHeadCommitNeverCalled($stub, $getHeadCommitValue) - { - $stub->expects($this->never()) - ->method('getHeadCommit') - ->will($this->returnValue($getHeadCommitValue)); - } - - protected function setUpGitCommandStubWithGetRemotesOnce($stub, $getRemotesValue) - { - $stub->expects($this->once()) - ->method('getRemotes') - ->will($this->returnValue($getRemotesValue)); - } - - protected function setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue) - { - $stub->expects($this->never()) - ->method('getRemotes') - ->will($this->returnValue($getRemotesValue)); - } - - // getCommand() - - /** - * @test - */ - public function getCommand() - { - $command = new GitCommand(); - $object = new GitInfoCollector($command); - - $this->assertSame($command, $object->getCommand()); - } - - // collect() - - /** - * @test - */ - public function collect() - { - $gitCommand = $this->createGitCommandStubWith($this->getBranchesValue, $this->getHeadCommitValue, $this->getRemotesValue); - $object = new GitInfoCollector($gitCommand); - - $git = $object->collect(); - - $gitClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Git'; - $this->assertTrue($git instanceof $gitClass); - $this->assertGit($git); - } - - protected function assertGit(Git $git) - { - $this->assertEquals('branch1', $git->getBranch()); - - $commit = $git->getHead(); - - $commitClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit'; - $this->assertTrue($commit instanceof $commitClass); - $this->assertCommit($commit); - - $remotes = $git->getRemotes(); - $this->assertCount(1, $remotes); - - $remoteClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote'; - $this->assertTrue($remotes[0] instanceof $remoteClass); - $this->assertRemote($remotes[0]); - } - - protected function assertCommit(Commit $commit) - { - $this->assertEquals('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', $commit->getId()); - $this->assertEquals('Author Name', $commit->getAuthorName()); - $this->assertEquals('author@satooshi.jp', $commit->getAuthorEmail()); - $this->assertEquals('Committer Name', $commit->getCommitterName()); - $this->assertEquals('committer@satooshi.jp', $commit->getCommitterEmail()); - $this->assertEquals('commit message', $commit->getMessage()); - } - - protected function assertRemote(Remote $remote) - { - $this->assertEquals('origin', $remote->getName()); - $this->assertEquals('git@github.com:satooshi/php-coveralls.git', $remote->getUrl()); - } - - // collectBranch() exception - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfCurrentBranchNotFound() - { - $getBranchesValue = array( - ' master', - ); - $gitCommand = $this->createGitCommandStubCalledBranches($getBranchesValue, $this->getHeadCommitValue, $this->getRemotesValue); - - $object = new GitInfoCollector($gitCommand); - - $object->collect(); - } - - // collectCommit() exception - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfHeadCommitIsInvalid() - { - $getHeadCommitValue = array(); - $gitCommand = $this->createGitCommandStubCalledHeadCommit($this->getBranchesValue, $getHeadCommitValue, $this->getRemotesValue); - - $object = new GitInfoCollector($gitCommand); - - $object->collect(); - } - - // collectRemotes() exception - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfRemoteIsInvalid() - { - $getRemotesValue = array(); - $gitCommand = $this->createGitCommandStubWith($this->getBranchesValue, $this->getHeadCommitValue, $getRemotesValue); - - $object = new GitInfoCollector($gitCommand); - - $object->collect(); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php deleted file mode 100644 index a50dae7fb6..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php +++ /dev/null @@ -1,126 +0,0 @@ - - */ -class CoverallsV1JobsCommandTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->rootDir = realpath(__DIR__ . '/../../../../prj'); - $this->srcDir = $this->rootDir . '/files'; - $this->buildDir = $this->rootDir . '/build'; - $this->logsDir = $this->rootDir . '/build/logs'; - $this->cloverXmlPath = $this->logsDir . '/clover.xml'; - $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json'; - } - - protected function tearDown() - { - $this->rmFile($this->cloverXmlPath); - $this->rmFile($this->jsonPath); - $this->rmDir($this->logsDir); - $this->rmDir($this->buildDir); - } - - protected function rmFile($file) - { - if (is_file($file)) { - chmod(dirname($file), 0777); - unlink($file); - } - } - - protected function rmDir($dir) - { - if (is_dir($dir)) { - chmod($dir, 0777); - rmdir($dir); - } - } - - protected function makeProjectDir($logsDir, $cloverXmlPath, $logsDirUnwritable = false, $jsonPathUnwritable = false) - { - if ($logsDir !== null) { - mkdir($logsDir, 0777, true); - } - - if ($cloverXmlPath !== null) { - file_put_contents($cloverXmlPath, $this->getCloverXml()); - } - - if ($logsDirUnwritable) { - chmod($logsDir, 0577); - } - - if ($jsonPathUnwritable) { - touch($this->jsonPath); - chmod($this->jsonPath, 0577); - } - } - - protected function getCloverXml() - { - $xml = << - - - - - - - - - - - - - - - - - - - - -XML; - return sprintf($xml, $this->srcDir, $this->srcDir); - } - - /** - * @test - */ - public function shouldExecuteCoverallsV1JobsCommand() - { - $this->makeProjectDir($this->logsDir, $this->cloverXmlPath); - - $command = new CoverallsV1JobsCommand(); - $command->setRootDir($this->rootDir); - - $app = new Application(); - $app->add($command); - - $command = $app->find('coveralls:v1:jobs'); - $commandTester = new CommandTester($command); - - $_SERVER['TRAVIS'] = true; - $_SERVER['TRAVIS_JOB_ID'] = 'command_test'; - - $actual = $commandTester->execute( - array( - 'command' => $command->getName(), - '--dry-run' => true, - '--config' => 'coveralls.yml', - '--env' => 'test', - ) - ); - - $this->assertEquals(0, $actual); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php deleted file mode 100644 index 9829682ec1..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php +++ /dev/null @@ -1,407 +0,0 @@ - - */ -class ConfigurationTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->object = new Configuration(); - } - - // hasRepoToken() - // getRepoToken() - - /** - * @test - */ - public function shouldNotHaveRepoTokenOnConstruction() - { - $this->assertFalse($this->object->hasRepoToken()); - $this->assertNull($this->object->getRepoToken()); - } - - // hasServiceName() - // getServiceName() - - /** - * @test - */ - public function shouldNotHaveServiceNameOnConstruction() - { - $this->assertFalse($this->object->hasServiceName()); - $this->assertNull($this->object->getServiceName()); - } - - // getSrcDir() - - /** - * @test - */ - public function shouldNotHaveSrcDirOnConstruction() - { - $this->assertNull($this->object->getSrcDir()); - } - - // getCloverXmlPaths() - - /** - * @test - */ - public function shouldHaveEmptyCloverXmlPathsOnConstruction() - { - $this->assertEmpty($this->object->getCloverXmlPaths()); - } - - // getJsonPath() - - /** - * @test - */ - public function shouldNotHaveJsonPathOnConstruction() - { - $this->assertNull($this->object->getJsonPath()); - } - - // isDryRun() - - /** - * @test - */ - public function shouldBeDryRunOnConstruction() - { - $this->assertTrue($this->object->isDryRun()); - } - - // isExcludeNoStatements() - - /** - * @test - */ - public function shouldNotBeExcludeNotStatementsOnConstruction() - { - $this->assertFalse($this->object->isExcludeNoStatements()); - } - - // isVerbose - - /** - * @test - */ - public function shouldNotBeVerboseOnConstruction() - { - $this->assertFalse($this->object->isVerbose()); - } - - // getEnv() - - /** - * @test - */ - public function shouldBeProdEnvOnConstruction() - { - $this->assertEquals('prod', $this->object->getEnv()); - } - - // isTestEnv() - - /** - * @test - */ - public function shouldBeTestEnv() - { - $expected = 'test'; - - $this->object->setEnv($expected); - - $this->assertEquals($expected, $this->object->getEnv()); - $this->assertTrue($this->object->isTestEnv()); - $this->assertFalse($this->object->isDevEnv()); - $this->assertFalse($this->object->isProdEnv()); - } - - // isDevEnv() - - /** - * @test - */ - public function shouldBeDevEnv() - { - $expected = 'dev'; - - $this->object->setEnv($expected); - - $this->assertEquals($expected, $this->object->getEnv()); - $this->assertFalse($this->object->isTestEnv()); - $this->assertTrue($this->object->isDevEnv()); - $this->assertFalse($this->object->isProdEnv()); - } - - // isProdEnv() - - /** - * @test - */ - public function shouldBeProdEnv() - { - $expected = 'prod'; - - $this->object->setEnv($expected); - - $this->assertEquals($expected, $this->object->getEnv()); - $this->assertFalse($this->object->isTestEnv()); - $this->assertFalse($this->object->isDevEnv()); - $this->assertTrue($this->object->isProdEnv()); - } - - - - // setRepoToken() - - /** - * @test - */ - public function setRepoToken() - { - $expected = 'token'; - - $same = $this->object->setRepoToken($expected); - - $this->assertSame($same, $this->object); - $this->assertSame($expected, $this->object->getRepoToken()); - } - - // setServiceName() - - /** - * @test - */ - public function setServiceName() - { - $expected = 'travis-ci'; - - $same = $this->object->setServiceName($expected); - - $this->assertSame($same, $this->object); - $this->assertSame($expected, $this->object->getServiceName()); - } - - // setSrcDir() - - /** - * @test - */ - public function setSrcDir() - { - $expected = '/path/to/src'; - - $same = $this->object->setSrcDir($expected); - - $this->assertSame($same, $this->object); - $this->assertSame($expected, $this->object->getSrcDir()); - } - - // setCloverXmlPaths() - - /** - * @test - */ - public function setCloverXmlPaths() - { - $expected = array('/path/to/clover.xml'); - - $same = $this->object->setCloverXmlPaths($expected); - - $this->assertSame($same, $this->object); - $this->assertSame($expected, $this->object->getCloverXmlPaths()); - } - - // addCloverXmlPath() - - /** - * @test - */ - public function addCloverXmlPath() - { - $expected = '/path/to/clover.xml'; - - $same = $this->object->addCloverXmlPath($expected); - - $this->assertSame($same, $this->object); - $this->assertSame(array($expected), $this->object->getCloverXmlPaths()); - } - - // setJsonPath() - - /** - * @test - */ - public function setJsonPath() - { - $expected = '/path/to/coveralls-upload.json'; - - $same = $this->object->setJsonPath($expected); - - $this->assertSame($same, $this->object); - $this->assertSame($expected, $this->object->getJsonPath()); - } - - // setDryRun() - - /** - * @test - */ - public function setDryRunFalse() - { - $expected = false; - - $same = $this->object->setDryRun($expected); - - $this->assertSame($same, $this->object); - $this->assertFalse($this->object->isDryRun()); - } - - /** - * @test - */ - public function setDryRunTrue() - { - $expected = true; - - $same = $this->object->setDryRun($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isDryRun()); - } - - // setExcludeNoStatements() - - /** - * @test - */ - public function setExcludeNoStatementsFalse() - { - $expected = false; - - $same = $this->object->setExcludeNoStatements($expected); - - $this->assertSame($same, $this->object); - $this->assertFalse($this->object->isExcludeNoStatements()); - } - - /** - * @test - */ - public function setExcludeNoStatementsTrue() - { - $expected = true; - - $same = $this->object->setExcludeNoStatements($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isExcludeNoStatements()); - } - - // setExcludeNoStatementsUnlessFalse() - - /** - * @test - */ - public function setExcludeNoStatementsFalseUnlessFalse() - { - $expected = false; - - $same = $this->object->setExcludeNoStatementsUnlessFalse($expected); - - $this->assertSame($same, $this->object); - $this->assertFalse($this->object->isExcludeNoStatements()); - } - - /** - * @test - */ - public function setExcludeNoStatementsTrueUnlessFalse() - { - $expected = true; - - $same = $this->object->setExcludeNoStatementsUnlessFalse($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isExcludeNoStatements()); - } - - /** - * @test - */ - public function setExcludeNoStatementsTrueIfFalsePassedAndIfTrueWasSet() - { - $expected = false; - - $same = $this->object->setExcludeNoStatements(true); - $same = $this->object->setExcludeNoStatementsUnlessFalse($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isExcludeNoStatements()); - } - - /** - * @test - */ - public function setExcludeNoStatementsTrueIfTruePassedAndIfTrueWasSet() - { - $expected = true; - - $same = $this->object->setExcludeNoStatements(true); - $same = $this->object->setExcludeNoStatementsUnlessFalse($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isExcludeNoStatements()); - } - - // setVerbose() - - /** - * @test - */ - public function setVerboseFalse() - { - $expected = false; - - $same = $this->object->setVerbose($expected); - - $this->assertSame($same, $this->object); - $this->assertFalse($this->object->isVerbose()); - } - - /** - * @test - */ - public function setVerboseTrue() - { - $expected = true; - - $same = $this->object->setVerbose($expected); - - $this->assertSame($same, $this->object); - $this->assertTrue($this->object->isVerbose()); - } - - // setEnv() - - /** - * @test - */ - public function setEnv() - { - $expected = 'myenv'; - - $same = $this->object->setEnv($expected); - - $this->assertSame($same, $this->object); - $this->assertEquals($expected, $this->object->getEnv()); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php deleted file mode 100644 index 3bc52bde0a..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php +++ /dev/null @@ -1,355 +0,0 @@ - - */ -class ConfiguratorTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->rootDir = realpath(__DIR__ . '/../../../../prj'); - $this->srcDir = $this->rootDir . '/src'; - $this->buildDir = $this->rootDir . '/build'; - $this->logsDir = $this->rootDir . '/build/logs'; - $this->cloverXmlPath = $this->logsDir . '/clover.xml'; - $this->cloverXmlPath1 = $this->logsDir . '/clover-part1.xml'; - $this->cloverXmlPath2 = $this->logsDir . '/clover-part2.xml'; - $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json'; - - $this->object = new Configurator(); - } - - protected function tearDown() - { - $this->rmFile($this->cloverXmlPath); - $this->rmFile($this->cloverXmlPath1); - $this->rmFile($this->cloverXmlPath2); - $this->rmFile($this->jsonPath); - $this->rmDir($this->srcDir); - $this->rmDir($this->logsDir); - $this->rmDir($this->buildDir); - } - - protected function rmFile($file) - { - if (is_file($file)) { - chmod(dirname($file), 0777); - unlink($file); - } - } - - protected function rmDir($dir) - { - if (is_dir($dir)) { - chmod($dir, 0777); - rmdir($dir); - } - } - - protected function makeProjectDir($srcDir, $logsDir, $cloverXmlPaths, $logsDirUnwritable = false, $jsonPathUnwritable = false) - { - if ($srcDir !== null) { - mkdir($srcDir, 0777, true); - } - - if ($logsDir !== null) { - mkdir($logsDir, 0777, true); - } - - if ($cloverXmlPaths !== null) { - if (is_array($cloverXmlPaths)) { - foreach ($cloverXmlPaths as $cloverXmlPath) { - touch($cloverXmlPath); - } - } else { - touch($cloverXmlPaths); - } - } - - if ($logsDirUnwritable) { - chmod($logsDir, 0577); - } - - if ($jsonPathUnwritable) { - touch($this->jsonPath); - chmod($this->jsonPath, 0577); - } - } - - // custom assertion - - protected function assertConfiguration(Configuration $config, $srcDir, array $cloverXml, $jsonPath, $excludeNoStatements = false) - { - $this->assertEquals($srcDir, $config->getSrcDir()); - $this->assertEquals($cloverXml, $config->getCloverXmlPaths()); - $this->assertEquals($jsonPath, $config->getJsonPath()); - $this->assertEquals($excludeNoStatements, $config->isExcludeNoStatements()); - } - - // load() - - /** - * @test - */ - public function shouldLoadNonExistingYml() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/dummy.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath); - } - - // default src_dir not found - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfSrcDirNotFound() - { - $this->makeProjectDir(null, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/dummy.yml'); - - $this->object->load($path, $this->rootDir); - } - - // default coverage_clover not found - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfCoverageCloverNotFound() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, null); - - $path = realpath(__DIR__ . '/yaml/dummy.yml'); - - $this->object->load($path, $this->rootDir); - } - - // default json_path not writable - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfJsonPathDirNotWritable() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath, true); - - $path = realpath(__DIR__ . '/yaml/dummy.yml'); - - $this->object->load($path, $this->rootDir); - } - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfJsonPathNotWritable() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath, false, true); - - $path = realpath(__DIR__ . '/yaml/dummy.yml'); - - $this->object->load($path, $this->rootDir); - } - - // no configuration - - /** - * @test - */ - public function shouldLoadEmptyYml() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/empty.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath); - } - - // load default value yml - - /** - * @test - */ - public function shouldLoadSrcDirYmlContainingDefaultValue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/src_dir.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath); - } - - /** - * @test - */ - public function shouldLoadCoverageCloverYmlContainingDefaultValue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/coverage_clover.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath); - } - - /** - * @test - */ - public function shouldLoadCoverageCloverYmlContainingGlobValue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, array($this->cloverXmlPath1, $this->cloverXmlPath2)); - - $path = realpath(__DIR__ . '/yaml/coverage_clover_glob.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath1, $this->cloverXmlPath2), $this->jsonPath); - } - - /** - * @test - */ - public function shouldLoadCoverageCloverYmlContainingArrayValue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, array($this->cloverXmlPath1, $this->cloverXmlPath2)); - - $path = realpath(__DIR__ . '/yaml/coverage_clover_array.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath1, $this->cloverXmlPath2), $this->jsonPath); - } - - /** - * @test - */ - public function shouldLoadJsonPathYmlContainingDefaultValue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/json_path.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath); - } - - /** - * @test - */ - public function shouldLoadExcludeNoStmtYmlContainingTrue() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_true.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath, true); - } - - /** - * @test - */ - public function shouldLoadExcludeNoStmtYmlContainingFalse() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_false.yml'); - - $config = $this->object->load($path, $this->rootDir); - - $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath, false); - } - - // configured src_dir not found - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadSrcDirYmlIfSrcDirNotFound() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/src_dir_not_found.yml'); - - $this->object->load($path, $this->rootDir); - } - - // configured coverage_clover not found - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadCoverageCloverYmlIfCoverageCloverNotFound() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/coverage_clover_not_found.yml'); - - $this->object->load($path, $this->rootDir); - } - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadCoverageCloverYmlIfCoverageCloverIsNotString() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/coverage_clover_invalid.yml'); - - $this->object->load($path, $this->rootDir); - } - - // configured json_path not found - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadJsonPathYmlIfJsonPathNotFound() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/json_path_not_found.yml'); - - $this->object->load($path, $this->rootDir); - } - - // configured exclude_no_stmt invalid - - /** - * @test - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ - public function throwInvalidConfigurationExceptionOnLoadExcludeNoStmtYmlIfInvalid() - { - $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath); - - $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_invalid.yml'); - - $this->object->load($path, $this->rootDir); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml deleted file mode 100644 index f6e9ef4cf0..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml +++ /dev/null @@ -1 +0,0 @@ -coverage_clover: build/logs/clover.xml diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml deleted file mode 100644 index 721b36e1bc..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml +++ /dev/null @@ -1,3 +0,0 @@ -coverage_clover: - - build/logs/clover-part1.xml - - build/logs/clover-part2.xml diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml deleted file mode 100644 index c8f7bd3d50..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml +++ /dev/null @@ -1 +0,0 @@ -coverage_clover: build/logs/clover-*.xml diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml deleted file mode 100644 index bb3506d8fe..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml +++ /dev/null @@ -1 +0,0 @@ -coverage_clover: false diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml deleted file mode 100644 index f1113242a6..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml +++ /dev/null @@ -1 +0,0 @@ -coverage_clover: build/logs/clover.dummy.xml diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/empty.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/empty.yml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml deleted file mode 100644 index 0c411829ab..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml +++ /dev/null @@ -1 +0,0 @@ -exclude_no_stmt: false diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml deleted file mode 100644 index 54d20fcad0..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml +++ /dev/null @@ -1 +0,0 @@ -exclude_no_stmt: 1 diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml deleted file mode 100644 index c1c4d345e1..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml +++ /dev/null @@ -1 +0,0 @@ -exclude_no_stmt: true diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml deleted file mode 100644 index 092f4ee1ac..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml +++ /dev/null @@ -1 +0,0 @@ -json_path: build/logs/coveralls-upload.json diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml deleted file mode 100644 index e4ad72c692..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml +++ /dev/null @@ -1 +0,0 @@ -json_path: build/logs.dummy/coveralls-upload.json diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml deleted file mode 100644 index 7a18ce2e62..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml +++ /dev/null @@ -1 +0,0 @@ -src_dir: src diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml deleted file mode 100644 index 7295a0721e..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml +++ /dev/null @@ -1 +0,0 @@ -src_dir: src.dummy.dir diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php deleted file mode 100644 index f9c6bfface..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php +++ /dev/null @@ -1,220 +0,0 @@ - - */ -class CommitTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->object = new Commit(); - } - - // getId() - - /** - * @test - */ - public function shouldNotHaveIdOnConstruction() - { - $this->assertNull($this->object->getId()); - } - - // getAuthorName() - - /** - * @test - */ - public function shouldNotHoveAuthorNameOnConstruction() - { - $this->assertNull($this->object->getAuthorName()); - } - - // getAuthorEmail() - - /** - * @test - */ - public function shouldNotHoveAuthorEmailOnConstruction() - { - $this->assertNull($this->object->getAuthorEmail()); - } - - // getCommitterName() - - /** - * @test - */ - public function shouldNotHoveCommitterNameOnConstruction() - { - $this->assertNull($this->object->getCommitterName()); - } - - // getCommitterEmail() - - /** - * @test - */ - public function shouldNotHoveCommitterEmailOnConstruction() - { - $this->assertNull($this->object->getCommitterEmail()); - } - - // getMessage() - - /** - * @test - */ - public function shouldNotHoveMessageOnConstruction() - { - $this->assertNull($this->object->getMessage()); - } - - - // setId() - - /** - * @test - */ - public function setId() - { - $expected = 'id'; - - $obj = $this->object->setId($expected); - - $this->assertEquals($expected, $this->object->getId()); - $this->assertSame($obj, $this->object); - } - - // setAuthorName() - - /** - * @test - */ - public function setAuthorName() - { - $expected = 'author_name'; - - $obj = $this->object->setAuthorName($expected); - - $this->assertEquals($expected, $this->object->getAuthorName()); - $this->assertSame($obj, $this->object); - } - - // setAuthorEmail() - - /** - * @test - */ - public function setAuthorEmail() - { - $expected = 'author_email'; - - $obj = $this->object->setAuthorEmail($expected); - - $this->assertEquals($expected, $this->object->getAuthorEmail()); - $this->assertSame($obj, $this->object); - } - - // setCommitterName() - - /** - * @test - */ - public function setCommitterName() - { - $expected = 'committer_name'; - - $obj = $this->object->setCommitterName($expected); - - $this->assertEquals($expected, $this->object->getCommitterName()); - $this->assertSame($obj, $this->object); - } - - // setCommitterEmail() - - /** - * @test - */ - public function setCommitterEmail() - { - $expected = 'committer_email'; - - $obj = $this->object->setCommitterEmail($expected); - - $this->assertEquals($expected, $this->object->getCommitterEmail()); - $this->assertSame($obj, $this->object); - } - - // setMessage() - - /** - * @test - */ - public function setMessage() - { - $expected = 'message'; - - $obj = $this->object->setMessage($expected); - - $this->assertEquals($expected, $this->object->getMessage()); - $this->assertSame($obj, $this->object); - } - - // toArray() - - /** - * @test - */ - public function toArray() - { - $expected = array( - 'id' => null, - 'author_name' => null, - 'author_email' => null, - 'committer_name' => null, - 'committer_email' => null, - 'message' => null, - ); - - $this->assertSame($expected, $this->object->toArray()); - $this->assertSame(json_encode($expected), (string)$this->object); - } - - /** - * @test - */ - public function toArrayFilled() - { - $id = 'id'; - $authorName = 'author_name'; - $authorEmail = 'author_email'; - $committerName = 'committer_name'; - $committerEmail = 'committer_email'; - $message = 'message'; - - $this->object - ->setId($id) - ->setAuthorName($authorName) - ->setAuthorEmail($authorEmail) - ->setCommitterName($committerName) - ->setCommitterEmail($committerEmail) - ->setMessage($message); - - $expected = array( - 'id' => $id, - 'author_name' => $authorName, - 'author_email' => $authorEmail, - 'committer_name' => $committerName, - 'committer_email' => $committerEmail, - 'message' => $message, - ); - - $this->assertSame($expected, $this->object->toArray()); - $this->assertSame(json_encode($expected), (string)$this->object); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php deleted file mode 100644 index 7b1c818d58..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ -class GitTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->branchName = 'branch_name'; - $this->commit = $this->createCommit(); - $this->remote = $this->createRemote(); - - $this->object = new Git($this->branchName, $this->commit, array($this->remote)); - } - - protected function createRemote($name = 'name', $url = 'url') - { - $remote = new Remote(); - - return $remote - ->setName($name) - ->setUrl($url); - } - - protected function createCommit($id = 'id', $authorName = 'author_name', $authorEmail = 'author_email', $committerName = 'committer_name', $committerEmail = 'committer_email', $message = 'message') - { - $commit = new Commit(); - - return $commit - ->setId($id) - ->setAuthorName($authorName) - ->setAuthorEmail($authorEmail) - ->setCommitterName($committerName) - ->setCommitterEmail($committerEmail) - ->setMessage($message); - } - - // getBranch() - - /** - * @test - */ - public function getBranch() - { - $this->assertEquals($this->branchName, $this->object->getBranch()); - } - - // getHead() - - /** - * @test - */ - public function getHead() - { - $this->assertSame($this->commit, $this->object->getHead()); - } - - // getRemotes() - - /** - * @test - */ - public function getRemotes() - { - $this->assertSame(array($this->remote), $this->object->getRemotes()); - } - - // toArray() - - /** - * @test - */ - public function toArray() - { - $expected = array( - 'branch' => $this->branchName, - 'head' => $this->commit->toArray(), - 'remotes' => array($this->remote->toArray()), - ); - - $this->assertSame($expected, $this->object->toArray()); - $this->assertSame(json_encode($expected), (string)$this->object); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php deleted file mode 100644 index c83b012c78..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - */ -class RemoteTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->object = new Remote(); - } - - // getName() - - /** - * @test - */ - public function shouldNotHaveRemoteNameOnConstruction() - { - $this->assertNull($this->object->getName()); - } - - // getUrl() - - /** - * @test - */ - public function shouldNotHaveUrlOnConstruction() - { - $this->assertNull($this->object->getUrl()); - } - - // setName() - - /** - * @test - */ - public function setRemoteName() - { - $expected = 'remote_name'; - - $obj = $this->object->setName($expected); - - $this->assertEquals($expected, $this->object->getName()); - $this->assertSame($obj, $this->object); - } - - // setUrl() - - /** - * @test - */ - public function setRemoteUrl() - { - $expected = 'git@github.com:satooshi/php-coveralls.git'; - - $obj = $this->object->setUrl($expected); - - $this->assertEquals($expected, $this->object->getUrl()); - $this->assertSame($obj, $this->object); - } - - // toArray() - - /** - * @test - */ - public function toArray() - { - $expected = array( - 'name' => null, - 'url' => null, - ); - - $this->assertSame($expected, $this->object->toArray()); - $this->assertSame(json_encode($expected), (string)$this->object); - } - - /** - * @test - */ - public function toArrayFilled() - { - $name = 'name'; - $url = 'url'; - - $this->object - ->setName($name) - ->setUrl($url); - - $expected = array( - 'name' => $name, - 'url' => $url, - ); - - $this->assertSame($expected, $this->object->toArray()); - $this->assertSame(json_encode($expected), (string)$this->object); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php deleted file mode 100644 index 967a006457..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php +++ /dev/null @@ -1,725 +0,0 @@ - - */ -class JsonFileTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->dir = realpath(__DIR__ . '/../../../../'); - $this->rootDir = realpath($this->dir . '/prj/files'); - $this->filename = 'test.php'; - $this->path = $this->rootDir . DIRECTORY_SEPARATOR . $this->filename; - - $this->object = new JsonFile(); - } - - - protected function createSourceFile() - { - return new SourceFile($this->path, $this->filename); - } - - protected function getCloverXml() - { - $xml = << - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -XML; - return sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir, $this->rootDir); - } - - protected function createCloverXml() - { - $xml = $this->getCloverXml(); - - return simplexml_load_string($xml); - } - - protected function collectJsonFile() - { - $xml = $this->createCloverXml(); - $collector = new CloverXmlCoverageCollector(); - - return $collector->collect($xml, $this->rootDir); - } - - protected function getNoSourceCloverXml() - { - return << - - - - - - - - - - - -XML; - } - - protected function createNoSourceCloverXml() - { - $xml = $this->getNoSourceCloverXml(); - - return simplexml_load_string($xml); - } - - protected function collectJsonFileWithoutSourceFiles() - { - $xml = $this->createNoSourceCloverXml(); - $collector = new CloverXmlCoverageCollector(); - - return $collector->collect($xml, $this->rootDir); - } - - - // hasSourceFile() - // getSourceFile() - - /** - * @test - */ - public function shouldNotHaveSourceFileOnConstruction() - { - $path = 'test.php'; - - $this->assertFalse($this->object->hasSourceFile($path)); - $this->assertNull($this->object->getSourceFile($path)); - } - - // hasSourceFiles() - // getSourceFiles() - - /** - * @test - */ - public function countZeroSourceFilesOnConstruction() - { - $this->assertFalse($this->object->hasSourceFiles()); - $this->assertEmpty($this->object->getSourceFiles()); - } - - // getServiceName() - - /** - * @test - */ - public function shouldNotHaveServiceNameOnConstruction() - { - $this->assertNull($this->object->getServiceName()); - } - - // getRepoToken() - - /** - * @test - */ - public function shouldNotHaveRepoTokenOnConstruction() - { - $this->assertNull($this->object->getRepoToken()); - } - - // getServiceJobId() - - /** - * @test - */ - public function shouldNotHaveServiceJobIdOnConstruction() - { - $this->assertNull($this->object->getServiceJobId()); - } - - // getServiceNumber() - - /** - * @test - */ - public function shouldNotHaveServiceNumberOnConstruction() - { - $this->assertNull($this->object->getServiceNumber()); - } - - // getServiceEventType() - - /** - * @test - */ - public function shouldNotHaveServiceEventTypeOnConstruction() - { - $this->assertNull($this->object->getServiceEventType()); - } - - // getServiceBuildUrl() - - /** - * @test - */ - public function shouldNotHaveServiceBuildUrlOnConstruction() - { - $this->assertNull($this->object->getServiceBuildUrl()); - } - - // getServiceBranch() - - /** - * @test - */ - public function shouldNotHaveServiceBranchOnConstruction() - { - $this->assertNull($this->object->getServiceBranch()); - } - - // getServicePullRequest() - - /** - * @test - */ - public function shouldNotHaveServicePullRequestOnConstruction() - { - $this->assertNull($this->object->getServicePullRequest()); - } - - // getGit() - - /** - * @test - */ - public function shouldNotHaveGitOnConstruction() - { - $this->assertNull($this->object->getGit()); - } - - // getRunAt() - - /** - * @test - */ - public function shouldNotHaveRunAtOnConstruction() - { - $this->assertNull($this->object->getRunAt()); - } - - // getMetrics() - - /** - * @test - */ - public function shouldHaveEmptyMetrics() - { - $metrics = $this->object->getMetrics(); - - $this->assertEquals(0, $metrics->getStatements()); - $this->assertEquals(0, $metrics->getCoveredStatements()); - $this->assertEquals(0, $metrics->getLineCoverage()); - } - - // setServiceName() - - /** - * @test - */ - public function setServiceName() - { - $expected = 'travis-ci'; - - $obj = $this->object->setServiceName($expected); - - $this->assertEquals($expected, $this->object->getServiceName()); - $this->assertSame($obj, $this->object); - - return $this->object; - } - - // setRepoToken() - - /** - * @test - */ - public function setRepoToken() - { - $expected = 'token'; - - $obj = $this->object->setRepoToken($expected); - - $this->assertEquals($expected, $this->object->getRepoToken()); - $this->assertSame($obj, $this->object); - - return $this->object; - } - - // setServiceJobId() - - /** - * @test - */ - public function setServiceJobId() - { - $expected = 'job_id'; - - $obj = $this->object->setServiceJobId($expected); - - $this->assertEquals($expected, $this->object->getServiceJobId()); - $this->assertSame($obj, $this->object); - - return $this->object; - } - - // setGit() - - /** - * @test - */ - public function setGit() - { - $remotes = array(new Remote()); - $head = new Commit(); - $git = new Git('master', $head, $remotes); - - $obj = $this->object->setGit($git); - - $this->assertSame($git, $this->object->getGit()); - $this->assertSame($obj, $this->object); - - return $this->object; - } - - // setRunAt() - - /** - * @test - */ - public function setRunAt() - { - $expected = '2013-04-04 11:22:33 +0900'; - - $obj = $this->object->setRunAt($expected); - - $this->assertEquals($expected, $this->object->getRunAt()); - $this->assertSame($obj, $this->object); - - return $this->object; - } - - - - // addSourceFile() - // sortSourceFiles() - - /** - * @test - */ - public function addSourceFile() - { - $sourceFile = $this->createSourceFile(); - - $this->object->addSourceFile($sourceFile); - $this->object->sortSourceFiles(); - - $path = $sourceFile->getPath(); - - $this->assertTrue($this->object->hasSourceFiles()); - $this->assertSame(array($path => $sourceFile), $this->object->getSourceFiles()); - $this->assertTrue($this->object->hasSourceFile($path)); - $this->assertSame($sourceFile, $this->object->getSourceFile($path)); - } - - // toArray() - - /** - * @test - */ - public function toArray() - { - $expected = array( - 'source_files' => array(), - ); - - $this->assertEquals($expected, $this->object->toArray()); - $this->assertEquals(json_encode($expected), (string)$this->object); - } - - /** - * @test - */ - public function toArrayWithSourceFiles() - { - $sourceFile = $this->createSourceFile(); - - $this->object->addSourceFile($sourceFile); - - $expected = array( - 'source_files' => array($sourceFile->toArray()), - ); - - $this->assertEquals($expected, $this->object->toArray()); - $this->assertEquals(json_encode($expected), (string)$this->object); - } - - // service_name - - /** - * @test - * @depends setServiceName - */ - public function toArrayWithServiceName($object) - { - $item = 'travis-ci'; - - $expected = array( - 'service_name' => $item, - 'source_files' => array(), - ); - - $this->assertEquals($expected, $object->toArray()); - $this->assertEquals(json_encode($expected), (string)$object); - } - - // service_job_id - - /** - * @test - * @depends setServiceJobId - */ - public function toArrayWithServiceJobId($object) - { - $item = 'job_id'; - - $expected = array( - 'service_job_id' => $item, - 'source_files' => array(), - ); - - $this->assertEquals($expected, $object->toArray()); - $this->assertEquals(json_encode($expected), (string)$object); - } - - // repo_token - - /** - * @test - * @depends setRepoToken - */ - public function toArrayWithRepoToken($object) - { - $item = 'token'; - - $expected = array( - 'repo_token' => $item, - 'source_files' => array(), - ); - - $this->assertEquals($expected, $object->toArray()); - $this->assertEquals(json_encode($expected), (string)$object); - } - - // git - - /** - * @test - * @depends setGit - */ - public function toArrayWithGit($object) - { - $remotes = array(new Remote()); - $head = new Commit(); - $git = new Git('master', $head, $remotes); - - $expected = array( - 'git' => $git->toArray(), - 'source_files' => array(), - ); - - $this->assertSame($expected, $object->toArray()); - $this->assertEquals(json_encode($expected), (string)$object); - } - - // run_at - - /** - * @test - * @depends setRunAt - */ - public function toArrayWithRunAt($object) - { - $item = '2013-04-04 11:22:33 +0900'; - - $expected = array( - 'run_at' => $item, - 'source_files' => array(), - ); - - $this->assertEquals($expected, $object->toArray()); - $this->assertEquals(json_encode($expected), (string)$object); - } - - // fillJobs() - - /** - * @test - */ - public function fillJobsForServiceJobId() - { - $serviceName = 'travis-ci'; - $serviceJobId = '1.1'; - - $env = array(); - $env['CI_NAME'] = $serviceName; - $env['CI_JOB_ID'] = $serviceJobId; - - $object = $this->collectJsonFile(); - - $same = $object->fillJobs($env); - - $this->assertSame($same, $object); - $this->assertEquals($serviceName, $object->getServiceName()); - $this->assertEquals($serviceJobId, $object->getServiceJobId()); - } - - /** - * @test - */ - public function fillJobsForServiceNumber() - { - $repoToken = 'token'; - $serviceName = 'circleci'; - $serviceNumber = '123'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = $repoToken; - $env['CI_NAME'] = $serviceName; - $env['CI_BUILD_NUMBER'] = $serviceNumber; - - $object = $this->collectJsonFile(); - - $same = $object->fillJobs($env); - - $this->assertSame($same, $object); - $this->assertEquals($repoToken, $object->getRepoToken()); - $this->assertEquals($serviceName, $object->getServiceName()); - $this->assertEquals($serviceNumber, $object->getServiceNumber()); - } - - /** - * @test - */ - public function fillJobsForStandardizedEnvVars() - { - /* - * CI_NAME=codeship - * CI_BUILD_NUMBER=108821 - * CI_BUILD_URL=https://www.codeship.io/projects/2777/builds/108821 - * CI_BRANCH=master - * CI_PULL_REQUEST=false - */ - - $repoToken = 'token'; - $serviceName = 'codeship'; - $serviceNumber = '108821'; - $serviceBuildUrl = 'https://www.codeship.io/projects/2777/builds/108821'; - $serviceBranch = 'master'; - $servicePullRequest = 'false'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = $repoToken; - $env['CI_NAME'] = $serviceName; - $env['CI_BUILD_NUMBER'] = $serviceNumber; - $env['CI_BUILD_URL'] = $serviceBuildUrl; - $env['CI_BRANCH'] = $serviceBranch; - $env['CI_PULL_REQUEST'] = $servicePullRequest; - - $object = $this->collectJsonFile(); - - $same = $object->fillJobs($env); - - $this->assertSame($same, $object); - $this->assertEquals($repoToken, $object->getRepoToken()); - $this->assertEquals($serviceName, $object->getServiceName()); - $this->assertEquals($serviceNumber, $object->getServiceNumber()); - $this->assertEquals($serviceBuildUrl, $object->getServiceBuildUrl()); - $this->assertEquals($serviceBranch, $object->getServiceBranch()); - $this->assertEquals($servicePullRequest, $object->getServicePullRequest()); - } - - /** - * @test - */ - public function fillJobsForServiceEventType() - { - $repoToken = 'token'; - $serviceName = 'php-coveralls'; - $serviceEventType = 'manual'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = $repoToken; - $env['COVERALLS_RUN_LOCALLY'] = '1'; - $env['COVERALLS_EVENT_TYPE'] = $serviceEventType; - $env['CI_NAME'] = $serviceName; - - $object = $this->collectJsonFile(); - - $same = $object->fillJobs($env); - - $this->assertSame($same, $object); - $this->assertEquals($repoToken, $object->getRepoToken()); - $this->assertEquals($serviceName, $object->getServiceName()); - $this->assertNull($object->getServiceJobId()); - $this->assertEquals($serviceEventType, $object->getServiceEventType()); - } - - /** - * @test - */ - public function fillJobsForUnsupportedJob() - { - $repoToken = 'token'; - - $env = array(); - $env['COVERALLS_REPO_TOKEN'] = $repoToken; - - $object = $this->collectJsonFile(); - - $same = $object->fillJobs($env); - - $this->assertSame($same, $object); - $this->assertEquals($repoToken, $object->getRepoToken()); - } - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionOnFillingJobsIfInvalidEnv() - { - $env = array(); - - $object = $this->collectJsonFile(); - - $object->fillJobs($env); - } - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionOnFillingJobsIfNoSourceFiles() - { - $env = array(); - $env['TRAVIS'] = true; - $env['TRAVIS_JOB_ID'] = '1.1'; - - $object = $this->collectJsonFileWithoutSourceFiles(); - - $object->fillJobs($env); - } - - // reportLineCoverage() - - /** - * @test - */ - public function reportLineCoverage() - { - $object = $this->collectJsonFile(); - - $this->assertEquals(50, $object->reportLineCoverage()); - - $metrics = $object->getMetrics(); - - $this->assertEquals(2, $metrics->getStatements()); - $this->assertEquals(1, $metrics->getCoveredStatements()); - $this->assertEquals(50, $metrics->getLineCoverage()); - } - - // excludeNoStatementsFiles() - - /** - * @test - */ - public function excludeNoStatementsFiles() - { - $rootDir = $this->rootDir . DIRECTORY_SEPARATOR; - - $object = $this->collectJsonFile(); - - // before excluding - $sourceFiles = $object->getSourceFiles(); - $this->assertCount(4, $sourceFiles); - - // filenames - $paths = array_keys($sourceFiles); - $filenames = array_map(function ($path) use ($rootDir) {return str_replace($rootDir, '', $path);}, $paths); - - $this->assertContains('test.php', $filenames); - $this->assertContains('test2.php', $filenames); - $this->assertContains('TestInterface.php', $filenames); - $this->assertContains('AbstractClass.php', $filenames); - - // after excluding - $object->excludeNoStatementsFiles(); - - $sourceFiles = $object->getSourceFiles(); - $this->assertCount(2, $sourceFiles); - - // filenames - $paths = array_keys($sourceFiles); - $filenames = array_map(function ($path) use ($rootDir) {return str_replace($rootDir, '', $path);}, $paths); - - $this->assertContains('test.php', $filenames); - $this->assertContains('test2.php', $filenames); - $this->assertNotContains('TestInterface.php', $filenames); - $this->assertNotContains('AbstractClass.php', $filenames); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php deleted file mode 100644 index 74c9425380..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - */ -class MetricsTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->coverage = array_fill(0, 5, null); - $this->coverage[1] = 1; - $this->coverage[3] = 1; - $this->coverage[4] = 0; - } - - // hasStatements() - // getStatements() - - /** - * @test - */ - public function shouldNotHaveStatementsOnConstructionWithoutCoverage() - { - $object = new Metrics(); - - $this->assertFalse($object->hasStatements()); - $this->assertEquals(0, $object->getStatements()); - } - - /** - * @test - */ - public function shouldHaveStatementsOnConstructionWithCoverage() - { - $object = new Metrics($this->coverage); - - $this->assertTrue($object->hasStatements()); - $this->assertEquals(3, $object->getStatements()); - } - - // getCoveredStatements() - - /** - * @test - */ - public function shouldNotHaveCoveredStatementsOnConstructionWithoutCoverage() - { - $object = new Metrics(); - - $this->assertEquals(0, $object->getCoveredStatements()); - } - - /** - * @test - */ - public function shouldHaveCoveredStatementsOnConstructionWithCoverage() - { - $object = new Metrics($this->coverage); - - $this->assertEquals(2, $object->getCoveredStatements()); - } - - // getLineCoverage() - - /** - * @test - */ - public function shouldNotHaveLineCoverageOnConstructionWithoutCoverage() - { - $object = new Metrics(); - - $this->assertEquals(0, $object->getLineCoverage()); - } - - /** - * @test - */ - public function shouldHaveLineCoverageOnConstructionWithCoverage() - { - $object = new Metrics($this->coverage); - - $this->assertEquals(200/3, $object->getLineCoverage()); - } - - // merge() - - /** - * @test - */ - public function mergeThatWithEmptyMetrics() - { - $object = new Metrics(); - $that = new Metrics($this->coverage); - $object->merge($that); - - $this->assertEquals(3, $object->getStatements()); - $this->assertEquals(2, $object->getCoveredStatements()); - $this->assertEquals(200/3, $object->getLineCoverage()); - } - - /** - * @test - */ - public function mergeThat() - { - $object = new Metrics($this->coverage); - $that = new Metrics($this->coverage); - $object->merge($that); - - $this->assertEquals(6, $object->getStatements()); - $this->assertEquals(4, $object->getCoveredStatements()); - $this->assertEquals(400/6, $object->getLineCoverage()); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php deleted file mode 100644 index 23ccff5903..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php +++ /dev/null @@ -1,138 +0,0 @@ - - */ -class SourceFileTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->dir = realpath(__DIR__ . '/../../../../'); - $this->rootDir = realpath($this->dir . '/prj/files'); - $this->filename = 'test.php'; - $this->path = $this->rootDir . DIRECTORY_SEPARATOR . $this->filename; - - $this->object = new SourceFile($this->path, $this->filename); - } - - // getName() - - /** - * @test - */ - public function shouldHaveNameOnConstruction() - { - $this->assertEquals($this->filename, $this->object->getName()); - } - - // getSource() - - /** - * @test - */ - public function shouldHaveSourceOnConstruction() - { - $expected = trim(file_get_contents($this->path)); - - $this->assertEquals($expected, $this->object->getSource()); - } - - // getCoverage() - - /** - * @test - */ - public function shouldHaveNullCoverageOnConstruction() - { - $expected = array_fill(0, 9, null); - - $this->assertEquals($expected, $this->object->getCoverage()); - } - - // getPath() - - /** - * @test - */ - public function shouldHavePathOnConstruction() - { - $this->assertEquals($this->path, $this->object->getPath()); - } - - // getFileLines() - - /** - * @test - */ - public function shouldHaveFileLinesOnConstruction() - { - $this->assertEquals(9, $this->object->getFileLines()); - } - - // toArray() - - /** - * @test - */ - public function toArray() - { - $expected = array( - 'name' => $this->filename, - 'source' => trim(file_get_contents($this->path)), - 'coverage' => array_fill(0, 9, null), - ); - - $this->assertEquals($expected, $this->object->toArray()); - $this->assertEquals(json_encode($expected), (string)$this->object); - } - - // addCoverage() - - /** - * @test - */ - public function addCoverage() - { - $this->object->addCoverage(5, 1); - - $expected = array_fill(0, 9, null); - $expected[5] = 1; - - $this->assertEquals($expected, $this->object->getCoverage()); - } - - // getMetrics() - // reportLineCoverage() - - /** - * @test - */ - public function shouldLineCoverageZeroWithoutAddingCoverage() - { - $metrics = $this->object->getMetrics(); - - $this->assertEquals(0, $metrics->getStatements()); - $this->assertEquals(0, $metrics->getCoveredStatements()); - $this->assertEquals(0, $metrics->getLineCoverage()); - $this->assertEquals(0, $this->object->reportLineCoverage()); - } - - /** - * @test - */ - public function shouldLineCoverageAfterAddingCoverage() - { - $this->object->addCoverage(6, 1); - - $metrics = $this->object->getMetrics(); - - $this->assertEquals(1, $metrics->getStatements()); - $this->assertEquals(1, $metrics->getCoveredStatements()); - $this->assertEquals(100, $metrics->getLineCoverage()); - $this->assertEquals(100, $this->object->reportLineCoverage()); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php deleted file mode 100644 index d8f3f72417..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php +++ /dev/null @@ -1,442 +0,0 @@ - - */ -class PathTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - $this->existingFile = __DIR__ . '/existing.txt'; - $this->unreadablePath = __DIR__ . '/unreadable.txt'; - $this->unwritablePath = __DIR__ . '/unwritable.txt'; - $this->unwritableDir = __DIR__ . '/unwritable.dir'; - - $this->object = new Path(); - } - - protected function tearDown() - { - $this->rmFile($this->existingFile); - $this->rmFile($this->unreadablePath); - $this->rmFile($this->unwritablePath); - - $this->rmDir($this->unwritableDir); - } - - protected function rmFile($file) - { - if (is_file($file)) { - unlink($file); - } - } - - protected function rmDir($dir) - { - if (is_dir($dir)) { - rmdir($dir); - } - } - - protected function touchUnreadableFile() - { - $this->rmFile($this->unreadablePath); - - touch($this->unreadablePath); - chmod($this->unreadablePath, 0377); - } - - protected function touchUnwritableFile() - { - $this->rmFile($this->unwritablePath); - - touch($this->unwritablePath); - chmod($this->unwritablePath, 0577); - } - - protected function mkdirUnwritableDir() - { - $this->rmDir($this->unwritableDir); - - mkdir($this->unwritableDir); - chmod($this->unwritableDir, 0577); - } - - // provider - - public function provideRelativePaths() - { - return array( - array(''), - array('.'), - array('..'), - ); - } - - public function proviceAbsolutePaths() - { - return array( - array('/'), - array('/path/to/somewhere'), - ); - } - - // isRelativePath() - - /** - * @test - * @dataProvider provideRelativePaths - */ - public function shouldBeRelativePath($path) - { - $this->assertTrue($this->object->isRelativePath($path)); - } - - /** - * @test - * @dataProvider proviceAbsolutePaths - */ - public function shouldNotBeRelativePath($path) - { - $this->assertFalse($this->object->isRelativePath($path)); - } - - // toAbsolutePath() - - /** - * @test - */ - public function shouldNotConvertAbsolutePath() - { - $path = false; - $rootDir = __DIR__; - - $this->assertFalse($this->object->toAbsolutePath($path, $rootDir)); - } - - /** - * @test - * @dataProvider provideRelativePaths - */ - public function shouldConvertAbsolutePathIfRelativePathGiven($path) - { - $rootDir = '/path/to/dir'; - - $expected = $rootDir . DIRECTORY_SEPARATOR . $path; - - $this->assertEquals($expected, $this->object->toAbsolutePath($path, $rootDir)); - } - - /** - * @test - */ - public function shouldConvertAbsolutePathIfAbsolutePathGiven() - { - $rootDir = '/path/to/dir'; - $path = __DIR__; - - $expected = $path; - - $this->assertEquals($expected, $this->object->toAbsolutePath($path, $rootDir)); - } - - // getRealPath() - - /** - * @test - */ - public function shouldNotBeRealPath() - { - $path = false; - $rootDir = __DIR__; - - $this->assertFalse($this->object->getRealPath($path, $rootDir)); - } - - /** - * @test - * @dataProvider provideRelativePaths - */ - public function shouldGetRealPathIfRelativePathGiven($path) - { - $rootDir = __DIR__; - - $expected = realpath($rootDir . DIRECTORY_SEPARATOR . $path); - - $this->assertEquals($expected, $this->object->getRealPath($path, $rootDir)); - } - - /** - * @test - */ - public function shouldGetRealPathIfAbsolutePathGiven() - { - $path = __DIR__; - $rootDir = ''; - - $expected = realpath($path); - - $this->assertEquals($expected, $this->object->getRealPath($path, $rootDir)); - } - - // getRealDir() - - /** - * @test - */ - public function shouldNotBeRealDir() - { - $path = false; - $rootDir = __DIR__; - - $this->assertFalse($this->object->getRealDir($path, $rootDir)); - } - - /** - * @test - */ - public function shouldGetRealDirIfRelativePathGiven() - { - $path = ''; - $rootDir = __DIR__; - - $expected = realpath($rootDir . DIRECTORY_SEPARATOR . $path); - - $this->assertEquals($expected, $this->object->getRealDir($path, $rootDir)); - } - - /** - * @test - */ - public function shouldGetRealDirIfAbsolutePathGiven() - { - $path = __DIR__; - $rootDir = ''; - - $expected = realpath($path . '/..'); - - $this->assertEquals($expected, $this->object->getRealDir($path, $rootDir)); - } - - // getRealWritingFilePath() - - /** - * @test - */ - public function shouldNotBeRealWritingFilePath() - { - $path = false; - $rootDir = __DIR__; - - $this->assertFalse($this->object->getRealWritingFilePath($path, $rootDir)); - } - - /** - * @test - */ - public function shouldGetRealWritingPathIfRelativePathGiven() - { - $path = 'test.txt'; - $rootDir = __DIR__; - - $expected = $rootDir . DIRECTORY_SEPARATOR . $path; - - $this->assertEquals($expected, $this->object->getRealWritingFilePath($path, $rootDir)); - } - - // isRealPathExist() - - /** - * @test - */ - public function shouldNotExistRealPathIfFalseGiven() - { - $path = false; - - $this->assertFalse($this->object->isRealPathExist($path)); - } - - /** - * @test - */ - public function shouldNotExistRealPath() - { - $path = __DIR__ . '/dummy.dir'; - - $this->assertFalse($this->object->isRealPathExist($path)); - } - - /** - * @test - */ - public function shouldExistRealPath() - { - touch($this->existingFile); - - $this->assertTrue($this->object->isRealPathExist($this->existingFile)); - } - - // isRealFileExist() - - /** - * @test - */ - public function shouldNotExistRealFile() - { - $path = __DIR__ . '/dummy.file'; - - $this->assertFalse($this->object->isRealFileExist($path)); - } - - /** - * @test - */ - public function shouldNotExistRealFileIfDirGiven() - { - $path = __DIR__; - - $this->assertFalse($this->object->isRealFileExist($path)); - } - - /** - * @test - */ - public function shouldExistRealFile() - { - touch($this->existingFile); - - $this->assertTrue($this->object->isRealFileExist($this->existingFile)); - } - - // isRealFileReadable() - - /** - * @test - */ - public function shouldNotBeRealFileReadableIfFileNotFound() - { - $path = __DIR__ . '/dummy.file'; - - $this->assertFalse($this->object->isRealFileReadable($path)); - } - - /** - * @test - */ - public function shouldNotBeRealFileReadableIFFileUnreadable() - { - $this->touchUnreadableFile(); - - $this->assertFalse($this->object->isRealFileReadable($this->unreadablePath)); - } - - /** - * @test - */ - public function shouldBeRealFileReadable() - { - touch($this->existingFile); - - $this->assertTrue($this->object->isRealFileReadable($this->existingFile)); - } - - // isRealFileWritable() - - /** - * @test - */ - public function shouldNotBeRealFileWritableIfFileNotFound() - { - $path = __DIR__ . '/dummy.file'; - - $this->assertFalse($this->object->isRealFileWritable($path)); - } - - /** - * @test - */ - public function shouldNotBeRealFileWritableIfFileUnwritable() - { - $this->touchUnwritableFile(); - - $this->assertFalse($this->object->isRealFileWritable($this->unwritablePath)); - } - - /** - * @test - */ - public function shouldBeRealFileWritable() - { - touch($this->existingFile); - - $this->assertTrue($this->object->isRealFileWritable($this->existingFile)); - } - - // isRealDirExist() - - /** - * @test - */ - public function shouldNotExistRealDir() - { - $path = __DIR__ . '/dummy.dir'; - - $this->assertFalse($this->object->isRealDirExist($path)); - } - - /** - * @test - */ - public function shouldNotExistRealDirIfFileGiven() - { - touch($this->existingFile); - - - $this->assertFalse($this->object->isRealDirExist($this->existingFile)); - } - - /** - * @test - */ - public function shouldExistRealDir() - { - $path = __DIR__; - - $this->assertTrue($this->object->isRealDirExist($path)); - } - - // isRealDirWritable() - - /** - * @test - */ - public function shouldNotBeRealDirWritableIfDirNotFound() - { - $path = __DIR__ . '/dummy.dir'; - - $this->assertFalse($this->object->isRealDirWritable($path)); - } - - /** - * @test - */ - public function shouldNotBeRealDirWritableIfDirUnwritable() - { - $this->mkdirUnwritableDir(); - - $this->assertFalse($this->object->isRealDirWritable($this->unwritableDir)); - } - - /** - * @test - */ - public function shouldBeRealDirWritable() - { - $path = __DIR__; - - $this->assertTrue($this->object->isRealDirWritable($path)); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php deleted file mode 100644 index d3817adcc8..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class ConsoleLoggerTest extends \PHPUnit_Framework_TestCase -{ - protected function createAdapterMockWith($message) - { - $mock = $this->getMockBuilder('Symfony\Component\Console\Output\StreamOutput') - ->disableOriginalConstructor() - ->setMethods(array('writeln')) - ->getMock(); - - $mock - ->expects($this->once()) - ->method('writeln') - ->with($this->equalTo($message)); - - return $mock; - } - - /** - * @test - */ - public function shouldWritelnToOutput() - { - $message = 'log test message'; - $output = $this->createAdapterMockWith($message); - - $object = new ConsoleLogger($output); - - $object->log('info', $message); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php deleted file mode 100644 index df67982ffa..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -class GitCommandTest extends \PHPUnit_Framework_TestCase -{ - protected function createGitCommandMock($params) - { - $class = 'Contrib\Component\System\Git\GitCommand'; - $adapter = $this->getMock($class, array('executeCommand')); - - $adapter - ->expects($this->once()) - ->method('executeCommand') - ->with($this->equalTo($params)); - - return $adapter; - } - - // getCommandPath() - - /** - * @test - */ - public function commandPathIsGit() - { - $object = new GitCommand(); - - $expected = 'git'; - - $this->assertEquals($expected, $object->getCommandPath()); - } - - // getBranches() - - /** - * @test - */ - public function getBranchesExecuteCommand() - { - $expected = 'git branch'; - - $object = $this->createGitCommandMock($expected); - $object->getBranches(); - } - - /** - * @test - */ - public function getBranches() - { - $object = new GitCommand(); - $actual = $object->getBranches(); - - $this->assertTrue(is_array($actual)); - $this->assertNotEmpty($actual); - } - - // getHeadCommit() - - /** - * @test - */ - public function getHeadCommitExecuteCommand() - { - $expected = "git log -1 --pretty=format:'%H\n%aN\n%ae\n%cN\n%ce\n%s'"; - - $object = $this->createGitCommandMock($expected); - $object->getHeadCommit(); - } - - /** - * @test - */ - public function getHeadCommit() - { - $object = new GitCommand(); - $actual = $object->getHeadCommit(); - - $this->assertTrue(is_array($actual)); - $this->assertNotEmpty($actual); - } - - // getRemotes() - - /** - * @test - */ - public function getRemotesExecuteCommand() - { - $expected = 'git remote -v'; - - $object = $this->createGitCommandMock($expected); - $object->getRemotes(); - } - - /** - * @test - */ - public function getRemotes() - { - $object = new GitCommand(); - $actual = $object->getRemotes(); - - $this->assertTrue(is_array($actual)); - $this->assertNotEmpty($actual); - } - - // execute() - - /** - * @test - * @expectedException RuntimeException - */ - public function throwRuntimeExceptionIfExecutedWithoutArgs() - { - // `git` return 1 and cause RuntimeException - $object = new GitCommand(); - $object->execute(); - } - - // createCommand() - - /** - * @test - */ - public function getCommandPath() - { - $object = new GitCommand(); - $object->setCommandPath('ls'); - - $actual = $object->execute(); - - $this->assertTrue(is_array($actual)); - $this->assertNotEmpty($actual); - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/coveralls.yml b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/coveralls.yml deleted file mode 100644 index 143b83fd1c..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -src_dir: files diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/AbstractClass.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/AbstractClass.php deleted file mode 100644 index 8b2292e365..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/AbstractClass.php +++ /dev/null @@ -1,6 +0,0 @@ -message = 'hoge'; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/test2.php b/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/test2.php deleted file mode 100644 index 156ad63da0..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/tests/prj/files/test2.php +++ /dev/null @@ -1,10 +0,0 @@ -message = 'hoge'; - } -} diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/travis.phpunit.xml b/lib/influxdb-php/vendor/satooshi/php-coveralls/travis.phpunit.xml deleted file mode 100644 index 662e96b0a7..0000000000 --- a/lib/influxdb-php/vendor/satooshi/php-coveralls/travis.phpunit.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ./tests/ - - - - - - ./src - - ./vendor - ./tests - ./travis - ./composer - - - - - - - - - diff --git a/lib/influxdb-php/vendor/satooshi/php-coveralls/travis/empty b/lib/influxdb-php/vendor/satooshi/php-coveralls/travis/empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/influxdb-php/vendor/symfony/config b/lib/influxdb-php/vendor/symfony/config deleted file mode 160000 index 358ec929e4..0000000000 --- a/lib/influxdb-php/vendor/symfony/config +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 358ec929e494b6f12d8508d88357cbd7383a10ca diff --git a/lib/influxdb-php/vendor/symfony/console b/lib/influxdb-php/vendor/symfony/console deleted file mode 160000 index fd85e7517e..0000000000 --- a/lib/influxdb-php/vendor/symfony/console +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd85e7517e79a2bceafcee8f7e8b7bbd0919a90a diff --git a/lib/influxdb-php/vendor/symfony/event-dispatcher b/lib/influxdb-php/vendor/symfony/event-dispatcher deleted file mode 160000 index d7246885b7..0000000000 --- a/lib/influxdb-php/vendor/symfony/event-dispatcher +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d7246885b7fe4cb5a2786bda34362d2f0e40b730 diff --git a/lib/influxdb-php/vendor/symfony/filesystem b/lib/influxdb-php/vendor/symfony/filesystem deleted file mode 160000 index 9f70c5625a..0000000000 --- a/lib/influxdb-php/vendor/symfony/filesystem +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f70c5625a32b2f1e6fc37222f52b4e0eb437b0e diff --git a/lib/influxdb-php/vendor/symfony/stopwatch b/lib/influxdb-php/vendor/symfony/stopwatch deleted file mode 160000 index cd5f0dc1d3..0000000000 --- a/lib/influxdb-php/vendor/symfony/stopwatch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cd5f0dc1d3d0e2c83461dad77e20a9186beb6146 diff --git a/lib/influxdb-php/vendor/symfony/yaml b/lib/influxdb-php/vendor/symfony/yaml deleted file mode 160000 index 000e7fc265..0000000000 --- a/lib/influxdb-php/vendor/symfony/yaml +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 000e7fc2653335cd42c6d21405dac1c74224a387