├── .gitignore ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml ├── src ├── Client.php ├── Exception │ ├── NotImplementedException.php │ └── QueryException.php ├── Query │ ├── Builder.php │ ├── ExecuteQuery.php │ ├── Grammar.php │ ├── InsertQuery.php │ ├── Query.php │ ├── QueryInterface.php │ └── SelectQuery.php ├── Settings.php ├── Statement.php ├── System.php └── Transport │ ├── Http.php │ └── TransportInterface.php └── tests └── ClientTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP Client for ClickHouse columnar DBMS 2 | https://clickhouse.yandex 3 | 4 | 5 | ## Документация 6 | https://clickhouse.readme.io/ 7 | 8 | ## Создание клиента 9 | 10 | $client = new \ClickHouse\Client('http://127.0.0.1', 8123); 11 | 12 | 13 | ## Проверка сервера 14 | 15 | $bool = $client->ping(); 16 | 17 | ## Выполнить SELECT запрос 18 | 19 | $client->select($sql, $params); 20 | 21 | $sql - строка с sql запросом 22 | $params - массив для биндинга параметров 23 | 24 | Возвращает объект типа Statement 25 | 26 | ### интерфейс Statement 27 | 28 | getRawResult возвращает данные в сыром виде, так как их вернул сервер. 29 | 30 | getResult возвращает данные в виде объекта stdClass 31 | 32 | getMeta возвращает метаданные. типы столбцов и тд 33 | 34 | getTotals - тотальные значения (при использовании WITH TOTALS в запросе). 35 | 36 | getExtremes - экстремальные значения (при настройке extremes, выставленной в 1). 37 | 38 | getRows - общее количество выведенных строчек. 39 | 40 | getRowsBeforeLimitAtLeast - не менее скольких строчек получилось бы, если бы не было LIMIT-а. Выводится только если запрос содержит LIMIT. 41 | 42 | fetchAll - возвращает массив со всеми строками 43 | 44 | fetchOne - возвращает первую строку 45 | 46 | fetchColumn - возвращает значение указанного столбца 47 | 48 | ## Выполнить INSERT запрос 49 | 50 | $client->insert($table, $columns = [], $values); 51 | 52 | ## Выполнить BATCH INSERT запрос 53 | 54 | ## Выполнить ALTER/CREATE/DROP запросы 55 | 56 | $client->execute($sql); 57 | 58 | ## Системные запросы 59 | 60 | ### tables 61 | 62 | Информация о таблицах, содержит столбцы database, name, engine типа String. 63 | 64 | $client->system()->tables(); 65 | 66 | ### databases 67 | 68 | Информация о базах 69 | 70 | $client->system()->databases(); 71 | 72 | 73 | ### clusters 74 | 75 | информация о доступных в конфигурационном файле кластерах и серверах, которые в них входят. 76 | 77 | $client->system()->clusters(); 78 | 79 | 80 | ### остальное скоро будет здесь 81 | 82 | 83 | ## Настройки 84 | 85 | $client->settings()->max_memory_usage; //получить значение настроки 86 | 87 | $client->settings()->max_memory_usage = 10G; //изменить настройку для текущий сессии 88 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "8bitov/clickhouse-php-client", 3 | "license": "MIT", 4 | "version" : "0.0.3", 5 | "keywords": ["clickhouse", "driver", "client", "http"], 6 | "homepage": "https://github.com/8bitov/doctrine2-clickhouse", 7 | "authors": [ 8 | { 9 | "name": "Aleksey Kuznetsov" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.5.0", 14 | "guzzlehttp/guzzle": "~6.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "~5.4.6", 18 | "mockery/mockery": "~0.9", 19 | "satooshi/php-coveralls": "~1.0", 20 | "fzaninotto/faker": "^1.6" 21 | }, 22 | "autoload": { 23 | "psr-4": { 24 | "ClickHouse\\": "src/" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "9a8cc9073a0c3b1365b3b21067697fc9", 8 | "content-hash": "0d9ad4dad80b949ac6c41123933a9369", 9 | "packages": [ 10 | { 11 | "name": "guzzlehttp/guzzle", 12 | "version": "6.2.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/guzzle/guzzle.git", 16 | "reference": "d094e337976dff9d8e2424e8485872194e768662" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", 21 | "reference": "d094e337976dff9d8e2424e8485872194e768662", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "guzzlehttp/promises": "~1.0", 26 | "guzzlehttp/psr7": "~1.1", 27 | "php": ">=5.5.0" 28 | }, 29 | "require-dev": { 30 | "ext-curl": "*", 31 | "phpunit/phpunit": "~4.0", 32 | "psr/log": "~1.0" 33 | }, 34 | "type": "library", 35 | "extra": { 36 | "branch-alias": { 37 | "dev-master": "6.2-dev" 38 | } 39 | }, 40 | "autoload": { 41 | "files": [ 42 | "src/functions_include.php" 43 | ], 44 | "psr-4": { 45 | "GuzzleHttp\\": "src/" 46 | } 47 | }, 48 | "notification-url": "https://packagist.org/downloads/", 49 | "license": [ 50 | "MIT" 51 | ], 52 | "authors": [ 53 | { 54 | "name": "Michael Dowling", 55 | "email": "mtdowling@gmail.com", 56 | "homepage": "https://github.com/mtdowling" 57 | } 58 | ], 59 | "description": "Guzzle is a PHP HTTP client library", 60 | "homepage": "http://guzzlephp.org/", 61 | "keywords": [ 62 | "client", 63 | "curl", 64 | "framework", 65 | "http", 66 | "http client", 67 | "rest", 68 | "web service" 69 | ], 70 | "time": "2016-03-21 20:02:09" 71 | }, 72 | { 73 | "name": "guzzlehttp/promises", 74 | "version": "1.2.0", 75 | "source": { 76 | "type": "git", 77 | "url": "https://github.com/guzzle/promises.git", 78 | "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" 79 | }, 80 | "dist": { 81 | "type": "zip", 82 | "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", 83 | "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", 84 | "shasum": "" 85 | }, 86 | "require": { 87 | "php": ">=5.5.0" 88 | }, 89 | "require-dev": { 90 | "phpunit/phpunit": "~4.0" 91 | }, 92 | "type": "library", 93 | "extra": { 94 | "branch-alias": { 95 | "dev-master": "1.0-dev" 96 | } 97 | }, 98 | "autoload": { 99 | "psr-4": { 100 | "GuzzleHttp\\Promise\\": "src/" 101 | }, 102 | "files": [ 103 | "src/functions_include.php" 104 | ] 105 | }, 106 | "notification-url": "https://packagist.org/downloads/", 107 | "license": [ 108 | "MIT" 109 | ], 110 | "authors": [ 111 | { 112 | "name": "Michael Dowling", 113 | "email": "mtdowling@gmail.com", 114 | "homepage": "https://github.com/mtdowling" 115 | } 116 | ], 117 | "description": "Guzzle promises library", 118 | "keywords": [ 119 | "promise" 120 | ], 121 | "time": "2016-05-18 16:56:05" 122 | }, 123 | { 124 | "name": "guzzlehttp/psr7", 125 | "version": "1.3.1", 126 | "source": { 127 | "type": "git", 128 | "url": "https://github.com/guzzle/psr7.git", 129 | "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" 130 | }, 131 | "dist": { 132 | "type": "zip", 133 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", 134 | "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", 135 | "shasum": "" 136 | }, 137 | "require": { 138 | "php": ">=5.4.0", 139 | "psr/http-message": "~1.0" 140 | }, 141 | "provide": { 142 | "psr/http-message-implementation": "1.0" 143 | }, 144 | "require-dev": { 145 | "phpunit/phpunit": "~4.0" 146 | }, 147 | "type": "library", 148 | "extra": { 149 | "branch-alias": { 150 | "dev-master": "1.4-dev" 151 | } 152 | }, 153 | "autoload": { 154 | "psr-4": { 155 | "GuzzleHttp\\Psr7\\": "src/" 156 | }, 157 | "files": [ 158 | "src/functions_include.php" 159 | ] 160 | }, 161 | "notification-url": "https://packagist.org/downloads/", 162 | "license": [ 163 | "MIT" 164 | ], 165 | "authors": [ 166 | { 167 | "name": "Michael Dowling", 168 | "email": "mtdowling@gmail.com", 169 | "homepage": "https://github.com/mtdowling" 170 | } 171 | ], 172 | "description": "PSR-7 message implementation", 173 | "keywords": [ 174 | "http", 175 | "message", 176 | "stream", 177 | "uri" 178 | ], 179 | "time": "2016-06-24 23:00:38" 180 | }, 181 | { 182 | "name": "psr/http-message", 183 | "version": "1.0", 184 | "source": { 185 | "type": "git", 186 | "url": "https://github.com/php-fig/http-message.git", 187 | "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" 188 | }, 189 | "dist": { 190 | "type": "zip", 191 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", 192 | "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", 193 | "shasum": "" 194 | }, 195 | "require": { 196 | "php": ">=5.3.0" 197 | }, 198 | "type": "library", 199 | "extra": { 200 | "branch-alias": { 201 | "dev-master": "1.0.x-dev" 202 | } 203 | }, 204 | "autoload": { 205 | "psr-4": { 206 | "Psr\\Http\\Message\\": "src/" 207 | } 208 | }, 209 | "notification-url": "https://packagist.org/downloads/", 210 | "license": [ 211 | "MIT" 212 | ], 213 | "authors": [ 214 | { 215 | "name": "PHP-FIG", 216 | "homepage": "http://www.php-fig.org/" 217 | } 218 | ], 219 | "description": "Common interface for HTTP messages", 220 | "keywords": [ 221 | "http", 222 | "http-message", 223 | "psr", 224 | "psr-7", 225 | "request", 226 | "response" 227 | ], 228 | "time": "2015-05-04 20:22:00" 229 | } 230 | ], 231 | "packages-dev": [ 232 | { 233 | "name": "doctrine/instantiator", 234 | "version": "1.0.5", 235 | "source": { 236 | "type": "git", 237 | "url": "https://github.com/doctrine/instantiator.git", 238 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 239 | }, 240 | "dist": { 241 | "type": "zip", 242 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 243 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 244 | "shasum": "" 245 | }, 246 | "require": { 247 | "php": ">=5.3,<8.0-DEV" 248 | }, 249 | "require-dev": { 250 | "athletic/athletic": "~0.1.8", 251 | "ext-pdo": "*", 252 | "ext-phar": "*", 253 | "phpunit/phpunit": "~4.0", 254 | "squizlabs/php_codesniffer": "~2.0" 255 | }, 256 | "type": "library", 257 | "extra": { 258 | "branch-alias": { 259 | "dev-master": "1.0.x-dev" 260 | } 261 | }, 262 | "autoload": { 263 | "psr-4": { 264 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 265 | } 266 | }, 267 | "notification-url": "https://packagist.org/downloads/", 268 | "license": [ 269 | "MIT" 270 | ], 271 | "authors": [ 272 | { 273 | "name": "Marco Pivetta", 274 | "email": "ocramius@gmail.com", 275 | "homepage": "http://ocramius.github.com/" 276 | } 277 | ], 278 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 279 | "homepage": "https://github.com/doctrine/instantiator", 280 | "keywords": [ 281 | "constructor", 282 | "instantiate" 283 | ], 284 | "time": "2015-06-14 21:17:01" 285 | }, 286 | { 287 | "name": "fzaninotto/faker", 288 | "version": "v1.6.0", 289 | "source": { 290 | "type": "git", 291 | "url": "https://github.com/fzaninotto/Faker.git", 292 | "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" 293 | }, 294 | "dist": { 295 | "type": "zip", 296 | "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", 297 | "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", 298 | "shasum": "" 299 | }, 300 | "require": { 301 | "php": "^5.3.3|^7.0" 302 | }, 303 | "require-dev": { 304 | "ext-intl": "*", 305 | "phpunit/phpunit": "~4.0", 306 | "squizlabs/php_codesniffer": "~1.5" 307 | }, 308 | "type": "library", 309 | "extra": { 310 | "branch-alias": [] 311 | }, 312 | "autoload": { 313 | "psr-4": { 314 | "Faker\\": "src/Faker/" 315 | } 316 | }, 317 | "notification-url": "https://packagist.org/downloads/", 318 | "license": [ 319 | "MIT" 320 | ], 321 | "authors": [ 322 | { 323 | "name": "François Zaninotto" 324 | } 325 | ], 326 | "description": "Faker is a PHP library that generates fake data for you.", 327 | "keywords": [ 328 | "data", 329 | "faker", 330 | "fixtures" 331 | ], 332 | "time": "2016-04-29 12:21:54" 333 | }, 334 | { 335 | "name": "guzzle/guzzle", 336 | "version": "v3.9.3", 337 | "source": { 338 | "type": "git", 339 | "url": "https://github.com/guzzle/guzzle3.git", 340 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" 341 | }, 342 | "dist": { 343 | "type": "zip", 344 | "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", 345 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", 346 | "shasum": "" 347 | }, 348 | "require": { 349 | "ext-curl": "*", 350 | "php": ">=5.3.3", 351 | "symfony/event-dispatcher": "~2.1" 352 | }, 353 | "replace": { 354 | "guzzle/batch": "self.version", 355 | "guzzle/cache": "self.version", 356 | "guzzle/common": "self.version", 357 | "guzzle/http": "self.version", 358 | "guzzle/inflection": "self.version", 359 | "guzzle/iterator": "self.version", 360 | "guzzle/log": "self.version", 361 | "guzzle/parser": "self.version", 362 | "guzzle/plugin": "self.version", 363 | "guzzle/plugin-async": "self.version", 364 | "guzzle/plugin-backoff": "self.version", 365 | "guzzle/plugin-cache": "self.version", 366 | "guzzle/plugin-cookie": "self.version", 367 | "guzzle/plugin-curlauth": "self.version", 368 | "guzzle/plugin-error-response": "self.version", 369 | "guzzle/plugin-history": "self.version", 370 | "guzzle/plugin-log": "self.version", 371 | "guzzle/plugin-md5": "self.version", 372 | "guzzle/plugin-mock": "self.version", 373 | "guzzle/plugin-oauth": "self.version", 374 | "guzzle/service": "self.version", 375 | "guzzle/stream": "self.version" 376 | }, 377 | "require-dev": { 378 | "doctrine/cache": "~1.3", 379 | "monolog/monolog": "~1.0", 380 | "phpunit/phpunit": "3.7.*", 381 | "psr/log": "~1.0", 382 | "symfony/class-loader": "~2.1", 383 | "zendframework/zend-cache": "2.*,<2.3", 384 | "zendframework/zend-log": "2.*,<2.3" 385 | }, 386 | "suggest": { 387 | "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." 388 | }, 389 | "type": "library", 390 | "extra": { 391 | "branch-alias": { 392 | "dev-master": "3.9-dev" 393 | } 394 | }, 395 | "autoload": { 396 | "psr-0": { 397 | "Guzzle": "src/", 398 | "Guzzle\\Tests": "tests/" 399 | } 400 | }, 401 | "notification-url": "https://packagist.org/downloads/", 402 | "license": [ 403 | "MIT" 404 | ], 405 | "authors": [ 406 | { 407 | "name": "Michael Dowling", 408 | "email": "mtdowling@gmail.com", 409 | "homepage": "https://github.com/mtdowling" 410 | }, 411 | { 412 | "name": "Guzzle Community", 413 | "homepage": "https://github.com/guzzle/guzzle/contributors" 414 | } 415 | ], 416 | "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", 417 | "homepage": "http://guzzlephp.org/", 418 | "keywords": [ 419 | "client", 420 | "curl", 421 | "framework", 422 | "http", 423 | "http client", 424 | "rest", 425 | "web service" 426 | ], 427 | "time": "2015-03-18 18:23:50" 428 | }, 429 | { 430 | "name": "hamcrest/hamcrest-php", 431 | "version": "v1.2.2", 432 | "source": { 433 | "type": "git", 434 | "url": "https://github.com/hamcrest/hamcrest-php.git", 435 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" 436 | }, 437 | "dist": { 438 | "type": "zip", 439 | "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", 440 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", 441 | "shasum": "" 442 | }, 443 | "require": { 444 | "php": ">=5.3.2" 445 | }, 446 | "replace": { 447 | "cordoval/hamcrest-php": "*", 448 | "davedevelopment/hamcrest-php": "*", 449 | "kodova/hamcrest-php": "*" 450 | }, 451 | "require-dev": { 452 | "phpunit/php-file-iterator": "1.3.3", 453 | "satooshi/php-coveralls": "dev-master" 454 | }, 455 | "type": "library", 456 | "autoload": { 457 | "classmap": [ 458 | "hamcrest" 459 | ], 460 | "files": [ 461 | "hamcrest/Hamcrest.php" 462 | ] 463 | }, 464 | "notification-url": "https://packagist.org/downloads/", 465 | "license": [ 466 | "BSD" 467 | ], 468 | "description": "This is the PHP port of Hamcrest Matchers", 469 | "keywords": [ 470 | "test" 471 | ], 472 | "time": "2015-05-11 14:41:42" 473 | }, 474 | { 475 | "name": "mockery/mockery", 476 | "version": "0.9.5", 477 | "source": { 478 | "type": "git", 479 | "url": "https://github.com/padraic/mockery.git", 480 | "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" 481 | }, 482 | "dist": { 483 | "type": "zip", 484 | "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", 485 | "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", 486 | "shasum": "" 487 | }, 488 | "require": { 489 | "hamcrest/hamcrest-php": "~1.1", 490 | "lib-pcre": ">=7.0", 491 | "php": ">=5.3.2" 492 | }, 493 | "require-dev": { 494 | "phpunit/phpunit": "~4.0" 495 | }, 496 | "type": "library", 497 | "extra": { 498 | "branch-alias": { 499 | "dev-master": "0.9.x-dev" 500 | } 501 | }, 502 | "autoload": { 503 | "psr-0": { 504 | "Mockery": "library/" 505 | } 506 | }, 507 | "notification-url": "https://packagist.org/downloads/", 508 | "license": [ 509 | "BSD-3-Clause" 510 | ], 511 | "authors": [ 512 | { 513 | "name": "Pádraic Brady", 514 | "email": "padraic.brady@gmail.com", 515 | "homepage": "http://blog.astrumfutura.com" 516 | }, 517 | { 518 | "name": "Dave Marshall", 519 | "email": "dave.marshall@atstsolutions.co.uk", 520 | "homepage": "http://davedevelopment.co.uk" 521 | } 522 | ], 523 | "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", 524 | "homepage": "http://github.com/padraic/mockery", 525 | "keywords": [ 526 | "BDD", 527 | "TDD", 528 | "library", 529 | "mock", 530 | "mock objects", 531 | "mockery", 532 | "stub", 533 | "test", 534 | "test double", 535 | "testing" 536 | ], 537 | "time": "2016-05-22 21:52:33" 538 | }, 539 | { 540 | "name": "myclabs/deep-copy", 541 | "version": "1.5.1", 542 | "source": { 543 | "type": "git", 544 | "url": "https://github.com/myclabs/DeepCopy.git", 545 | "reference": "a8773992b362b58498eed24bf85005f363c34771" 546 | }, 547 | "dist": { 548 | "type": "zip", 549 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", 550 | "reference": "a8773992b362b58498eed24bf85005f363c34771", 551 | "shasum": "" 552 | }, 553 | "require": { 554 | "php": ">=5.4.0" 555 | }, 556 | "require-dev": { 557 | "doctrine/collections": "1.*", 558 | "phpunit/phpunit": "~4.1" 559 | }, 560 | "type": "library", 561 | "autoload": { 562 | "psr-4": { 563 | "DeepCopy\\": "src/DeepCopy/" 564 | } 565 | }, 566 | "notification-url": "https://packagist.org/downloads/", 567 | "license": [ 568 | "MIT" 569 | ], 570 | "description": "Create deep copies (clones) of your objects", 571 | "homepage": "https://github.com/myclabs/DeepCopy", 572 | "keywords": [ 573 | "clone", 574 | "copy", 575 | "duplicate", 576 | "object", 577 | "object graph" 578 | ], 579 | "time": "2015-11-20 12:04:31" 580 | }, 581 | { 582 | "name": "phpdocumentor/reflection-common", 583 | "version": "1.0", 584 | "source": { 585 | "type": "git", 586 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 587 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" 588 | }, 589 | "dist": { 590 | "type": "zip", 591 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 592 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 593 | "shasum": "" 594 | }, 595 | "require": { 596 | "php": ">=5.5" 597 | }, 598 | "require-dev": { 599 | "phpunit/phpunit": "^4.6" 600 | }, 601 | "type": "library", 602 | "extra": { 603 | "branch-alias": { 604 | "dev-master": "1.0.x-dev" 605 | } 606 | }, 607 | "autoload": { 608 | "psr-4": { 609 | "phpDocumentor\\Reflection\\": [ 610 | "src" 611 | ] 612 | } 613 | }, 614 | "notification-url": "https://packagist.org/downloads/", 615 | "license": [ 616 | "MIT" 617 | ], 618 | "authors": [ 619 | { 620 | "name": "Jaap van Otterdijk", 621 | "email": "opensource@ijaap.nl" 622 | } 623 | ], 624 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 625 | "homepage": "http://www.phpdoc.org", 626 | "keywords": [ 627 | "FQSEN", 628 | "phpDocumentor", 629 | "phpdoc", 630 | "reflection", 631 | "static analysis" 632 | ], 633 | "time": "2015-12-27 11:43:31" 634 | }, 635 | { 636 | "name": "phpdocumentor/reflection-docblock", 637 | "version": "3.1.0", 638 | "source": { 639 | "type": "git", 640 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 641 | "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" 642 | }, 643 | "dist": { 644 | "type": "zip", 645 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", 646 | "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", 647 | "shasum": "" 648 | }, 649 | "require": { 650 | "php": ">=5.5", 651 | "phpdocumentor/reflection-common": "^1.0@dev", 652 | "phpdocumentor/type-resolver": "^0.2.0", 653 | "webmozart/assert": "^1.0" 654 | }, 655 | "require-dev": { 656 | "mockery/mockery": "^0.9.4", 657 | "phpunit/phpunit": "^4.4" 658 | }, 659 | "type": "library", 660 | "autoload": { 661 | "psr-4": { 662 | "phpDocumentor\\Reflection\\": [ 663 | "src/" 664 | ] 665 | } 666 | }, 667 | "notification-url": "https://packagist.org/downloads/", 668 | "license": [ 669 | "MIT" 670 | ], 671 | "authors": [ 672 | { 673 | "name": "Mike van Riel", 674 | "email": "me@mikevanriel.com" 675 | } 676 | ], 677 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 678 | "time": "2016-06-10 09:48:41" 679 | }, 680 | { 681 | "name": "phpdocumentor/type-resolver", 682 | "version": "0.2", 683 | "source": { 684 | "type": "git", 685 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 686 | "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" 687 | }, 688 | "dist": { 689 | "type": "zip", 690 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", 691 | "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", 692 | "shasum": "" 693 | }, 694 | "require": { 695 | "php": ">=5.5", 696 | "phpdocumentor/reflection-common": "^1.0" 697 | }, 698 | "require-dev": { 699 | "mockery/mockery": "^0.9.4", 700 | "phpunit/phpunit": "^5.2||^4.8.24" 701 | }, 702 | "type": "library", 703 | "extra": { 704 | "branch-alias": { 705 | "dev-master": "1.0.x-dev" 706 | } 707 | }, 708 | "autoload": { 709 | "psr-4": { 710 | "phpDocumentor\\Reflection\\": [ 711 | "src/" 712 | ] 713 | } 714 | }, 715 | "notification-url": "https://packagist.org/downloads/", 716 | "license": [ 717 | "MIT" 718 | ], 719 | "authors": [ 720 | { 721 | "name": "Mike van Riel", 722 | "email": "me@mikevanriel.com" 723 | } 724 | ], 725 | "time": "2016-06-10 07:14:17" 726 | }, 727 | { 728 | "name": "phpspec/prophecy", 729 | "version": "v1.6.1", 730 | "source": { 731 | "type": "git", 732 | "url": "https://github.com/phpspec/prophecy.git", 733 | "reference": "58a8137754bc24b25740d4281399a4a3596058e0" 734 | }, 735 | "dist": { 736 | "type": "zip", 737 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", 738 | "reference": "58a8137754bc24b25740d4281399a4a3596058e0", 739 | "shasum": "" 740 | }, 741 | "require": { 742 | "doctrine/instantiator": "^1.0.2", 743 | "php": "^5.3|^7.0", 744 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", 745 | "sebastian/comparator": "^1.1", 746 | "sebastian/recursion-context": "^1.0" 747 | }, 748 | "require-dev": { 749 | "phpspec/phpspec": "^2.0" 750 | }, 751 | "type": "library", 752 | "extra": { 753 | "branch-alias": { 754 | "dev-master": "1.6.x-dev" 755 | } 756 | }, 757 | "autoload": { 758 | "psr-0": { 759 | "Prophecy\\": "src/" 760 | } 761 | }, 762 | "notification-url": "https://packagist.org/downloads/", 763 | "license": [ 764 | "MIT" 765 | ], 766 | "authors": [ 767 | { 768 | "name": "Konstantin Kudryashov", 769 | "email": "ever.zet@gmail.com", 770 | "homepage": "http://everzet.com" 771 | }, 772 | { 773 | "name": "Marcello Duarte", 774 | "email": "marcello.duarte@gmail.com" 775 | } 776 | ], 777 | "description": "Highly opinionated mocking framework for PHP 5.3+", 778 | "homepage": "https://github.com/phpspec/prophecy", 779 | "keywords": [ 780 | "Double", 781 | "Dummy", 782 | "fake", 783 | "mock", 784 | "spy", 785 | "stub" 786 | ], 787 | "time": "2016-06-07 08:13:47" 788 | }, 789 | { 790 | "name": "phpunit/php-code-coverage", 791 | "version": "4.0.0", 792 | "source": { 793 | "type": "git", 794 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 795 | "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" 796 | }, 797 | "dist": { 798 | "type": "zip", 799 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", 800 | "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", 801 | "shasum": "" 802 | }, 803 | "require": { 804 | "php": "^5.6 || ^7.0", 805 | "phpunit/php-file-iterator": "~1.3", 806 | "phpunit/php-text-template": "~1.2", 807 | "phpunit/php-token-stream": "^1.4.2", 808 | "sebastian/code-unit-reverse-lookup": "~1.0", 809 | "sebastian/environment": "^1.3.2", 810 | "sebastian/version": "~1.0|~2.0" 811 | }, 812 | "require-dev": { 813 | "ext-xdebug": ">=2.1.4", 814 | "phpunit/phpunit": "^5.4" 815 | }, 816 | "suggest": { 817 | "ext-dom": "*", 818 | "ext-xdebug": ">=2.4.0", 819 | "ext-xmlwriter": "*" 820 | }, 821 | "type": "library", 822 | "extra": { 823 | "branch-alias": { 824 | "dev-master": "4.0.x-dev" 825 | } 826 | }, 827 | "autoload": { 828 | "classmap": [ 829 | "src/" 830 | ] 831 | }, 832 | "notification-url": "https://packagist.org/downloads/", 833 | "license": [ 834 | "BSD-3-Clause" 835 | ], 836 | "authors": [ 837 | { 838 | "name": "Sebastian Bergmann", 839 | "email": "sb@sebastian-bergmann.de", 840 | "role": "lead" 841 | } 842 | ], 843 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 844 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 845 | "keywords": [ 846 | "coverage", 847 | "testing", 848 | "xunit" 849 | ], 850 | "time": "2016-06-03 05:03:56" 851 | }, 852 | { 853 | "name": "phpunit/php-file-iterator", 854 | "version": "1.4.1", 855 | "source": { 856 | "type": "git", 857 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 858 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" 859 | }, 860 | "dist": { 861 | "type": "zip", 862 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 863 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 864 | "shasum": "" 865 | }, 866 | "require": { 867 | "php": ">=5.3.3" 868 | }, 869 | "type": "library", 870 | "extra": { 871 | "branch-alias": { 872 | "dev-master": "1.4.x-dev" 873 | } 874 | }, 875 | "autoload": { 876 | "classmap": [ 877 | "src/" 878 | ] 879 | }, 880 | "notification-url": "https://packagist.org/downloads/", 881 | "license": [ 882 | "BSD-3-Clause" 883 | ], 884 | "authors": [ 885 | { 886 | "name": "Sebastian Bergmann", 887 | "email": "sb@sebastian-bergmann.de", 888 | "role": "lead" 889 | } 890 | ], 891 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 892 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 893 | "keywords": [ 894 | "filesystem", 895 | "iterator" 896 | ], 897 | "time": "2015-06-21 13:08:43" 898 | }, 899 | { 900 | "name": "phpunit/php-text-template", 901 | "version": "1.2.1", 902 | "source": { 903 | "type": "git", 904 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 905 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 906 | }, 907 | "dist": { 908 | "type": "zip", 909 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 910 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 911 | "shasum": "" 912 | }, 913 | "require": { 914 | "php": ">=5.3.3" 915 | }, 916 | "type": "library", 917 | "autoload": { 918 | "classmap": [ 919 | "src/" 920 | ] 921 | }, 922 | "notification-url": "https://packagist.org/downloads/", 923 | "license": [ 924 | "BSD-3-Clause" 925 | ], 926 | "authors": [ 927 | { 928 | "name": "Sebastian Bergmann", 929 | "email": "sebastian@phpunit.de", 930 | "role": "lead" 931 | } 932 | ], 933 | "description": "Simple template engine.", 934 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 935 | "keywords": [ 936 | "template" 937 | ], 938 | "time": "2015-06-21 13:50:34" 939 | }, 940 | { 941 | "name": "phpunit/php-timer", 942 | "version": "1.0.8", 943 | "source": { 944 | "type": "git", 945 | "url": "https://github.com/sebastianbergmann/php-timer.git", 946 | "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" 947 | }, 948 | "dist": { 949 | "type": "zip", 950 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", 951 | "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", 952 | "shasum": "" 953 | }, 954 | "require": { 955 | "php": ">=5.3.3" 956 | }, 957 | "require-dev": { 958 | "phpunit/phpunit": "~4|~5" 959 | }, 960 | "type": "library", 961 | "autoload": { 962 | "classmap": [ 963 | "src/" 964 | ] 965 | }, 966 | "notification-url": "https://packagist.org/downloads/", 967 | "license": [ 968 | "BSD-3-Clause" 969 | ], 970 | "authors": [ 971 | { 972 | "name": "Sebastian Bergmann", 973 | "email": "sb@sebastian-bergmann.de", 974 | "role": "lead" 975 | } 976 | ], 977 | "description": "Utility class for timing", 978 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 979 | "keywords": [ 980 | "timer" 981 | ], 982 | "time": "2016-05-12 18:03:57" 983 | }, 984 | { 985 | "name": "phpunit/php-token-stream", 986 | "version": "1.4.8", 987 | "source": { 988 | "type": "git", 989 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 990 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" 991 | }, 992 | "dist": { 993 | "type": "zip", 994 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", 995 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", 996 | "shasum": "" 997 | }, 998 | "require": { 999 | "ext-tokenizer": "*", 1000 | "php": ">=5.3.3" 1001 | }, 1002 | "require-dev": { 1003 | "phpunit/phpunit": "~4.2" 1004 | }, 1005 | "type": "library", 1006 | "extra": { 1007 | "branch-alias": { 1008 | "dev-master": "1.4-dev" 1009 | } 1010 | }, 1011 | "autoload": { 1012 | "classmap": [ 1013 | "src/" 1014 | ] 1015 | }, 1016 | "notification-url": "https://packagist.org/downloads/", 1017 | "license": [ 1018 | "BSD-3-Clause" 1019 | ], 1020 | "authors": [ 1021 | { 1022 | "name": "Sebastian Bergmann", 1023 | "email": "sebastian@phpunit.de" 1024 | } 1025 | ], 1026 | "description": "Wrapper around PHP's tokenizer extension.", 1027 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 1028 | "keywords": [ 1029 | "tokenizer" 1030 | ], 1031 | "time": "2015-09-15 10:49:45" 1032 | }, 1033 | { 1034 | "name": "phpunit/phpunit", 1035 | "version": "5.4.6", 1036 | "source": { 1037 | "type": "git", 1038 | "url": "https://github.com/sebastianbergmann/phpunit.git", 1039 | "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" 1040 | }, 1041 | "dist": { 1042 | "type": "zip", 1043 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", 1044 | "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", 1045 | "shasum": "" 1046 | }, 1047 | "require": { 1048 | "ext-dom": "*", 1049 | "ext-json": "*", 1050 | "ext-pcre": "*", 1051 | "ext-reflection": "*", 1052 | "ext-spl": "*", 1053 | "myclabs/deep-copy": "~1.3", 1054 | "php": "^5.6 || ^7.0", 1055 | "phpspec/prophecy": "^1.3.1", 1056 | "phpunit/php-code-coverage": "^4.0", 1057 | "phpunit/php-file-iterator": "~1.4", 1058 | "phpunit/php-text-template": "~1.2", 1059 | "phpunit/php-timer": "^1.0.6", 1060 | "phpunit/phpunit-mock-objects": "^3.2", 1061 | "sebastian/comparator": "~1.1", 1062 | "sebastian/diff": "~1.2", 1063 | "sebastian/environment": "^1.3 || ^2.0", 1064 | "sebastian/exporter": "~1.2", 1065 | "sebastian/global-state": "~1.0", 1066 | "sebastian/object-enumerator": "~1.0", 1067 | "sebastian/resource-operations": "~1.0", 1068 | "sebastian/version": "~1.0|~2.0", 1069 | "symfony/yaml": "~2.1|~3.0" 1070 | }, 1071 | "conflict": { 1072 | "phpdocumentor/reflection-docblock": "3.0.2" 1073 | }, 1074 | "suggest": { 1075 | "phpunit/php-invoker": "~1.1" 1076 | }, 1077 | "bin": [ 1078 | "phpunit" 1079 | ], 1080 | "type": "library", 1081 | "extra": { 1082 | "branch-alias": { 1083 | "dev-master": "5.4.x-dev" 1084 | } 1085 | }, 1086 | "autoload": { 1087 | "classmap": [ 1088 | "src/" 1089 | ] 1090 | }, 1091 | "notification-url": "https://packagist.org/downloads/", 1092 | "license": [ 1093 | "BSD-3-Clause" 1094 | ], 1095 | "authors": [ 1096 | { 1097 | "name": "Sebastian Bergmann", 1098 | "email": "sebastian@phpunit.de", 1099 | "role": "lead" 1100 | } 1101 | ], 1102 | "description": "The PHP Unit Testing framework.", 1103 | "homepage": "https://phpunit.de/", 1104 | "keywords": [ 1105 | "phpunit", 1106 | "testing", 1107 | "xunit" 1108 | ], 1109 | "time": "2016-06-16 06:01:15" 1110 | }, 1111 | { 1112 | "name": "phpunit/phpunit-mock-objects", 1113 | "version": "3.2.3", 1114 | "source": { 1115 | "type": "git", 1116 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 1117 | "reference": "b13d0d9426ced06958bd32104653526a6c998a52" 1118 | }, 1119 | "dist": { 1120 | "type": "zip", 1121 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", 1122 | "reference": "b13d0d9426ced06958bd32104653526a6c998a52", 1123 | "shasum": "" 1124 | }, 1125 | "require": { 1126 | "doctrine/instantiator": "^1.0.2", 1127 | "php": "^5.6 || ^7.0", 1128 | "phpunit/php-text-template": "^1.2", 1129 | "sebastian/exporter": "^1.2" 1130 | }, 1131 | "conflict": { 1132 | "phpunit/phpunit": "<5.4.0" 1133 | }, 1134 | "require-dev": { 1135 | "phpunit/phpunit": "^5.4" 1136 | }, 1137 | "suggest": { 1138 | "ext-soap": "*" 1139 | }, 1140 | "type": "library", 1141 | "extra": { 1142 | "branch-alias": { 1143 | "dev-master": "3.2.x-dev" 1144 | } 1145 | }, 1146 | "autoload": { 1147 | "classmap": [ 1148 | "src/" 1149 | ] 1150 | }, 1151 | "notification-url": "https://packagist.org/downloads/", 1152 | "license": [ 1153 | "BSD-3-Clause" 1154 | ], 1155 | "authors": [ 1156 | { 1157 | "name": "Sebastian Bergmann", 1158 | "email": "sb@sebastian-bergmann.de", 1159 | "role": "lead" 1160 | } 1161 | ], 1162 | "description": "Mock Object library for PHPUnit", 1163 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 1164 | "keywords": [ 1165 | "mock", 1166 | "xunit" 1167 | ], 1168 | "time": "2016-06-12 07:37:26" 1169 | }, 1170 | { 1171 | "name": "psr/log", 1172 | "version": "1.0.0", 1173 | "source": { 1174 | "type": "git", 1175 | "url": "https://github.com/php-fig/log.git", 1176 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" 1177 | }, 1178 | "dist": { 1179 | "type": "zip", 1180 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", 1181 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", 1182 | "shasum": "" 1183 | }, 1184 | "type": "library", 1185 | "autoload": { 1186 | "psr-0": { 1187 | "Psr\\Log\\": "" 1188 | } 1189 | }, 1190 | "notification-url": "https://packagist.org/downloads/", 1191 | "license": [ 1192 | "MIT" 1193 | ], 1194 | "authors": [ 1195 | { 1196 | "name": "PHP-FIG", 1197 | "homepage": "http://www.php-fig.org/" 1198 | } 1199 | ], 1200 | "description": "Common interface for logging libraries", 1201 | "keywords": [ 1202 | "log", 1203 | "psr", 1204 | "psr-3" 1205 | ], 1206 | "time": "2012-12-21 11:40:51" 1207 | }, 1208 | { 1209 | "name": "satooshi/php-coveralls", 1210 | "version": "v1.0.1", 1211 | "source": { 1212 | "type": "git", 1213 | "url": "https://github.com/satooshi/php-coveralls.git", 1214 | "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" 1215 | }, 1216 | "dist": { 1217 | "type": "zip", 1218 | "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", 1219 | "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", 1220 | "shasum": "" 1221 | }, 1222 | "require": { 1223 | "ext-json": "*", 1224 | "ext-simplexml": "*", 1225 | "guzzle/guzzle": "^2.8|^3.0", 1226 | "php": ">=5.3.3", 1227 | "psr/log": "^1.0", 1228 | "symfony/config": "^2.1|^3.0", 1229 | "symfony/console": "^2.1|^3.0", 1230 | "symfony/stopwatch": "^2.0|^3.0", 1231 | "symfony/yaml": "^2.0|^3.0" 1232 | }, 1233 | "suggest": { 1234 | "symfony/http-kernel": "Allows Symfony integration" 1235 | }, 1236 | "bin": [ 1237 | "bin/coveralls" 1238 | ], 1239 | "type": "library", 1240 | "autoload": { 1241 | "psr-4": { 1242 | "Satooshi\\": "src/Satooshi/" 1243 | } 1244 | }, 1245 | "notification-url": "https://packagist.org/downloads/", 1246 | "license": [ 1247 | "MIT" 1248 | ], 1249 | "authors": [ 1250 | { 1251 | "name": "Kitamura Satoshi", 1252 | "email": "with.no.parachute@gmail.com", 1253 | "homepage": "https://www.facebook.com/satooshi.jp" 1254 | } 1255 | ], 1256 | "description": "PHP client library for Coveralls API", 1257 | "homepage": "https://github.com/satooshi/php-coveralls", 1258 | "keywords": [ 1259 | "ci", 1260 | "coverage", 1261 | "github", 1262 | "test" 1263 | ], 1264 | "time": "2016-01-20 17:35:46" 1265 | }, 1266 | { 1267 | "name": "sebastian/code-unit-reverse-lookup", 1268 | "version": "1.0.0", 1269 | "source": { 1270 | "type": "git", 1271 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1272 | "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" 1273 | }, 1274 | "dist": { 1275 | "type": "zip", 1276 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", 1277 | "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", 1278 | "shasum": "" 1279 | }, 1280 | "require": { 1281 | "php": ">=5.6" 1282 | }, 1283 | "require-dev": { 1284 | "phpunit/phpunit": "~5" 1285 | }, 1286 | "type": "library", 1287 | "extra": { 1288 | "branch-alias": { 1289 | "dev-master": "1.0.x-dev" 1290 | } 1291 | }, 1292 | "autoload": { 1293 | "classmap": [ 1294 | "src/" 1295 | ] 1296 | }, 1297 | "notification-url": "https://packagist.org/downloads/", 1298 | "license": [ 1299 | "BSD-3-Clause" 1300 | ], 1301 | "authors": [ 1302 | { 1303 | "name": "Sebastian Bergmann", 1304 | "email": "sebastian@phpunit.de" 1305 | } 1306 | ], 1307 | "description": "Looks up which function or method a line of code belongs to", 1308 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1309 | "time": "2016-02-13 06:45:14" 1310 | }, 1311 | { 1312 | "name": "sebastian/comparator", 1313 | "version": "1.2.0", 1314 | "source": { 1315 | "type": "git", 1316 | "url": "https://github.com/sebastianbergmann/comparator.git", 1317 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" 1318 | }, 1319 | "dist": { 1320 | "type": "zip", 1321 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", 1322 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", 1323 | "shasum": "" 1324 | }, 1325 | "require": { 1326 | "php": ">=5.3.3", 1327 | "sebastian/diff": "~1.2", 1328 | "sebastian/exporter": "~1.2" 1329 | }, 1330 | "require-dev": { 1331 | "phpunit/phpunit": "~4.4" 1332 | }, 1333 | "type": "library", 1334 | "extra": { 1335 | "branch-alias": { 1336 | "dev-master": "1.2.x-dev" 1337 | } 1338 | }, 1339 | "autoload": { 1340 | "classmap": [ 1341 | "src/" 1342 | ] 1343 | }, 1344 | "notification-url": "https://packagist.org/downloads/", 1345 | "license": [ 1346 | "BSD-3-Clause" 1347 | ], 1348 | "authors": [ 1349 | { 1350 | "name": "Jeff Welch", 1351 | "email": "whatthejeff@gmail.com" 1352 | }, 1353 | { 1354 | "name": "Volker Dusch", 1355 | "email": "github@wallbash.com" 1356 | }, 1357 | { 1358 | "name": "Bernhard Schussek", 1359 | "email": "bschussek@2bepublished.at" 1360 | }, 1361 | { 1362 | "name": "Sebastian Bergmann", 1363 | "email": "sebastian@phpunit.de" 1364 | } 1365 | ], 1366 | "description": "Provides the functionality to compare PHP values for equality", 1367 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1368 | "keywords": [ 1369 | "comparator", 1370 | "compare", 1371 | "equality" 1372 | ], 1373 | "time": "2015-07-26 15:48:44" 1374 | }, 1375 | { 1376 | "name": "sebastian/diff", 1377 | "version": "1.4.1", 1378 | "source": { 1379 | "type": "git", 1380 | "url": "https://github.com/sebastianbergmann/diff.git", 1381 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" 1382 | }, 1383 | "dist": { 1384 | "type": "zip", 1385 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", 1386 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", 1387 | "shasum": "" 1388 | }, 1389 | "require": { 1390 | "php": ">=5.3.3" 1391 | }, 1392 | "require-dev": { 1393 | "phpunit/phpunit": "~4.8" 1394 | }, 1395 | "type": "library", 1396 | "extra": { 1397 | "branch-alias": { 1398 | "dev-master": "1.4-dev" 1399 | } 1400 | }, 1401 | "autoload": { 1402 | "classmap": [ 1403 | "src/" 1404 | ] 1405 | }, 1406 | "notification-url": "https://packagist.org/downloads/", 1407 | "license": [ 1408 | "BSD-3-Clause" 1409 | ], 1410 | "authors": [ 1411 | { 1412 | "name": "Kore Nordmann", 1413 | "email": "mail@kore-nordmann.de" 1414 | }, 1415 | { 1416 | "name": "Sebastian Bergmann", 1417 | "email": "sebastian@phpunit.de" 1418 | } 1419 | ], 1420 | "description": "Diff implementation", 1421 | "homepage": "https://github.com/sebastianbergmann/diff", 1422 | "keywords": [ 1423 | "diff" 1424 | ], 1425 | "time": "2015-12-08 07:14:41" 1426 | }, 1427 | { 1428 | "name": "sebastian/environment", 1429 | "version": "1.3.7", 1430 | "source": { 1431 | "type": "git", 1432 | "url": "https://github.com/sebastianbergmann/environment.git", 1433 | "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" 1434 | }, 1435 | "dist": { 1436 | "type": "zip", 1437 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", 1438 | "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", 1439 | "shasum": "" 1440 | }, 1441 | "require": { 1442 | "php": ">=5.3.3" 1443 | }, 1444 | "require-dev": { 1445 | "phpunit/phpunit": "~4.4" 1446 | }, 1447 | "type": "library", 1448 | "extra": { 1449 | "branch-alias": { 1450 | "dev-master": "1.3.x-dev" 1451 | } 1452 | }, 1453 | "autoload": { 1454 | "classmap": [ 1455 | "src/" 1456 | ] 1457 | }, 1458 | "notification-url": "https://packagist.org/downloads/", 1459 | "license": [ 1460 | "BSD-3-Clause" 1461 | ], 1462 | "authors": [ 1463 | { 1464 | "name": "Sebastian Bergmann", 1465 | "email": "sebastian@phpunit.de" 1466 | } 1467 | ], 1468 | "description": "Provides functionality to handle HHVM/PHP environments", 1469 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1470 | "keywords": [ 1471 | "Xdebug", 1472 | "environment", 1473 | "hhvm" 1474 | ], 1475 | "time": "2016-05-17 03:18:57" 1476 | }, 1477 | { 1478 | "name": "sebastian/exporter", 1479 | "version": "1.2.2", 1480 | "source": { 1481 | "type": "git", 1482 | "url": "https://github.com/sebastianbergmann/exporter.git", 1483 | "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" 1484 | }, 1485 | "dist": { 1486 | "type": "zip", 1487 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", 1488 | "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", 1489 | "shasum": "" 1490 | }, 1491 | "require": { 1492 | "php": ">=5.3.3", 1493 | "sebastian/recursion-context": "~1.0" 1494 | }, 1495 | "require-dev": { 1496 | "ext-mbstring": "*", 1497 | "phpunit/phpunit": "~4.4" 1498 | }, 1499 | "type": "library", 1500 | "extra": { 1501 | "branch-alias": { 1502 | "dev-master": "1.3.x-dev" 1503 | } 1504 | }, 1505 | "autoload": { 1506 | "classmap": [ 1507 | "src/" 1508 | ] 1509 | }, 1510 | "notification-url": "https://packagist.org/downloads/", 1511 | "license": [ 1512 | "BSD-3-Clause" 1513 | ], 1514 | "authors": [ 1515 | { 1516 | "name": "Jeff Welch", 1517 | "email": "whatthejeff@gmail.com" 1518 | }, 1519 | { 1520 | "name": "Volker Dusch", 1521 | "email": "github@wallbash.com" 1522 | }, 1523 | { 1524 | "name": "Bernhard Schussek", 1525 | "email": "bschussek@2bepublished.at" 1526 | }, 1527 | { 1528 | "name": "Sebastian Bergmann", 1529 | "email": "sebastian@phpunit.de" 1530 | }, 1531 | { 1532 | "name": "Adam Harvey", 1533 | "email": "aharvey@php.net" 1534 | } 1535 | ], 1536 | "description": "Provides the functionality to export PHP variables for visualization", 1537 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1538 | "keywords": [ 1539 | "export", 1540 | "exporter" 1541 | ], 1542 | "time": "2016-06-17 09:04:28" 1543 | }, 1544 | { 1545 | "name": "sebastian/global-state", 1546 | "version": "1.1.1", 1547 | "source": { 1548 | "type": "git", 1549 | "url": "https://github.com/sebastianbergmann/global-state.git", 1550 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1551 | }, 1552 | "dist": { 1553 | "type": "zip", 1554 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1555 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1556 | "shasum": "" 1557 | }, 1558 | "require": { 1559 | "php": ">=5.3.3" 1560 | }, 1561 | "require-dev": { 1562 | "phpunit/phpunit": "~4.2" 1563 | }, 1564 | "suggest": { 1565 | "ext-uopz": "*" 1566 | }, 1567 | "type": "library", 1568 | "extra": { 1569 | "branch-alias": { 1570 | "dev-master": "1.0-dev" 1571 | } 1572 | }, 1573 | "autoload": { 1574 | "classmap": [ 1575 | "src/" 1576 | ] 1577 | }, 1578 | "notification-url": "https://packagist.org/downloads/", 1579 | "license": [ 1580 | "BSD-3-Clause" 1581 | ], 1582 | "authors": [ 1583 | { 1584 | "name": "Sebastian Bergmann", 1585 | "email": "sebastian@phpunit.de" 1586 | } 1587 | ], 1588 | "description": "Snapshotting of global state", 1589 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1590 | "keywords": [ 1591 | "global state" 1592 | ], 1593 | "time": "2015-10-12 03:26:01" 1594 | }, 1595 | { 1596 | "name": "sebastian/object-enumerator", 1597 | "version": "1.0.0", 1598 | "source": { 1599 | "type": "git", 1600 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1601 | "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" 1602 | }, 1603 | "dist": { 1604 | "type": "zip", 1605 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", 1606 | "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", 1607 | "shasum": "" 1608 | }, 1609 | "require": { 1610 | "php": ">=5.6", 1611 | "sebastian/recursion-context": "~1.0" 1612 | }, 1613 | "require-dev": { 1614 | "phpunit/phpunit": "~5" 1615 | }, 1616 | "type": "library", 1617 | "extra": { 1618 | "branch-alias": { 1619 | "dev-master": "1.0.x-dev" 1620 | } 1621 | }, 1622 | "autoload": { 1623 | "classmap": [ 1624 | "src/" 1625 | ] 1626 | }, 1627 | "notification-url": "https://packagist.org/downloads/", 1628 | "license": [ 1629 | "BSD-3-Clause" 1630 | ], 1631 | "authors": [ 1632 | { 1633 | "name": "Sebastian Bergmann", 1634 | "email": "sebastian@phpunit.de" 1635 | } 1636 | ], 1637 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1638 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1639 | "time": "2016-01-28 13:25:10" 1640 | }, 1641 | { 1642 | "name": "sebastian/recursion-context", 1643 | "version": "1.0.2", 1644 | "source": { 1645 | "type": "git", 1646 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1647 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791" 1648 | }, 1649 | "dist": { 1650 | "type": "zip", 1651 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", 1652 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791", 1653 | "shasum": "" 1654 | }, 1655 | "require": { 1656 | "php": ">=5.3.3" 1657 | }, 1658 | "require-dev": { 1659 | "phpunit/phpunit": "~4.4" 1660 | }, 1661 | "type": "library", 1662 | "extra": { 1663 | "branch-alias": { 1664 | "dev-master": "1.0.x-dev" 1665 | } 1666 | }, 1667 | "autoload": { 1668 | "classmap": [ 1669 | "src/" 1670 | ] 1671 | }, 1672 | "notification-url": "https://packagist.org/downloads/", 1673 | "license": [ 1674 | "BSD-3-Clause" 1675 | ], 1676 | "authors": [ 1677 | { 1678 | "name": "Jeff Welch", 1679 | "email": "whatthejeff@gmail.com" 1680 | }, 1681 | { 1682 | "name": "Sebastian Bergmann", 1683 | "email": "sebastian@phpunit.de" 1684 | }, 1685 | { 1686 | "name": "Adam Harvey", 1687 | "email": "aharvey@php.net" 1688 | } 1689 | ], 1690 | "description": "Provides functionality to recursively process PHP variables", 1691 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1692 | "time": "2015-11-11 19:50:13" 1693 | }, 1694 | { 1695 | "name": "sebastian/resource-operations", 1696 | "version": "1.0.0", 1697 | "source": { 1698 | "type": "git", 1699 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1700 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1701 | }, 1702 | "dist": { 1703 | "type": "zip", 1704 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1705 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1706 | "shasum": "" 1707 | }, 1708 | "require": { 1709 | "php": ">=5.6.0" 1710 | }, 1711 | "type": "library", 1712 | "extra": { 1713 | "branch-alias": { 1714 | "dev-master": "1.0.x-dev" 1715 | } 1716 | }, 1717 | "autoload": { 1718 | "classmap": [ 1719 | "src/" 1720 | ] 1721 | }, 1722 | "notification-url": "https://packagist.org/downloads/", 1723 | "license": [ 1724 | "BSD-3-Clause" 1725 | ], 1726 | "authors": [ 1727 | { 1728 | "name": "Sebastian Bergmann", 1729 | "email": "sebastian@phpunit.de" 1730 | } 1731 | ], 1732 | "description": "Provides a list of PHP built-in functions that operate on resources", 1733 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1734 | "time": "2015-07-28 20:34:47" 1735 | }, 1736 | { 1737 | "name": "sebastian/version", 1738 | "version": "2.0.0", 1739 | "source": { 1740 | "type": "git", 1741 | "url": "https://github.com/sebastianbergmann/version.git", 1742 | "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" 1743 | }, 1744 | "dist": { 1745 | "type": "zip", 1746 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", 1747 | "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", 1748 | "shasum": "" 1749 | }, 1750 | "require": { 1751 | "php": ">=5.6" 1752 | }, 1753 | "type": "library", 1754 | "extra": { 1755 | "branch-alias": { 1756 | "dev-master": "2.0.x-dev" 1757 | } 1758 | }, 1759 | "autoload": { 1760 | "classmap": [ 1761 | "src/" 1762 | ] 1763 | }, 1764 | "notification-url": "https://packagist.org/downloads/", 1765 | "license": [ 1766 | "BSD-3-Clause" 1767 | ], 1768 | "authors": [ 1769 | { 1770 | "name": "Sebastian Bergmann", 1771 | "email": "sebastian@phpunit.de", 1772 | "role": "lead" 1773 | } 1774 | ], 1775 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1776 | "homepage": "https://github.com/sebastianbergmann/version", 1777 | "time": "2016-02-04 12:56:52" 1778 | }, 1779 | { 1780 | "name": "symfony/config", 1781 | "version": "v3.1.1", 1782 | "source": { 1783 | "type": "git", 1784 | "url": "https://github.com/symfony/config.git", 1785 | "reference": "048dc47e07f92333203c3b7045868bbc864fc40e" 1786 | }, 1787 | "dist": { 1788 | "type": "zip", 1789 | "url": "https://api.github.com/repos/symfony/config/zipball/048dc47e07f92333203c3b7045868bbc864fc40e", 1790 | "reference": "048dc47e07f92333203c3b7045868bbc864fc40e", 1791 | "shasum": "" 1792 | }, 1793 | "require": { 1794 | "php": ">=5.5.9", 1795 | "symfony/filesystem": "~2.8|~3.0" 1796 | }, 1797 | "suggest": { 1798 | "symfony/yaml": "To use the yaml reference dumper" 1799 | }, 1800 | "type": "library", 1801 | "extra": { 1802 | "branch-alias": { 1803 | "dev-master": "3.1-dev" 1804 | } 1805 | }, 1806 | "autoload": { 1807 | "psr-4": { 1808 | "Symfony\\Component\\Config\\": "" 1809 | }, 1810 | "exclude-from-classmap": [ 1811 | "/Tests/" 1812 | ] 1813 | }, 1814 | "notification-url": "https://packagist.org/downloads/", 1815 | "license": [ 1816 | "MIT" 1817 | ], 1818 | "authors": [ 1819 | { 1820 | "name": "Fabien Potencier", 1821 | "email": "fabien@symfony.com" 1822 | }, 1823 | { 1824 | "name": "Symfony Community", 1825 | "homepage": "https://symfony.com/contributors" 1826 | } 1827 | ], 1828 | "description": "Symfony Config Component", 1829 | "homepage": "https://symfony.com", 1830 | "time": "2016-05-20 11:48:17" 1831 | }, 1832 | { 1833 | "name": "symfony/console", 1834 | "version": "v3.1.1", 1835 | "source": { 1836 | "type": "git", 1837 | "url": "https://github.com/symfony/console.git", 1838 | "reference": "64a4d43b045f07055bb197650159769604cb2a92" 1839 | }, 1840 | "dist": { 1841 | "type": "zip", 1842 | "url": "https://api.github.com/repos/symfony/console/zipball/64a4d43b045f07055bb197650159769604cb2a92", 1843 | "reference": "64a4d43b045f07055bb197650159769604cb2a92", 1844 | "shasum": "" 1845 | }, 1846 | "require": { 1847 | "php": ">=5.5.9", 1848 | "symfony/polyfill-mbstring": "~1.0" 1849 | }, 1850 | "require-dev": { 1851 | "psr/log": "~1.0", 1852 | "symfony/event-dispatcher": "~2.8|~3.0", 1853 | "symfony/process": "~2.8|~3.0" 1854 | }, 1855 | "suggest": { 1856 | "psr/log": "For using the console logger", 1857 | "symfony/event-dispatcher": "", 1858 | "symfony/process": "" 1859 | }, 1860 | "type": "library", 1861 | "extra": { 1862 | "branch-alias": { 1863 | "dev-master": "3.1-dev" 1864 | } 1865 | }, 1866 | "autoload": { 1867 | "psr-4": { 1868 | "Symfony\\Component\\Console\\": "" 1869 | }, 1870 | "exclude-from-classmap": [ 1871 | "/Tests/" 1872 | ] 1873 | }, 1874 | "notification-url": "https://packagist.org/downloads/", 1875 | "license": [ 1876 | "MIT" 1877 | ], 1878 | "authors": [ 1879 | { 1880 | "name": "Fabien Potencier", 1881 | "email": "fabien@symfony.com" 1882 | }, 1883 | { 1884 | "name": "Symfony Community", 1885 | "homepage": "https://symfony.com/contributors" 1886 | } 1887 | ], 1888 | "description": "Symfony Console Component", 1889 | "homepage": "https://symfony.com", 1890 | "time": "2016-06-14 11:18:07" 1891 | }, 1892 | { 1893 | "name": "symfony/event-dispatcher", 1894 | "version": "v2.8.7", 1895 | "source": { 1896 | "type": "git", 1897 | "url": "https://github.com/symfony/event-dispatcher.git", 1898 | "reference": "2a6b8713f8bdb582058cfda463527f195b066110" 1899 | }, 1900 | "dist": { 1901 | "type": "zip", 1902 | "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2a6b8713f8bdb582058cfda463527f195b066110", 1903 | "reference": "2a6b8713f8bdb582058cfda463527f195b066110", 1904 | "shasum": "" 1905 | }, 1906 | "require": { 1907 | "php": ">=5.3.9" 1908 | }, 1909 | "require-dev": { 1910 | "psr/log": "~1.0", 1911 | "symfony/config": "~2.0,>=2.0.5|~3.0.0", 1912 | "symfony/dependency-injection": "~2.6|~3.0.0", 1913 | "symfony/expression-language": "~2.6|~3.0.0", 1914 | "symfony/stopwatch": "~2.3|~3.0.0" 1915 | }, 1916 | "suggest": { 1917 | "symfony/dependency-injection": "", 1918 | "symfony/http-kernel": "" 1919 | }, 1920 | "type": "library", 1921 | "extra": { 1922 | "branch-alias": { 1923 | "dev-master": "2.8-dev" 1924 | } 1925 | }, 1926 | "autoload": { 1927 | "psr-4": { 1928 | "Symfony\\Component\\EventDispatcher\\": "" 1929 | }, 1930 | "exclude-from-classmap": [ 1931 | "/Tests/" 1932 | ] 1933 | }, 1934 | "notification-url": "https://packagist.org/downloads/", 1935 | "license": [ 1936 | "MIT" 1937 | ], 1938 | "authors": [ 1939 | { 1940 | "name": "Fabien Potencier", 1941 | "email": "fabien@symfony.com" 1942 | }, 1943 | { 1944 | "name": "Symfony Community", 1945 | "homepage": "https://symfony.com/contributors" 1946 | } 1947 | ], 1948 | "description": "Symfony EventDispatcher Component", 1949 | "homepage": "https://symfony.com", 1950 | "time": "2016-06-06 11:11:27" 1951 | }, 1952 | { 1953 | "name": "symfony/filesystem", 1954 | "version": "v3.1.1", 1955 | "source": { 1956 | "type": "git", 1957 | "url": "https://github.com/symfony/filesystem.git", 1958 | "reference": "5751e80d6f94b7c018f338a4a7be0b700d6f3058" 1959 | }, 1960 | "dist": { 1961 | "type": "zip", 1962 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/5751e80d6f94b7c018f338a4a7be0b700d6f3058", 1963 | "reference": "5751e80d6f94b7c018f338a4a7be0b700d6f3058", 1964 | "shasum": "" 1965 | }, 1966 | "require": { 1967 | "php": ">=5.5.9" 1968 | }, 1969 | "type": "library", 1970 | "extra": { 1971 | "branch-alias": { 1972 | "dev-master": "3.1-dev" 1973 | } 1974 | }, 1975 | "autoload": { 1976 | "psr-4": { 1977 | "Symfony\\Component\\Filesystem\\": "" 1978 | }, 1979 | "exclude-from-classmap": [ 1980 | "/Tests/" 1981 | ] 1982 | }, 1983 | "notification-url": "https://packagist.org/downloads/", 1984 | "license": [ 1985 | "MIT" 1986 | ], 1987 | "authors": [ 1988 | { 1989 | "name": "Fabien Potencier", 1990 | "email": "fabien@symfony.com" 1991 | }, 1992 | { 1993 | "name": "Symfony Community", 1994 | "homepage": "https://symfony.com/contributors" 1995 | } 1996 | ], 1997 | "description": "Symfony Filesystem Component", 1998 | "homepage": "https://symfony.com", 1999 | "time": "2016-04-12 18:27:47" 2000 | }, 2001 | { 2002 | "name": "symfony/polyfill-mbstring", 2003 | "version": "v1.2.0", 2004 | "source": { 2005 | "type": "git", 2006 | "url": "https://github.com/symfony/polyfill-mbstring.git", 2007 | "reference": "dff51f72b0706335131b00a7f49606168c582594" 2008 | }, 2009 | "dist": { 2010 | "type": "zip", 2011 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", 2012 | "reference": "dff51f72b0706335131b00a7f49606168c582594", 2013 | "shasum": "" 2014 | }, 2015 | "require": { 2016 | "php": ">=5.3.3" 2017 | }, 2018 | "suggest": { 2019 | "ext-mbstring": "For best performance" 2020 | }, 2021 | "type": "library", 2022 | "extra": { 2023 | "branch-alias": { 2024 | "dev-master": "1.2-dev" 2025 | } 2026 | }, 2027 | "autoload": { 2028 | "psr-4": { 2029 | "Symfony\\Polyfill\\Mbstring\\": "" 2030 | }, 2031 | "files": [ 2032 | "bootstrap.php" 2033 | ] 2034 | }, 2035 | "notification-url": "https://packagist.org/downloads/", 2036 | "license": [ 2037 | "MIT" 2038 | ], 2039 | "authors": [ 2040 | { 2041 | "name": "Nicolas Grekas", 2042 | "email": "p@tchwork.com" 2043 | }, 2044 | { 2045 | "name": "Symfony Community", 2046 | "homepage": "https://symfony.com/contributors" 2047 | } 2048 | ], 2049 | "description": "Symfony polyfill for the Mbstring extension", 2050 | "homepage": "https://symfony.com", 2051 | "keywords": [ 2052 | "compatibility", 2053 | "mbstring", 2054 | "polyfill", 2055 | "portable", 2056 | "shim" 2057 | ], 2058 | "time": "2016-05-18 14:26:46" 2059 | }, 2060 | { 2061 | "name": "symfony/stopwatch", 2062 | "version": "v3.1.1", 2063 | "source": { 2064 | "type": "git", 2065 | "url": "https://github.com/symfony/stopwatch.git", 2066 | "reference": "e7238f98c90b99e9b53f3674a91757228663b04d" 2067 | }, 2068 | "dist": { 2069 | "type": "zip", 2070 | "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e7238f98c90b99e9b53f3674a91757228663b04d", 2071 | "reference": "e7238f98c90b99e9b53f3674a91757228663b04d", 2072 | "shasum": "" 2073 | }, 2074 | "require": { 2075 | "php": ">=5.5.9" 2076 | }, 2077 | "type": "library", 2078 | "extra": { 2079 | "branch-alias": { 2080 | "dev-master": "3.1-dev" 2081 | } 2082 | }, 2083 | "autoload": { 2084 | "psr-4": { 2085 | "Symfony\\Component\\Stopwatch\\": "" 2086 | }, 2087 | "exclude-from-classmap": [ 2088 | "/Tests/" 2089 | ] 2090 | }, 2091 | "notification-url": "https://packagist.org/downloads/", 2092 | "license": [ 2093 | "MIT" 2094 | ], 2095 | "authors": [ 2096 | { 2097 | "name": "Fabien Potencier", 2098 | "email": "fabien@symfony.com" 2099 | }, 2100 | { 2101 | "name": "Symfony Community", 2102 | "homepage": "https://symfony.com/contributors" 2103 | } 2104 | ], 2105 | "description": "Symfony Stopwatch Component", 2106 | "homepage": "https://symfony.com", 2107 | "time": "2016-06-06 11:42:41" 2108 | }, 2109 | { 2110 | "name": "symfony/yaml", 2111 | "version": "v3.1.1", 2112 | "source": { 2113 | "type": "git", 2114 | "url": "https://github.com/symfony/yaml.git", 2115 | "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623" 2116 | }, 2117 | "dist": { 2118 | "type": "zip", 2119 | "url": "https://api.github.com/repos/symfony/yaml/zipball/c5a7e7fc273c758b92b85dcb9c46149ccda89623", 2120 | "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623", 2121 | "shasum": "" 2122 | }, 2123 | "require": { 2124 | "php": ">=5.5.9" 2125 | }, 2126 | "type": "library", 2127 | "extra": { 2128 | "branch-alias": { 2129 | "dev-master": "3.1-dev" 2130 | } 2131 | }, 2132 | "autoload": { 2133 | "psr-4": { 2134 | "Symfony\\Component\\Yaml\\": "" 2135 | }, 2136 | "exclude-from-classmap": [ 2137 | "/Tests/" 2138 | ] 2139 | }, 2140 | "notification-url": "https://packagist.org/downloads/", 2141 | "license": [ 2142 | "MIT" 2143 | ], 2144 | "authors": [ 2145 | { 2146 | "name": "Fabien Potencier", 2147 | "email": "fabien@symfony.com" 2148 | }, 2149 | { 2150 | "name": "Symfony Community", 2151 | "homepage": "https://symfony.com/contributors" 2152 | } 2153 | ], 2154 | "description": "Symfony Yaml Component", 2155 | "homepage": "https://symfony.com", 2156 | "time": "2016-06-14 11:18:07" 2157 | }, 2158 | { 2159 | "name": "webmozart/assert", 2160 | "version": "1.0.2", 2161 | "source": { 2162 | "type": "git", 2163 | "url": "https://github.com/webmozart/assert.git", 2164 | "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" 2165 | }, 2166 | "dist": { 2167 | "type": "zip", 2168 | "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", 2169 | "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", 2170 | "shasum": "" 2171 | }, 2172 | "require": { 2173 | "php": ">=5.3.3" 2174 | }, 2175 | "require-dev": { 2176 | "phpunit/phpunit": "^4.6" 2177 | }, 2178 | "type": "library", 2179 | "extra": { 2180 | "branch-alias": { 2181 | "dev-master": "1.0-dev" 2182 | } 2183 | }, 2184 | "autoload": { 2185 | "psr-4": { 2186 | "Webmozart\\Assert\\": "src/" 2187 | } 2188 | }, 2189 | "notification-url": "https://packagist.org/downloads/", 2190 | "license": [ 2191 | "MIT" 2192 | ], 2193 | "authors": [ 2194 | { 2195 | "name": "Bernhard Schussek", 2196 | "email": "bschussek@gmail.com" 2197 | } 2198 | ], 2199 | "description": "Assertions to validate method input/output with nice error messages.", 2200 | "keywords": [ 2201 | "assert", 2202 | "check", 2203 | "validate" 2204 | ], 2205 | "time": "2015-08-24 13:29:44" 2206 | } 2207 | ], 2208 | "aliases": [], 2209 | "minimum-stability": "stable", 2210 | "stability-flags": [], 2211 | "prefer-stable": false, 2212 | "prefer-lowest": false, 2213 | "platform": { 2214 | "php": ">=5.5.0" 2215 | }, 2216 | "platform-dev": [] 2217 | } 2218 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | tests 9 | 10 | 11 | 12 | 13 | src 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Client.php: -------------------------------------------------------------------------------- 1 | transport = new $transport($host, $port, $username, $password); 46 | 47 | $this->system = new System($this, $settings); 48 | 49 | $this->queryGrammar = new Query\Grammar(); 50 | } 51 | 52 | 53 | /** 54 | * Begin a fluent query against a database table. 55 | * 56 | * @param string $table 57 | * @return \ClickHouse\Query\Builder 58 | */ 59 | public function table($table) 60 | { 61 | return $this->query()->from($table); 62 | } 63 | 64 | /** 65 | * Run a select statement against the database. 66 | * @param string $sql 67 | * @param array $bindings 68 | * @return Statement 69 | * @throws \RuntimeException 70 | */ 71 | public function select($sql, $bindings = []) 72 | { 73 | return $this->transport->select($sql, $bindings); 74 | } 75 | 76 | /** 77 | * @param string $table 78 | * @param array $values 79 | * @param array $columns 80 | * 81 | * @return mixed|void 82 | */ 83 | public function insert($table, $columns = [], $values) 84 | { 85 | return $this->transport->insert($table, $columns, $values); 86 | } 87 | 88 | /** 89 | * @param string $sql 90 | * @param $data 91 | * @param null $formatName 92 | * @return mixed 93 | */ 94 | public function insertBatch($table, $data, $formatName = null) 95 | { 96 | return $this->transport->insertBatch($table, $data, $formatName); 97 | } 98 | 99 | /** 100 | * @param $sql 101 | * @param array $bindings 102 | * @return Statement 103 | */ 104 | public function execute($sql, $bindings = []) 105 | { 106 | return $this->transport->execute($sql, $bindings); 107 | } 108 | 109 | /** 110 | * @return bool 111 | */ 112 | public function ping() 113 | { 114 | $sql = 'SELECT 1 as ping'; 115 | $stm = $this->select($sql); 116 | $ping = $stm->fetchColumn('ping'); 117 | 118 | return $ping === 1; 119 | } 120 | 121 | /** 122 | * @return System 123 | */ 124 | public function system() 125 | { 126 | return $this->system; 127 | } 128 | 129 | } -------------------------------------------------------------------------------- /src/Exception/NotImplementedException.php: -------------------------------------------------------------------------------- 1 | init($transport, $sql); 23 | $this->bindParams($bindings); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/Query/Grammar.php: -------------------------------------------------------------------------------- 1 | prepareSql($table, $columns, $values); 24 | $this->init($transport, $sql); 25 | } 26 | 27 | 28 | /** 29 | * @param string $table 30 | * @param array $columns 31 | * @param array $values 32 | * @return string 33 | */ 34 | protected function prepareSql($table, array $columns = [], array $values) 35 | { 36 | $sql = 'INSERT INTO ' . $table; 37 | 38 | if (0 !== count($columns)) { 39 | $sql .= ' (' . implode(',', $columns) . ') '; 40 | } 41 | 42 | $sql .= 'VALUES '; 43 | 44 | foreach ($values as $row) { 45 | $sql .= ' (' . implode(',', $this->quote($row)) . '), '; 46 | } 47 | 48 | $sql = trim($sql, ', '); 49 | 50 | return $sql; 51 | } 52 | 53 | /** 54 | * @param array $row 55 | * @return array 56 | */ 57 | protected function quote(array $row) 58 | { 59 | $grammar = $this->grammar; 60 | $quote = function ($value) use ($grammar) { 61 | return $grammar->quote($value); 62 | }; 63 | return array_map($quote, $row); 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /src/Query/Query.php: -------------------------------------------------------------------------------- 1 | grammar = new Grammar(); 38 | } 39 | 40 | /** 41 | * @param TransportInterface $transport 42 | * @param string $sql 43 | */ 44 | protected function init(TransportInterface $transport, $sql) 45 | { 46 | $this->sql = $sql; 47 | $this->transport = $transport; 48 | 49 | } 50 | 51 | /** 52 | * @param array $bindings 53 | */ 54 | public function bindParams(array $bindings) 55 | { 56 | foreach ($bindings as $column => $value) { 57 | $this->bindParam($column, $value); 58 | } 59 | } 60 | 61 | /** 62 | * @param string $column 63 | * @param mixed $value 64 | */ 65 | public function bindParam($column, $value) 66 | { 67 | $this->bindings[$column] = $value; 68 | } 69 | 70 | /** 71 | * Устанавливает формат вывода для SELECT/INSERT запроса 72 | * 73 | * @return string 74 | */ 75 | protected function prepareQueryFormat() 76 | { 77 | 78 | if (null !== static::$format) { 79 | $this->sql = $this->sql . ' FORMAT ' . static::$format; 80 | } 81 | 82 | return $this->sql; 83 | } 84 | 85 | /** 86 | * Биндит параметры в sql 87 | * @return string 88 | */ 89 | protected function prepareQueryBindings() 90 | { 91 | $keys = array(); 92 | $values = $this->bindings; 93 | 94 | # build a regular expression for each parameter 95 | foreach ($this->bindings as $key => $value) { 96 | if (is_string($key)) { 97 | $keys[] = '/:' . $key . '/'; 98 | } else { 99 | $keys[] = '/[?]/'; 100 | } 101 | 102 | if (is_string($value)) 103 | $values[$key] = "'" . $value . "'"; 104 | 105 | if (is_array($value)) 106 | $values[$key] = "'" . implode("','", $value) . "'"; 107 | 108 | if (null === $value) 109 | $values[$key] = ''; 110 | } 111 | $this->sql = preg_replace($keys, $values, $this->sql, 1, $count); 112 | 113 | return $this->sql; 114 | } 115 | 116 | 117 | /** 118 | * @return string 119 | */ 120 | public function toSql() 121 | { 122 | $this->prepareQueryBindings(); 123 | $this->prepareQueryFormat(); 124 | return $this->sql; 125 | } 126 | 127 | /** 128 | * @return string 129 | */ 130 | public function __toString() 131 | { 132 | return $this->toSql(); 133 | } 134 | } -------------------------------------------------------------------------------- /src/Query/QueryInterface.php: -------------------------------------------------------------------------------- 1 | init($transport, $sql); 20 | $this->bindParams($bindings); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Settings.php: -------------------------------------------------------------------------------- 1 | client = $client; 198 | $this->setUpSettings($settings); 199 | } 200 | 201 | /** 202 | * @param string $name 203 | * @return string 204 | */ 205 | public function __get($name) 206 | { 207 | if (!property_exists($this, $name)) { 208 | throw new \InvalidArgumentException(sprintf('settings with name %s not exists', $name)); 209 | } 210 | 211 | return $this->client->query('SELECT value FROM system.settings WHERE name = :name') 212 | ->bindValue('name', $name) 213 | ->fetchColumn(); 214 | } 215 | 216 | public function __set($name, $value) 217 | { 218 | if (!property_exists($this, $name)) { 219 | throw new \InvalidArgumentException(sprintf('settings with name %s not exists', $name)); 220 | } 221 | 222 | $this->{$name} = $value; 223 | return $this->client->execute('SET :name = :value'); 224 | } 225 | 226 | public function __isset($name) 227 | { 228 | 229 | } 230 | 231 | private function setUpSettings($settings) 232 | { 233 | foreach ($settings as $name => $value) { 234 | $this->__set($name, $value); 235 | } 236 | } 237 | } -------------------------------------------------------------------------------- /src/Statement.php: -------------------------------------------------------------------------------- 1 | transport = $transport; 76 | $this->query = $query; 77 | $this->prepareJsonResponse($data); 78 | 79 | } 80 | 81 | /** 82 | * @param $data 83 | * 84 | * @return Statement 85 | */ 86 | protected function prepareJsonResponse($data) 87 | { 88 | $this->rawResult = $data; 89 | 90 | if (empty($data)) { 91 | return $this; 92 | } 93 | 94 | $this->result = json_decode($data); 95 | foreach (self::JSON_RESPONSE_POSSIBLE_KEYS as $possibleKey) { 96 | if (property_exists($this->result, $possibleKey)) { 97 | $this->{$possibleKey} = $this->result->{$possibleKey}; 98 | } 99 | } 100 | 101 | return $this; 102 | 103 | } 104 | 105 | 106 | /** 107 | * @return array 108 | */ 109 | public function fetchAll() 110 | { 111 | return $this->data; 112 | } 113 | 114 | /** 115 | * @return \stdClass 116 | */ 117 | public function fetchOne() 118 | { 119 | return current($this->data); 120 | } 121 | 122 | /** 123 | * @param $name 124 | * @return mixed 125 | */ 126 | public function fetchColumn($name) 127 | { 128 | $current = $this->fetchOne(); 129 | 130 | return $current->{$name}; 131 | } 132 | 133 | /** 134 | * @return int 135 | */ 136 | public function rowsCount() 137 | { 138 | return $this->rows; 139 | } 140 | 141 | 142 | 143 | /** 144 | * @return mixed 145 | */ 146 | public function getRawResult() 147 | { 148 | return $this->rawResult; 149 | } 150 | 151 | /** 152 | * @return \stdClass 153 | */ 154 | public function getResult() 155 | { 156 | return $this->result; 157 | } 158 | 159 | /** 160 | * @return mixed 161 | */ 162 | public function getRowsBeforeLimitAtLeast() 163 | { 164 | return $this->rows_before_limit_at_least; 165 | } 166 | 167 | 168 | /** 169 | * @return array 170 | */ 171 | public function getMeta() 172 | { 173 | return $this->meta; 174 | } 175 | 176 | /** 177 | * @param string $column 178 | * @return \stdClass 179 | */ 180 | public function getColumnMeta($column) 181 | { 182 | $meta = $this->getMeta(); 183 | 184 | return array_reduce($meta, function ($carry, $item) use ($column) { 185 | if ($item->name === $column) { 186 | $carry = $item; 187 | } 188 | 189 | return $carry; 190 | }); 191 | } 192 | 193 | /** 194 | * @return mixed 195 | */ 196 | public function getExtremes() 197 | { 198 | return $this->extremes; 199 | } 200 | 201 | /** 202 | * @return mixed 203 | */ 204 | public function getTotals() 205 | { 206 | return $this->totals; 207 | } 208 | 209 | } -------------------------------------------------------------------------------- /src/System.php: -------------------------------------------------------------------------------- 1 | client = $client; 13 | $this->settings = new Settings($client, $settings); 14 | } 15 | 16 | /** 17 | * Содержит информацию о кусках таблиц семейства MergeTree. 18 | * @param int $limit 19 | * @return array 20 | */ 21 | public function numbers($limit = 10) 22 | { 23 | $sql = 'SELECT number FROM system.numbers LIMIT ' . $limit; 24 | $result = $this->client->select($sql); 25 | 26 | return $result->fetchAll(); 27 | } 28 | 29 | /** 30 | * Таблица содержит столбцы database, name, engine типа String. 31 | * 32 | * @return array 33 | */ 34 | public function tables($table = null) 35 | { 36 | $sql = 'SELECT * FROM system.tables'; 37 | 38 | if (null !== $table) { 39 | $sql .= ' WHERE name=:name'; 40 | } 41 | 42 | return $this->client->select($sql, ['name'=>$table]); 43 | 44 | } 45 | 46 | /** 47 | * Таблица содержит один столбец name типа String - имя базы данных. 48 | * Для каждой базы данных, о которой знает сервер, будет присутствовать соответствующая запись в таблице. 49 | * 50 | * @return array 51 | */ 52 | public function databases() 53 | { 54 | $sql = 'SHOW DATABASES'; 55 | $result = $this->client->select($sql); 56 | 57 | return $result->fetchAll(); 58 | } 59 | 60 | /** 61 | * @return array 62 | */ 63 | public function processes() 64 | { 65 | $sql = 'SHOW PROCESSLIST'; 66 | $result = $this->client->select($sql); 67 | 68 | return $result->fetchAll(); 69 | } 70 | 71 | /** 72 | * Содержит информацию о количестве произошедших в системе событий, для профилирования и мониторинга. 73 | * Пример: количество обработанных запросов типа SELECT. 74 | * Столбцы: event String - имя события, value UInt64 - количество. 75 | * 76 | * @return array 77 | */ 78 | public function events() 79 | { 80 | $sql = 'SELECT * FROM system.events'; 81 | $result = $this->client->select($sql); 82 | 83 | return $result->fetchAll(); 84 | } 85 | 86 | /** 87 | * информация о доступных в конфигурационном файле кластерах и серверах, которые в них входят. 88 | * 89 | * @return Statement 90 | */ 91 | public function clusters() 92 | { 93 | $sql = 'SELECT * FROM system.clusters'; 94 | $result = $this->client->select($sql); 95 | 96 | return $result; 97 | } 98 | 99 | /** 100 | * Содержит информацию о столбцах всех таблиц. 101 | * 102 | * @param null|string $table 103 | * @return Statement 104 | */ 105 | public function columns($table = null) 106 | { 107 | $sql = 'SELECT * FROM system.columns'; 108 | 109 | if (null !== $table) { 110 | $sql .= ' WHERE table=:table'; 111 | } 112 | 113 | $result = $this->client->select($sql, ['table'=>$table]); 114 | 115 | return $result; 116 | } 117 | 118 | /** 119 | * информация о внешних словарях. 120 | * @return array 121 | */ 122 | public function dictionaries() 123 | { 124 | $sql = 'SELECT * FROM system.dictionaries'; 125 | $result = $this->client->select($sql); 126 | 127 | return $result->fetchAll(); 128 | } 129 | 130 | /** 131 | * Содержит информацию об обычных и агрегатных функциях. 132 | * @return array 133 | */ 134 | public function functions() 135 | { 136 | $sql = 'SELECT * FROM system.functions'; 137 | $result = $this->client->select($sql); 138 | 139 | return $result->fetchAll(); 140 | } 141 | 142 | /** 143 | * Содержит информацию о производящихся прямо сейчас слияниях для таблиц семейства MergeTree. 144 | * @return array 145 | */ 146 | public function merges() 147 | { 148 | $sql = 'SELECT * FROM system.merges'; 149 | $result = $this->client->select($sql); 150 | 151 | return $result->fetchAll(); 152 | } 153 | 154 | /** 155 | * Содержит информацию о кусках таблиц семейства MergeTree. 156 | * @return array 157 | */ 158 | public function parts() 159 | { 160 | $sql = 'SELECT * FROM system.parts'; 161 | $result = $this->client->select($sql); 162 | 163 | return $result->fetchAll(); 164 | } 165 | 166 | /** 167 | * Содержит информацию и статус для реплицируемых таблиц, расположенных на локальном сервере. 168 | * @return array 169 | */ 170 | public function replicas($table) 171 | { 172 | $sql = 'SELECT * FROM system.replicas WHERE table=' . $table; 173 | $result = $this->client->select($sql); 174 | 175 | return $result->fetchAll(); 176 | } 177 | 178 | /** 179 | * @return Settings 180 | */ 181 | public function settings() 182 | { 183 | return $this->settings; 184 | } 185 | 186 | /** 187 | * @return array 188 | */ 189 | public function zookeeper($path) 190 | { 191 | $sql = 'SELECT * FROM system.zookeeper WHERE $path = ' . $path; 192 | $result = $this->client->select($sql); 193 | 194 | return $result->fetchAll(); 195 | } 196 | 197 | 198 | 199 | } -------------------------------------------------------------------------------- /src/Transport/Http.php: -------------------------------------------------------------------------------- 1 | host = $host; 62 | 63 | if (null !== $port) 64 | $this->port = $port; 65 | 66 | if(null !== $username) 67 | $this->username = $username; 68 | 69 | if(null !== $password) 70 | $this->password = $password; 71 | 72 | 73 | if (array_key_exists('timeout', $requestOptions)) { 74 | $this->timeout = $requestOptions['timeout']; 75 | } 76 | 77 | $this->connect(); 78 | } 79 | 80 | /** 81 | * 82 | */ 83 | protected function connect() 84 | { 85 | $handler = new CurlHandler(); 86 | $stack = HandlerStack::create($handler); 87 | 88 | $httpClientSettings = [ 89 | 'base_uri' => $this->host . ':' . $this->port, 90 | 'timeout' => $this->timeout, 91 | 'handler' => $stack, 92 | ]; 93 | 94 | if (null !== $this->username) { 95 | $httpClientSettings['auth'] = [$this->username, $this->password]; 96 | } 97 | 98 | $this->httpClient = new Client($httpClientSettings); 99 | } 100 | 101 | 102 | /** 103 | * @param string $sql 104 | * 105 | * @param array $bindings 106 | * @return Statement 107 | * @throws \RuntimeException 108 | */ 109 | public function select($sql, array $bindings = []) 110 | { 111 | $query = new SelectQuery($this, $sql, $bindings); 112 | 113 | $response = $this->httpClient->request('GET', null, [ 114 | 'query' => $this->prepareQueryGetRequest($query), 115 | ]); 116 | 117 | $data = $response->getBody()->getContents(); 118 | 119 | return new Statement($data, $query, $this); 120 | } 121 | 122 | 123 | /** 124 | * @param string $table 125 | * @param array $values 126 | * @param array $columns 127 | * 128 | * @return Statement 129 | * @throws \RuntimeException 130 | * 131 | */ 132 | public function insert($table, array $columns = [], array $values) 133 | { 134 | $query = new InsertQuery($this, $table, $columns, $values); 135 | 136 | $response = $this->httpClient->request('POST', null, [ 137 | 'body' => $query->toSql(), 138 | ]); 139 | 140 | $data = $response->getBody()->getContents(); 141 | 142 | return new Statement($data, $query, $this); 143 | } 144 | 145 | /** 146 | * @param $sql 147 | * @param array $bindings 148 | * 149 | * @return Statement 150 | * @throws \RuntimeException 151 | */ 152 | public function execute($sql, $bindings = []) 153 | { 154 | $query = new ExecuteQuery($this, $sql, $bindings); 155 | 156 | $response = $this->httpClient->request('POST', null, [ 157 | 'body' => $query->toSql(), 158 | ]); 159 | 160 | $data = $response->getBody()->getContents(); 161 | 162 | return new Statement($data, $query, $this); 163 | } 164 | 165 | 166 | /** 167 | * @param Query $query 168 | * 169 | * @return array 170 | * 171 | */ 172 | protected function prepareQueryGetRequest(Query $query) 173 | { 174 | return ['query' => $query->toSql()]; 175 | } 176 | 177 | } 178 | -------------------------------------------------------------------------------- /src/Transport/TransportInterface.php: -------------------------------------------------------------------------------- 1 | client = new \ClickHouse\Client('http://127.0.0.1', 8123); 21 | 22 | 23 | $this->client->execute( 24 | /** @lang SQL */ 25 | "CREATE TABLE IF NOT EXISTS " . $this->tablename . " ( 26 | RowId UInt32, 27 | RowDate Date, 28 | RowUInt8 UInt8, 29 | RowInt16 Int16, 30 | RowFloat32 Float32, 31 | RowString String, 32 | RowFixedString FixedString(20), 33 | RowDateTime DateTime, 34 | RowEnum8 Enum8('hello' = 1, 'world' = 2), 35 | RowStringArray Array(String) 36 | ) ENGINE = MergeTree(RowDate, (RowId, RowDate), 8124);" 37 | ); 38 | 39 | } 40 | 41 | public function tearDown() 42 | { 43 | $this->client->execute('DROP TABLE IF EXISTS ' . $this->tablename); 44 | } 45 | 46 | /** 47 | * Заполняет тестовую таблицу, фейковыми данными 48 | * @param int $count 49 | */ 50 | public function fixtures($count = 1000) 51 | { 52 | 53 | } 54 | 55 | /** 56 | * 57 | */ 58 | public function testPing() 59 | { 60 | $result = $this->client->ping(); 61 | 62 | $this->assertTrue($result); 63 | 64 | } 65 | 66 | public function testFetchAll() 67 | { 68 | $result = $this->client->select('SELECT number FROM system.numbers LIMIT 10'); 69 | $data = $result->fetchAll(); 70 | 71 | $this->assertCount(10, $data); 72 | 73 | } 74 | 75 | public function testFetchWithBindings() 76 | { 77 | $result = $this->client->select('SELECT number FROM system.numbers WHERE number = :number LIMIT 1', ['number' => 100]); 78 | $first = $result->fetchOne(); 79 | 80 | $this->assertEquals(100, $first->number); 81 | 82 | } 83 | 84 | public function testFetchOne() 85 | { 86 | $result = $this->client->select('SELECT number FROM system.numbers LIMIT 1'); 87 | $first = $result->fetchOne(); 88 | 89 | $this->assertInstanceOf(\stdClass::class, $first); 90 | $this->assertEquals(0, $first->number); 91 | } 92 | 93 | public function testFetchColumn() 94 | { 95 | $result = $this->client->select('SELECT number FROM system.numbers LIMIT 1'); 96 | $number = $result->fetchColumn('number'); 97 | 98 | $this->assertTrue(is_numeric($number)); 99 | $this->assertEquals(0, $number); 100 | } 101 | 102 | 103 | public function testCreateDropTable() 104 | { 105 | 106 | $tablename = 'test_create'; 107 | $this->client->execute( 108 | 'CREATE TABLE ' . $tablename . ' (abc UInt8) ENGINE = Memory;' 109 | ); 110 | 111 | $st = $this->client->system()->columns($tablename); 112 | $column = $st->fetchOne(); 113 | 114 | $this->assertEquals('abc', $column->name); 115 | $this->assertEquals('uint8', strtolower($column->type)); 116 | 117 | 118 | $this->client->execute( 119 | 'DROP TABLE ' . $tablename . ';' 120 | ); 121 | } 122 | 123 | /** 124 | * 125 | */ 126 | public function testInsertFormatValues() 127 | { 128 | $faker = Faker\Factory::create(); 129 | $columns = ['RowId', 'RowDate', 'RowString']; 130 | $data = [ 131 | [$id1 = $faker->randomDigitNotNull, $date1 = $faker->date, $string1 = $faker->word], 132 | [$id2 = $faker->randomDigitNotNull, $date2 = $faker->date, $string2 = $faker->word], 133 | ]; 134 | $this->client->insert($this->tablename, $columns, $data); 135 | 136 | $statement = $this->client->select('SELECT * FROM '.$this->tablename); 137 | 138 | $this->assertEquals(2, $statement->rowsCount()); 139 | 140 | $all = $statement->fetchAll(); 141 | $first = current($all); 142 | $this->assertEquals($id1, $first->RowId); 143 | 144 | $last = end($all); 145 | $this->assertEquals($id2, $last->RowId); 146 | 147 | 148 | } 149 | 150 | 151 | public function insertBatch() 152 | { 153 | // $this->client->insert(); 154 | } 155 | 156 | 157 | } --------------------------------------------------------------------------------