├── .gitignore ├── bootstrap.php ├── composer.json ├── composer.lock ├── config.sample.php ├── examples └── blink.php ├── public └── index.html └── src ├── ConnectionConfig.php ├── PinController.php └── functions.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /config.php -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | loop(ReactAdapter::get()); 19 | Io\Event\Loop\Factory::set($reactLoop); 20 | 21 | if ($config->getRemotePort()) { 22 | return new Firmata\Board( 23 | new Io\Stream\Tcp($config->getRemoteHost(), $config->getRemotePort()) 24 | ); 25 | } 26 | 27 | return new Firmata\Board( 28 | Io\Stream\Serial\Factory::create($config->getDevice(), $config->getBaud()) 29 | ); -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kelunik/arduino", 3 | "description": "Arduino Demo App with Amp.", 4 | "type": "project", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Niklas Keller", 9 | "email": "me@kelunik.com" 10 | } 11 | ], 12 | "autoload": { 13 | "psr-4": { 14 | "Kelunik\\Arduino\\": "src" 15 | }, 16 | "files": [ 17 | "src/functions.php" 18 | ] 19 | }, 20 | "require": { 21 | "amphp/aerys": "0.8.x-dev", 22 | "amphp/amp": "^2.0", 23 | "carica/firmata": "^1.0", 24 | "carica/io": "^1.0", 25 | "amphp/react-adapter": "^1.1" 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#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "d607cc84177d90404ce413791f66cfe8", 8 | "packages": [ 9 | { 10 | "name": "amphp/aerys", 11 | "version": "0.8.x-dev", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/amphp/aerys.git", 15 | "reference": "3d6c08685ca817199d4ce3fb18464662596f1e47" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/amphp/aerys/zipball/3d6c08685ca817199d4ce3fb18464662596f1e47", 20 | "reference": "3d6c08685ca817199d4ce3fb18464662596f1e47", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "amphp/amp": "^2", 25 | "amphp/byte-stream": "^1", 26 | "amphp/file": "^0.2 || ^0.3", 27 | "amphp/http": "^1", 28 | "amphp/socket": "^0.10", 29 | "amphp/uri": "^0.1", 30 | "cash/lrucache": "^1.0", 31 | "league/climate": "^3", 32 | "league/uri-parser": "^1.3", 33 | "league/uri-schemes": "^1.1", 34 | "nikic/fast-route": "^1", 35 | "php": ">=7", 36 | "psr/http-message": "^1", 37 | "psr/log": "^1" 38 | }, 39 | "require-dev": { 40 | "amphp/artax": "^3", 41 | "amphp/phpunit-util": "^1", 42 | "friendsofphp/php-cs-fixer": "^2.3", 43 | "http2jp/hpack-test-case": "^1", 44 | "infection/infection": "^0.7.1", 45 | "league/uri-components": "^1.7", 46 | "phpunit/phpunit": "^6" 47 | }, 48 | "bin": [ 49 | "bin/aerys" 50 | ], 51 | "type": "library", 52 | "autoload": { 53 | "psr-4": { 54 | "Aerys\\": "lib/" 55 | }, 56 | "files": [ 57 | "lib/functions.php", 58 | "lib/constants.php", 59 | "lib/Internal/functions.php", 60 | "lib/Middleware/functions.php" 61 | ] 62 | }, 63 | "notification-url": "https://packagist.org/downloads/", 64 | "license": [ 65 | "MIT" 66 | ], 67 | "authors": [ 68 | { 69 | "name": "Niklas Keller", 70 | "email": "me@kelunik.com" 71 | }, 72 | { 73 | "name": "Daniel Lowrey", 74 | "email": "rdlowrey@php.net" 75 | }, 76 | { 77 | "name": "Bob Weinand" 78 | }, 79 | { 80 | "name": "Aaron Piotrowski", 81 | "email": "aaron@trowski.com" 82 | } 83 | ], 84 | "description": "A non-blocking HTTP/Websocket server", 85 | "homepage": "https://github.com/amphp/aerys", 86 | "keywords": [ 87 | "aerys", 88 | "amp", 89 | "amphp", 90 | "async", 91 | "http", 92 | "non-blocking", 93 | "server", 94 | "websocket" 95 | ], 96 | "time": "2018-02-27T22:25:35+00:00" 97 | }, 98 | { 99 | "name": "amphp/amp", 100 | "version": "v2.0.6", 101 | "source": { 102 | "type": "git", 103 | "url": "https://github.com/amphp/amp.git", 104 | "reference": "4a742beb59615f36ed998e2dc210e36576e44c44" 105 | }, 106 | "dist": { 107 | "type": "zip", 108 | "url": "https://api.github.com/repos/amphp/amp/zipball/4a742beb59615f36ed998e2dc210e36576e44c44", 109 | "reference": "4a742beb59615f36ed998e2dc210e36576e44c44", 110 | "shasum": "" 111 | }, 112 | "require": { 113 | "php": ">=7" 114 | }, 115 | "require-dev": { 116 | "amphp/phpunit-util": "^1", 117 | "friendsofphp/php-cs-fixer": "^2.3", 118 | "phpstan/phpstan": "^0.8.5", 119 | "phpunit/phpunit": "^6.0.9", 120 | "react/promise": "^2" 121 | }, 122 | "type": "library", 123 | "extra": { 124 | "branch-alias": { 125 | "dev-master": "2.0.x-dev" 126 | } 127 | }, 128 | "autoload": { 129 | "psr-4": { 130 | "Amp\\": "lib" 131 | }, 132 | "files": [ 133 | "lib/functions.php", 134 | "lib/Internal/functions.php" 135 | ] 136 | }, 137 | "notification-url": "https://packagist.org/downloads/", 138 | "license": [ 139 | "MIT" 140 | ], 141 | "authors": [ 142 | { 143 | "name": "Bob Weinand", 144 | "email": "bobwei9@hotmail.com" 145 | }, 146 | { 147 | "name": "Niklas Keller", 148 | "email": "me@kelunik.com" 149 | }, 150 | { 151 | "name": "Daniel Lowrey", 152 | "email": "rdlowrey@php.net" 153 | }, 154 | { 155 | "name": "Aaron Piotrowski", 156 | "email": "aaron@trowski.com" 157 | } 158 | ], 159 | "description": "A non-blocking concurrency framework for PHP applications.", 160 | "homepage": "http://amphp.org/amp", 161 | "keywords": [ 162 | "async", 163 | "asynchronous", 164 | "awaitable", 165 | "concurrency", 166 | "event", 167 | "event-loop", 168 | "future", 169 | "non-blocking", 170 | "promise" 171 | ], 172 | "time": "2018-01-27T19:18:05+00:00" 173 | }, 174 | { 175 | "name": "amphp/byte-stream", 176 | "version": "v1.2.4", 177 | "source": { 178 | "type": "git", 179 | "url": "https://github.com/amphp/byte-stream.git", 180 | "reference": "062f16d0c5bdaedcf9495928aa9324d6b028fe24" 181 | }, 182 | "dist": { 183 | "type": "zip", 184 | "url": "https://api.github.com/repos/amphp/byte-stream/zipball/062f16d0c5bdaedcf9495928aa9324d6b028fe24", 185 | "reference": "062f16d0c5bdaedcf9495928aa9324d6b028fe24", 186 | "shasum": "" 187 | }, 188 | "require": { 189 | "amphp/amp": "^2" 190 | }, 191 | "require-dev": { 192 | "amphp/phpunit-util": "^1", 193 | "friendsofphp/php-cs-fixer": "^2.3", 194 | "phpunit/phpunit": "^6" 195 | }, 196 | "type": "library", 197 | "autoload": { 198 | "psr-4": { 199 | "Amp\\ByteStream\\": "lib" 200 | }, 201 | "files": [ 202 | "lib/functions.php" 203 | ] 204 | }, 205 | "notification-url": "https://packagist.org/downloads/", 206 | "license": [ 207 | "MIT" 208 | ], 209 | "authors": [ 210 | { 211 | "name": "Niklas Keller", 212 | "email": "me@kelunik.com" 213 | }, 214 | { 215 | "name": "Aaron Piotrowski", 216 | "email": "aaron@trowski.com" 217 | } 218 | ], 219 | "description": "A stream abstraction to make working with non-blocking I/O simple.", 220 | "homepage": "http://amphp.org/byte-stream", 221 | "keywords": [ 222 | "amp", 223 | "amphp", 224 | "async", 225 | "io", 226 | "non-blocking", 227 | "stream" 228 | ], 229 | "time": "2018-03-09T16:40:36+00:00" 230 | }, 231 | { 232 | "name": "amphp/cache", 233 | "version": "v1.2.0", 234 | "source": { 235 | "type": "git", 236 | "url": "https://github.com/amphp/cache.git", 237 | "reference": "ab2339e465d9d383dc748f288d530fd7cd7aadea" 238 | }, 239 | "dist": { 240 | "type": "zip", 241 | "url": "https://api.github.com/repos/amphp/cache/zipball/ab2339e465d9d383dc748f288d530fd7cd7aadea", 242 | "reference": "ab2339e465d9d383dc748f288d530fd7cd7aadea", 243 | "shasum": "" 244 | }, 245 | "require": { 246 | "amphp/amp": "^2" 247 | }, 248 | "require-dev": { 249 | "amphp/phpunit-util": "^1", 250 | "friendsofphp/php-cs-fixer": "^2.3", 251 | "phpunit/phpunit": "^6" 252 | }, 253 | "type": "library", 254 | "autoload": { 255 | "psr-4": { 256 | "Amp\\Cache\\": "lib" 257 | } 258 | }, 259 | "notification-url": "https://packagist.org/downloads/", 260 | "license": [ 261 | "MIT" 262 | ], 263 | "authors": [ 264 | { 265 | "name": "Niklas Keller", 266 | "email": "me@kelunik.com" 267 | }, 268 | { 269 | "name": "Daniel Lowrey", 270 | "email": "rdlowrey@php.net" 271 | } 272 | ], 273 | "description": "A promise-aware caching API for Amp.", 274 | "homepage": "https://github.com/amphp/cache", 275 | "time": "2017-10-04T19:22:12+00:00" 276 | }, 277 | { 278 | "name": "amphp/dns", 279 | "version": "v0.9.12", 280 | "source": { 281 | "type": "git", 282 | "url": "https://github.com/amphp/dns.git", 283 | "reference": "2c8133a7b4267ba570f473abe4b08b01a0c8238a" 284 | }, 285 | "dist": { 286 | "type": "zip", 287 | "url": "https://api.github.com/repos/amphp/dns/zipball/2c8133a7b4267ba570f473abe4b08b01a0c8238a", 288 | "reference": "2c8133a7b4267ba570f473abe4b08b01a0c8238a", 289 | "shasum": "" 290 | }, 291 | "require": { 292 | "amphp/amp": "^2", 293 | "amphp/byte-stream": "^1.1", 294 | "amphp/cache": "^1.2", 295 | "amphp/file": "^0.2 || ^0.3", 296 | "amphp/parser": "^1", 297 | "amphp/uri": "^0.1", 298 | "amphp/windows-registry": "^0.3", 299 | "daverandom/libdns": "^2.0.1", 300 | "php": ">=7.0" 301 | }, 302 | "require-dev": { 303 | "amphp/phpunit-util": "^1", 304 | "friendsofphp/php-cs-fixer": "^2.3", 305 | "phpunit/phpunit": "^6" 306 | }, 307 | "type": "library", 308 | "autoload": { 309 | "psr-4": { 310 | "Amp\\Dns\\": "lib" 311 | }, 312 | "files": [ 313 | "lib/functions.php" 314 | ] 315 | }, 316 | "notification-url": "https://packagist.org/downloads/", 317 | "license": [ 318 | "MIT" 319 | ], 320 | "authors": [ 321 | { 322 | "name": "Bob Weinand", 323 | "email": "bobwei9@hotmail.com" 324 | }, 325 | { 326 | "name": "Niklas Keller", 327 | "email": "me@kelunik.com" 328 | }, 329 | { 330 | "name": "Daniel Lowrey", 331 | "email": "rdlowrey@php.net" 332 | }, 333 | { 334 | "name": "Chris Wright", 335 | "email": "addr@daverandom.com" 336 | }, 337 | { 338 | "name": "Aaron Piotrowski", 339 | "email": "aaron@trowski.com" 340 | } 341 | ], 342 | "description": "Async DNS resolution for Amp.", 343 | "homepage": "https://github.com/amphp/dns", 344 | "keywords": [ 345 | "amp", 346 | "amphp", 347 | "async", 348 | "client", 349 | "dns", 350 | "resolve" 351 | ], 352 | "time": "2018-01-10T16:26:11+00:00" 353 | }, 354 | { 355 | "name": "amphp/file", 356 | "version": "v0.3.0", 357 | "source": { 358 | "type": "git", 359 | "url": "https://github.com/amphp/file.git", 360 | "reference": "fb58fe8dd5d1eeae5af152bf9e37731de5423caf" 361 | }, 362 | "dist": { 363 | "type": "zip", 364 | "url": "https://api.github.com/repos/amphp/file/zipball/fb58fe8dd5d1eeae5af152bf9e37731de5423caf", 365 | "reference": "fb58fe8dd5d1eeae5af152bf9e37731de5423caf", 366 | "shasum": "" 367 | }, 368 | "require": { 369 | "amphp/amp": "^2", 370 | "amphp/byte-stream": "^1", 371 | "amphp/parallel": "^0.2" 372 | }, 373 | "require-dev": { 374 | "amphp/phpunit-util": "^1", 375 | "friendsofphp/php-cs-fixer": "^2.3", 376 | "phpunit/phpunit": "^6" 377 | }, 378 | "type": "library", 379 | "autoload": { 380 | "psr-4": { 381 | "Amp\\File\\": "lib" 382 | }, 383 | "files": [ 384 | "lib/functions.php" 385 | ] 386 | }, 387 | "notification-url": "https://packagist.org/downloads/", 388 | "license": [ 389 | "MIT" 390 | ], 391 | "authors": [ 392 | { 393 | "name": "Niklas Keller", 394 | "email": "me@kelunik.com" 395 | }, 396 | { 397 | "name": "Daniel Lowrey", 398 | "email": "rdlowrey@php.net" 399 | }, 400 | { 401 | "name": "Aaron Piotrowski", 402 | "email": "aaron@trowski.com" 403 | } 404 | ], 405 | "description": "Allows non-blocking access to the filesystem for Amp.", 406 | "homepage": "https://github.com/amphp/file", 407 | "keywords": [ 408 | "amp", 409 | "amphp", 410 | "async", 411 | "disk", 412 | "file", 413 | "filesystem", 414 | "io", 415 | "non-blocking", 416 | "static" 417 | ], 418 | "time": "2017-12-15T04:36:16+00:00" 419 | }, 420 | { 421 | "name": "amphp/hpack", 422 | "version": "v3.2.1", 423 | "source": { 424 | "type": "git", 425 | "url": "https://github.com/amphp/hpack.git", 426 | "reference": "4f293064b15682a2b178b1367ddf0b8b5feb0239" 427 | }, 428 | "dist": { 429 | "type": "zip", 430 | "url": "https://api.github.com/repos/amphp/hpack/zipball/4f293064b15682a2b178b1367ddf0b8b5feb0239", 431 | "reference": "4f293064b15682a2b178b1367ddf0b8b5feb0239", 432 | "shasum": "" 433 | }, 434 | "require": { 435 | "php": ">=7.1" 436 | }, 437 | "require-dev": { 438 | "amphp/php-cs-fixer-config": "^2", 439 | "http2jp/hpack-test-case": "^1", 440 | "nikic/php-fuzzer": "^0.0.10", 441 | "phpunit/phpunit": "^7 | ^8 | ^9" 442 | }, 443 | "type": "library", 444 | "extra": { 445 | "branch-alias": { 446 | "dev-master": "3.x-dev" 447 | } 448 | }, 449 | "autoload": { 450 | "psr-4": { 451 | "Amp\\Http\\": "src" 452 | } 453 | }, 454 | "notification-url": "https://packagist.org/downloads/", 455 | "license": [ 456 | "MIT" 457 | ], 458 | "authors": [ 459 | { 460 | "name": "Daniel Lowrey", 461 | "email": "rdlowrey@php.net" 462 | }, 463 | { 464 | "name": "Bob Weinand" 465 | }, 466 | { 467 | "name": "Niklas Keller", 468 | "email": "me@kelunik.com" 469 | }, 470 | { 471 | "name": "Aaron Piotrowski", 472 | "email": "aaron@trowski.com" 473 | } 474 | ], 475 | "description": "HTTP/2 HPack implementation.", 476 | "homepage": "https://github.com/amphp/hpack", 477 | "keywords": [ 478 | "headers", 479 | "hpack", 480 | "http-2" 481 | ], 482 | "support": { 483 | "issues": "https://github.com/amphp/hpack/issues", 484 | "source": "https://github.com/amphp/hpack/tree/v3.2.1" 485 | }, 486 | "funding": [ 487 | { 488 | "url": "https://github.com/amphp", 489 | "type": "github" 490 | } 491 | ], 492 | "time": "2024-03-21T19:00:16+00:00" 493 | }, 494 | { 495 | "name": "amphp/http", 496 | "version": "v1.7.3", 497 | "source": { 498 | "type": "git", 499 | "url": "https://github.com/amphp/http.git", 500 | "reference": "3a33e68a3b53f7279217238e89748cf0cb30b8a6" 501 | }, 502 | "dist": { 503 | "type": "zip", 504 | "url": "https://api.github.com/repos/amphp/http/zipball/3a33e68a3b53f7279217238e89748cf0cb30b8a6", 505 | "reference": "3a33e68a3b53f7279217238e89748cf0cb30b8a6", 506 | "shasum": "" 507 | }, 508 | "require": { 509 | "amphp/hpack": "^3", 510 | "php": ">=7.1" 511 | }, 512 | "require-dev": { 513 | "amphp/php-cs-fixer-config": "2.x-dev#3c24119d0377eed2093d5c0f0541478cb75ea72d", 514 | "phpunit/phpunit": "^9 || ^8 || ^7" 515 | }, 516 | "type": "library", 517 | "extra": { 518 | "branch-alias": { 519 | "dev-master": "1.x-dev" 520 | } 521 | }, 522 | "autoload": { 523 | "files": [ 524 | "src/functions.php" 525 | ], 526 | "psr-4": { 527 | "Amp\\Http\\": "src" 528 | } 529 | }, 530 | "notification-url": "https://packagist.org/downloads/", 531 | "license": [ 532 | "MIT" 533 | ], 534 | "authors": [ 535 | { 536 | "name": "Niklas Keller", 537 | "email": "me@kelunik.com" 538 | } 539 | ], 540 | "description": "Basic HTTP primitives which can be shared by servers and clients.", 541 | "support": { 542 | "issues": "https://github.com/amphp/http/issues", 543 | "source": "https://github.com/amphp/http/tree/v1.7.3" 544 | }, 545 | "funding": [ 546 | { 547 | "url": "https://github.com/amphp", 548 | "type": "github" 549 | } 550 | ], 551 | "time": "2024-04-03T17:45:14+00:00" 552 | }, 553 | { 554 | "name": "amphp/parallel", 555 | "version": "v0.2.3", 556 | "source": { 557 | "type": "git", 558 | "url": "https://github.com/amphp/parallel.git", 559 | "reference": "11a3e27db536f70984ee3fc988c22a5b2aa300ac" 560 | }, 561 | "dist": { 562 | "type": "zip", 563 | "url": "https://api.github.com/repos/amphp/parallel/zipball/11a3e27db536f70984ee3fc988c22a5b2aa300ac", 564 | "reference": "11a3e27db536f70984ee3fc988c22a5b2aa300ac", 565 | "shasum": "" 566 | }, 567 | "require": { 568 | "amphp/amp": "^2", 569 | "amphp/byte-stream": "^1.2", 570 | "amphp/parser": "^1", 571 | "amphp/process": "^0.2 || ^0.3", 572 | "amphp/sync": "^1.0.1" 573 | }, 574 | "require-dev": { 575 | "amphp/phpunit-util": "^1", 576 | "friendsofphp/php-cs-fixer": "^2.3", 577 | "phpunit/phpunit": "^6" 578 | }, 579 | "suggest": { 580 | "ext-pthreads": "Required for thread contexts" 581 | }, 582 | "type": "library", 583 | "autoload": { 584 | "psr-4": { 585 | "Amp\\Parallel\\": "lib" 586 | }, 587 | "files": [ 588 | "lib/Worker/functions.php" 589 | ] 590 | }, 591 | "notification-url": "https://packagist.org/downloads/", 592 | "license": [ 593 | "MIT" 594 | ], 595 | "authors": [ 596 | { 597 | "name": "Stephen Coakley", 598 | "email": "me@stephencoakley.com" 599 | }, 600 | { 601 | "name": "Aaron Piotrowski", 602 | "email": "aaron@trowski.com" 603 | } 604 | ], 605 | "description": "Parallel processing component for Amp.", 606 | "homepage": "https://github.com/amphp/parallel", 607 | "keywords": [ 608 | "async", 609 | "asynchronous", 610 | "concurrent", 611 | "multi-processing", 612 | "multi-threading" 613 | ], 614 | "time": "2018-01-31T17:31:36+00:00" 615 | }, 616 | { 617 | "name": "amphp/parser", 618 | "version": "v1.0.0", 619 | "source": { 620 | "type": "git", 621 | "url": "https://github.com/amphp/parser.git", 622 | "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1" 623 | }, 624 | "dist": { 625 | "type": "zip", 626 | "url": "https://api.github.com/repos/amphp/parser/zipball/f83e68f03d5b8e8e0365b8792985a7f341c57ae1", 627 | "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1", 628 | "shasum": "" 629 | }, 630 | "require": { 631 | "php": ">=7" 632 | }, 633 | "require-dev": { 634 | "friendsofphp/php-cs-fixer": "^2.3", 635 | "phpunit/phpunit": "^6" 636 | }, 637 | "type": "library", 638 | "autoload": { 639 | "psr-4": { 640 | "Amp\\Parser\\": "lib" 641 | } 642 | }, 643 | "notification-url": "https://packagist.org/downloads/", 644 | "license": [ 645 | "MIT" 646 | ], 647 | "authors": [ 648 | { 649 | "name": "Niklas Keller", 650 | "email": "me@kelunik.com" 651 | }, 652 | { 653 | "name": "Aaron Piotrowski", 654 | "email": "aaron@trowski.com" 655 | } 656 | ], 657 | "description": "A generator parser to make streaming parsers simple.", 658 | "homepage": "https://github.com/amphp/parser", 659 | "keywords": [ 660 | "async", 661 | "non-blocking", 662 | "parser", 663 | "stream" 664 | ], 665 | "time": "2017-06-06T05:29:10+00:00" 666 | }, 667 | { 668 | "name": "amphp/process", 669 | "version": "v0.3.2", 670 | "source": { 671 | "type": "git", 672 | "url": "https://github.com/amphp/process.git", 673 | "reference": "239605b2e8a9a7958563119e9b03fdabeb0ad4cc" 674 | }, 675 | "dist": { 676 | "type": "zip", 677 | "url": "https://api.github.com/repos/amphp/process/zipball/239605b2e8a9a7958563119e9b03fdabeb0ad4cc", 678 | "reference": "239605b2e8a9a7958563119e9b03fdabeb0ad4cc", 679 | "shasum": "" 680 | }, 681 | "require": { 682 | "amphp/amp": "^2", 683 | "amphp/byte-stream": "^1", 684 | "php": ">=7" 685 | }, 686 | "require-dev": { 687 | "amphp/phpunit-util": "^1", 688 | "friendsofphp/php-cs-fixer": "^2.3", 689 | "phpunit/phpunit": "^6" 690 | }, 691 | "type": "library", 692 | "autoload": { 693 | "psr-4": { 694 | "Amp\\Process\\": "lib" 695 | }, 696 | "files": [ 697 | "lib/constants.php" 698 | ] 699 | }, 700 | "notification-url": "https://packagist.org/downloads/", 701 | "license": [ 702 | "MIT" 703 | ], 704 | "authors": [ 705 | { 706 | "name": "Bob Weinand", 707 | "email": "bobwei9@hotmail.com" 708 | }, 709 | { 710 | "name": "Niklas Keller", 711 | "email": "me@kelunik.com" 712 | }, 713 | { 714 | "name": "Aaron Piotrowski", 715 | "email": "aaron@trowski.com" 716 | } 717 | ], 718 | "description": "Asynchronous process manager.", 719 | "homepage": "https://github.com/amphp/process", 720 | "time": "2018-03-08T15:09:10+00:00" 721 | }, 722 | { 723 | "name": "amphp/react-adapter", 724 | "version": "v1.1.0", 725 | "source": { 726 | "type": "git", 727 | "url": "https://github.com/amphp/react-adapter.git", 728 | "reference": "c54710930add61eae97c596e3d2d76830e394ae9" 729 | }, 730 | "dist": { 731 | "type": "zip", 732 | "url": "https://api.github.com/repos/amphp/react-adapter/zipball/c54710930add61eae97c596e3d2d76830e394ae9", 733 | "reference": "c54710930add61eae97c596e3d2d76830e394ae9", 734 | "shasum": "" 735 | }, 736 | "require": { 737 | "amphp/amp": "^2", 738 | "react/event-loop": "^0.4.2" 739 | }, 740 | "require-dev": { 741 | "friendsofphp/php-cs-fixer": "^2.3", 742 | "phpunit/phpunit": "^4.8" 743 | }, 744 | "type": "library", 745 | "autoload": { 746 | "psr-4": { 747 | "Amp\\ReactAdapter\\": "lib" 748 | } 749 | }, 750 | "notification-url": "https://packagist.org/downloads/", 751 | "license": [ 752 | "MIT" 753 | ], 754 | "authors": [ 755 | { 756 | "name": "Niklas Keller", 757 | "email": "me@kelunik.com" 758 | } 759 | ], 760 | "description": "Adapter to make any ReactPHP library compatible with Amp.", 761 | "time": "2017-09-14T15:38:41+00:00" 762 | }, 763 | { 764 | "name": "amphp/socket", 765 | "version": "v0.10.5", 766 | "source": { 767 | "type": "git", 768 | "url": "https://github.com/amphp/socket.git", 769 | "reference": "937aff6eaa08cd4da03d475d98bcf911bbb854ab" 770 | }, 771 | "dist": { 772 | "type": "zip", 773 | "url": "https://api.github.com/repos/amphp/socket/zipball/937aff6eaa08cd4da03d475d98bcf911bbb854ab", 774 | "reference": "937aff6eaa08cd4da03d475d98bcf911bbb854ab", 775 | "shasum": "" 776 | }, 777 | "require": { 778 | "amphp/amp": "^2", 779 | "amphp/byte-stream": "^1.1", 780 | "amphp/dns": "^0.9", 781 | "amphp/uri": "^0.1", 782 | "php": ">=7.0" 783 | }, 784 | "require-dev": { 785 | "amphp/phpunit-util": "^1", 786 | "friendsofphp/php-cs-fixer": "^2.3", 787 | "phpunit/phpunit": "^6" 788 | }, 789 | "type": "library", 790 | "autoload": { 791 | "psr-4": { 792 | "Amp\\Socket\\": "lib" 793 | }, 794 | "files": [ 795 | "lib/functions.php", 796 | "lib/Internal/functions.php" 797 | ] 798 | }, 799 | "notification-url": "https://packagist.org/downloads/", 800 | "license": [ 801 | "MIT" 802 | ], 803 | "authors": [ 804 | { 805 | "name": "Niklas Keller", 806 | "email": "me@kelunik.com" 807 | }, 808 | { 809 | "name": "Daniel Lowrey", 810 | "email": "rdlowrey@gmail.com" 811 | }, 812 | { 813 | "name": "Aaron Piotrowski", 814 | "email": "aaron@trowski.com" 815 | } 816 | ], 817 | "description": "Async socket connection / server tools for Amp.", 818 | "homepage": "https://github.com/amphp/socket", 819 | "keywords": [ 820 | "amp", 821 | "async", 822 | "encryption", 823 | "non-blocking", 824 | "sockets", 825 | "tcp", 826 | "tls" 827 | ], 828 | "time": "2017-12-19T18:19:46+00:00" 829 | }, 830 | { 831 | "name": "amphp/sync", 832 | "version": "v1.0.1", 833 | "source": { 834 | "type": "git", 835 | "url": "https://github.com/amphp/sync.git", 836 | "reference": "a1d8f244eb19e3e2a96abc4686cebc80995bbc90" 837 | }, 838 | "dist": { 839 | "type": "zip", 840 | "url": "https://api.github.com/repos/amphp/sync/zipball/a1d8f244eb19e3e2a96abc4686cebc80995bbc90", 841 | "reference": "a1d8f244eb19e3e2a96abc4686cebc80995bbc90", 842 | "shasum": "" 843 | }, 844 | "require": { 845 | "amphp/amp": "^2" 846 | }, 847 | "require-dev": { 848 | "amphp/phpunit-util": "^1", 849 | "friendsofphp/php-cs-fixer": "^2.3", 850 | "phpunit/phpunit": "^6" 851 | }, 852 | "type": "library", 853 | "autoload": { 854 | "psr-4": { 855 | "Amp\\Sync\\": "lib" 856 | }, 857 | "files": [ 858 | "lib/functions.php" 859 | ] 860 | }, 861 | "notification-url": "https://packagist.org/downloads/", 862 | "license": [ 863 | "MIT" 864 | ], 865 | "authors": [ 866 | { 867 | "name": "Stephen Coakley", 868 | "email": "me@stephencoakley.com" 869 | }, 870 | { 871 | "name": "Aaron Piotrowski", 872 | "email": "aaron@trowski.com" 873 | } 874 | ], 875 | "description": "Mutex, Semaphore, and other synchronization tools for Amp.", 876 | "homepage": "https://github.com/amphp/sync", 877 | "keywords": [ 878 | "async", 879 | "asynchronous", 880 | "mutex", 881 | "semaphore", 882 | "synchronization" 883 | ], 884 | "time": "2017-11-29T21:48:53+00:00" 885 | }, 886 | { 887 | "name": "amphp/uri", 888 | "version": "v0.1.3", 889 | "source": { 890 | "type": "git", 891 | "url": "https://github.com/amphp/uri.git", 892 | "reference": "b857ba4df3cf0852302ba1637fccce4ce1205241" 893 | }, 894 | "dist": { 895 | "type": "zip", 896 | "url": "https://api.github.com/repos/amphp/uri/zipball/b857ba4df3cf0852302ba1637fccce4ce1205241", 897 | "reference": "b857ba4df3cf0852302ba1637fccce4ce1205241", 898 | "shasum": "" 899 | }, 900 | "require-dev": { 901 | "friendsofphp/php-cs-fixer": "^2.3", 902 | "phpunit/phpunit": "^6" 903 | }, 904 | "type": "library", 905 | "autoload": { 906 | "psr-4": { 907 | "Amp\\Uri\\": "src" 908 | }, 909 | "files": [ 910 | "src/functions.php" 911 | ] 912 | }, 913 | "notification-url": "https://packagist.org/downloads/", 914 | "license": [ 915 | "MIT" 916 | ], 917 | "authors": [ 918 | { 919 | "name": "Niklas Keller", 920 | "email": "me@kelunik.com" 921 | }, 922 | { 923 | "name": "Daniel Lowrey" 924 | } 925 | ], 926 | "description": "Uri Parser and Resolver.", 927 | "homepage": "https://github.com/amphp/uri", 928 | "time": "2017-10-23T12:40:35+00:00" 929 | }, 930 | { 931 | "name": "amphp/windows-registry", 932 | "version": "v0.3.1", 933 | "source": { 934 | "type": "git", 935 | "url": "https://github.com/amphp/windows-registry.git", 936 | "reference": "46ba1463dfffc8081b4b483fac05d3f51ecb1d87" 937 | }, 938 | "dist": { 939 | "type": "zip", 940 | "url": "https://api.github.com/repos/amphp/windows-registry/zipball/46ba1463dfffc8081b4b483fac05d3f51ecb1d87", 941 | "reference": "46ba1463dfffc8081b4b483fac05d3f51ecb1d87", 942 | "shasum": "" 943 | }, 944 | "require": { 945 | "amphp/amp": "^2", 946 | "amphp/process": "^0.2 || ^0.3" 947 | }, 948 | "require-dev": { 949 | "friendsofphp/php-cs-fixer": "^2.3" 950 | }, 951 | "type": "library", 952 | "autoload": { 953 | "psr-4": { 954 | "Amp\\WindowsRegistry\\": "lib" 955 | } 956 | }, 957 | "notification-url": "https://packagist.org/downloads/", 958 | "license": [ 959 | "MIT" 960 | ], 961 | "authors": [ 962 | { 963 | "name": "Niklas Keller", 964 | "email": "me@kelunik.com" 965 | } 966 | ], 967 | "description": "Windows Registry Reader.", 968 | "time": "2017-12-11T08:35:51+00:00" 969 | }, 970 | { 971 | "name": "carica/firmata", 972 | "version": "1.0.0", 973 | "source": { 974 | "type": "git", 975 | "url": "https://github.com/ThomasWeinert/carica-firmata.git", 976 | "reference": "b36ea89530951b0f51981e10771f3189a1442ef5" 977 | }, 978 | "dist": { 979 | "type": "zip", 980 | "url": "https://api.github.com/repos/ThomasWeinert/carica-firmata/zipball/b36ea89530951b0f51981e10771f3189a1442ef5", 981 | "reference": "b36ea89530951b0f51981e10771f3189a1442ef5", 982 | "shasum": "" 983 | }, 984 | "require": { 985 | "carica/io": "^1.0", 986 | "php": ">=7.1" 987 | }, 988 | "provide": { 989 | "carica/io-devices": "0.0.1" 990 | }, 991 | "type": "library", 992 | "autoload": { 993 | "psr-4": { 994 | "Carica\\Firmata\\": "src/" 995 | } 996 | }, 997 | "notification-url": "https://packagist.org/downloads/", 998 | "license": [ 999 | "MIT" 1000 | ], 1001 | "authors": [ 1002 | { 1003 | "name": "Thomas Weinert", 1004 | "email": "thomas@weinert.info" 1005 | } 1006 | ], 1007 | "description": "Firmata client library", 1008 | "homepage": "https://github.com/ThomasWeinert/carica-firmata", 1009 | "keywords": [ 1010 | "arduino", 1011 | "firmata" 1012 | ], 1013 | "time": "2018-03-03T13:48:40+00:00" 1014 | }, 1015 | { 1016 | "name": "carica/io", 1017 | "version": "1.0.0", 1018 | "source": { 1019 | "type": "git", 1020 | "url": "https://github.com/ThomasWeinert/carica-io.git", 1021 | "reference": "8f996060d0bd01adda12c7e8e595ed962d8c71fb" 1022 | }, 1023 | "dist": { 1024 | "type": "zip", 1025 | "url": "https://api.github.com/repos/ThomasWeinert/carica-io/zipball/8f996060d0bd01adda12c7e8e595ed962d8c71fb", 1026 | "reference": "8f996060d0bd01adda12c7e8e595ed962d8c71fb", 1027 | "shasum": "" 1028 | }, 1029 | "require": { 1030 | "php": ">=7.1" 1031 | }, 1032 | "type": "library", 1033 | "autoload": { 1034 | "psr-4": { 1035 | "Carica\\Io\\": "src/" 1036 | } 1037 | }, 1038 | "notification-url": "https://packagist.org/downloads/", 1039 | "license": [ 1040 | "MIT" 1041 | ], 1042 | "authors": [ 1043 | { 1044 | "name": "Thomas Weinert", 1045 | "email": "thomas@weinert.info" 1046 | } 1047 | ], 1048 | "description": "Non blocking I/O for PHP", 1049 | "homepage": "https://github.com/ThomasWeinert/carica-io", 1050 | "keywords": [ 1051 | "asynchronous-io", 1052 | "non-blocking-io" 1053 | ], 1054 | "time": "2018-03-02T16:29:58+00:00" 1055 | }, 1056 | { 1057 | "name": "cash/lrucache", 1058 | "version": "1.0.0", 1059 | "source": { 1060 | "type": "git", 1061 | "url": "https://github.com/cash/LRUCache.git", 1062 | "reference": "4fa4c6834cec59690b43526c4da41d6153026289" 1063 | }, 1064 | "dist": { 1065 | "type": "zip", 1066 | "url": "https://api.github.com/repos/cash/LRUCache/zipball/4fa4c6834cec59690b43526c4da41d6153026289", 1067 | "reference": "4fa4c6834cec59690b43526c4da41d6153026289", 1068 | "shasum": "" 1069 | }, 1070 | "require": { 1071 | "php": ">=5.3.0" 1072 | }, 1073 | "type": "library", 1074 | "autoload": { 1075 | "psr-0": { 1076 | "cash": "src/" 1077 | } 1078 | }, 1079 | "notification-url": "https://packagist.org/downloads/", 1080 | "license": [ 1081 | "MIT" 1082 | ], 1083 | "authors": [ 1084 | { 1085 | "name": "Cash Costello", 1086 | "email": "cash.costello@gmail.com" 1087 | } 1088 | ], 1089 | "description": "An efficient memory-based Least Recently Used (LRU) cache", 1090 | "homepage": "https://github.com/cash/LRUCache", 1091 | "keywords": [ 1092 | "cache", 1093 | "lru" 1094 | ], 1095 | "time": "2013-09-20T18:59:12+00:00" 1096 | }, 1097 | { 1098 | "name": "daverandom/libdns", 1099 | "version": "v2.0.1", 1100 | "source": { 1101 | "type": "git", 1102 | "url": "https://github.com/DaveRandom/LibDNS.git", 1103 | "reference": "1ecd825b6fa9bb3fddc07751997e29dc78749b95" 1104 | }, 1105 | "dist": { 1106 | "type": "zip", 1107 | "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/1ecd825b6fa9bb3fddc07751997e29dc78749b95", 1108 | "reference": "1ecd825b6fa9bb3fddc07751997e29dc78749b95", 1109 | "shasum": "" 1110 | }, 1111 | "require": { 1112 | "ext-ctype": "*", 1113 | "php": ">=7.0" 1114 | }, 1115 | "suggest": { 1116 | "ext-intl": "Required for IDN support" 1117 | }, 1118 | "type": "library", 1119 | "autoload": { 1120 | "psr-4": { 1121 | "LibDNS\\": "src/" 1122 | }, 1123 | "files": [ 1124 | "src/functions.php" 1125 | ] 1126 | }, 1127 | "notification-url": "https://packagist.org/downloads/", 1128 | "license": [ 1129 | "MIT" 1130 | ], 1131 | "description": "DNS protocol implementation written in pure PHP", 1132 | "keywords": [ 1133 | "dns" 1134 | ], 1135 | "time": "2018-01-10T15:56:17+00:00" 1136 | }, 1137 | { 1138 | "name": "league/climate", 1139 | "version": "3.2.4", 1140 | "source": { 1141 | "type": "git", 1142 | "url": "https://github.com/thephpleague/climate.git", 1143 | "reference": "ca70f67f7739cca823eba0ad98f8130bca226bf0" 1144 | }, 1145 | "dist": { 1146 | "type": "zip", 1147 | "url": "https://api.github.com/repos/thephpleague/climate/zipball/ca70f67f7739cca823eba0ad98f8130bca226bf0", 1148 | "reference": "ca70f67f7739cca823eba0ad98f8130bca226bf0", 1149 | "shasum": "" 1150 | }, 1151 | "require": { 1152 | "php": ">=5.4.0", 1153 | "seld/cli-prompt": "~1.0" 1154 | }, 1155 | "require-dev": { 1156 | "mikey179/vfsstream": "~1.4", 1157 | "mockery/mockery": "~0.9", 1158 | "phpunit/phpunit": "~4.6" 1159 | }, 1160 | "type": "library", 1161 | "autoload": { 1162 | "psr-4": { 1163 | "League\\CLImate\\": "src/" 1164 | } 1165 | }, 1166 | "notification-url": "https://packagist.org/downloads/", 1167 | "license": [ 1168 | "MIT" 1169 | ], 1170 | "authors": [ 1171 | { 1172 | "name": "Joe Tannenbaum", 1173 | "email": "hey@joe.codes", 1174 | "homepage": "http://joe.codes/", 1175 | "role": "Developer" 1176 | } 1177 | ], 1178 | "description": "PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.", 1179 | "keywords": [ 1180 | "cli", 1181 | "colors", 1182 | "command", 1183 | "php", 1184 | "terminal" 1185 | ], 1186 | "time": "2016-10-30T22:18:25+00:00" 1187 | }, 1188 | { 1189 | "name": "league/uri-interfaces", 1190 | "version": "1.0.0", 1191 | "source": { 1192 | "type": "git", 1193 | "url": "https://github.com/thephpleague/uri-interfaces.git", 1194 | "reference": "dcc0be58e8b35a726274249e5eee053be1a56b66" 1195 | }, 1196 | "dist": { 1197 | "type": "zip", 1198 | "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/dcc0be58e8b35a726274249e5eee053be1a56b66", 1199 | "reference": "dcc0be58e8b35a726274249e5eee053be1a56b66", 1200 | "shasum": "" 1201 | }, 1202 | "require": { 1203 | "php": ">=5.3.0" 1204 | }, 1205 | "require-dev": { 1206 | "friendsofphp/php-cs-fixer": "^1.0.0" 1207 | }, 1208 | "type": "library", 1209 | "extra": { 1210 | "branch-alias": { 1211 | "dev-master": "1.0.x-dev" 1212 | } 1213 | }, 1214 | "autoload": { 1215 | "psr-4": { 1216 | "League\\Uri\\Interfaces\\": "src/" 1217 | } 1218 | }, 1219 | "notification-url": "https://packagist.org/downloads/", 1220 | "license": [ 1221 | "MIT" 1222 | ], 1223 | "authors": [ 1224 | { 1225 | "name": "Ignace Nyamagana Butera", 1226 | "email": "nyamsprod@gmail.com", 1227 | "homepage": "https://nyamsprod.com" 1228 | } 1229 | ], 1230 | "description": "Common interface for URI representation", 1231 | "homepage": "http://github.com/thephpleague/uri-interfaces", 1232 | "keywords": [ 1233 | "rfc3986", 1234 | "rfc3987", 1235 | "uri", 1236 | "url" 1237 | ], 1238 | "time": "2017-01-04T08:02:42+00:00" 1239 | }, 1240 | { 1241 | "name": "league/uri-parser", 1242 | "version": "1.3.0", 1243 | "source": { 1244 | "type": "git", 1245 | "url": "https://github.com/thephpleague/uri-parser.git", 1246 | "reference": "f3c99b77f0cba4446dad2eca8c57227fcda0f39b" 1247 | }, 1248 | "dist": { 1249 | "type": "zip", 1250 | "url": "https://api.github.com/repos/thephpleague/uri-parser/zipball/f3c99b77f0cba4446dad2eca8c57227fcda0f39b", 1251 | "reference": "f3c99b77f0cba4446dad2eca8c57227fcda0f39b", 1252 | "shasum": "" 1253 | }, 1254 | "require": { 1255 | "ext-intl": "*", 1256 | "php": ">=7.0.0" 1257 | }, 1258 | "require-dev": { 1259 | "friendsofphp/php-cs-fixer": "^2.0", 1260 | "phpunit/phpunit": "^6.0" 1261 | }, 1262 | "suggest": { 1263 | "league/uri-schemes": "Allow validating and normalizing URI parsing results" 1264 | }, 1265 | "type": "library", 1266 | "extra": { 1267 | "branch-alias": { 1268 | "dev-master": "1.x-dev" 1269 | } 1270 | }, 1271 | "autoload": { 1272 | "psr-4": { 1273 | "League\\Uri\\": "src" 1274 | }, 1275 | "files": [ 1276 | "src/functions_include.php" 1277 | ] 1278 | }, 1279 | "notification-url": "https://packagist.org/downloads/", 1280 | "license": [ 1281 | "MIT" 1282 | ], 1283 | "authors": [ 1284 | { 1285 | "name": "Ignace Nyamagana Butera", 1286 | "email": "nyamsprod@gmail.com", 1287 | "homepage": "https://nyamsprod.com" 1288 | } 1289 | ], 1290 | "description": "userland URI parser RFC 3986 compliant", 1291 | "homepage": "https://github.com/thephpleague/uri-parser", 1292 | "keywords": [ 1293 | "parse_url", 1294 | "parser", 1295 | "rfc3986", 1296 | "uri", 1297 | "url" 1298 | ], 1299 | "time": "2017-12-01T11:53:01+00:00" 1300 | }, 1301 | { 1302 | "name": "league/uri-schemes", 1303 | "version": "1.1.1", 1304 | "source": { 1305 | "type": "git", 1306 | "url": "https://github.com/thephpleague/uri-schemes.git", 1307 | "reference": "fd2448689186bfff27a112aa21d82931f4b366c5" 1308 | }, 1309 | "dist": { 1310 | "type": "zip", 1311 | "url": "https://api.github.com/repos/thephpleague/uri-schemes/zipball/fd2448689186bfff27a112aa21d82931f4b366c5", 1312 | "reference": "fd2448689186bfff27a112aa21d82931f4b366c5", 1313 | "shasum": "" 1314 | }, 1315 | "require": { 1316 | "ext-fileinfo": "*", 1317 | "ext-intl": "*", 1318 | "ext-mbstring": "*", 1319 | "league/uri-interfaces": "^1.0", 1320 | "league/uri-parser": "^1.3.0", 1321 | "php": ">=7.0.13", 1322 | "psr/http-message": "^1.0" 1323 | }, 1324 | "require-dev": { 1325 | "friendsofphp/php-cs-fixer": "^2.0", 1326 | "phpunit/phpunit": "^6.0" 1327 | }, 1328 | "suggest": { 1329 | "league/uri-manipulations": "Needed to easily manipulate URI objects" 1330 | }, 1331 | "type": "library", 1332 | "extra": { 1333 | "branch-alias": { 1334 | "dev-master": "1.0.x-dev" 1335 | } 1336 | }, 1337 | "autoload": { 1338 | "psr-4": { 1339 | "League\\Uri\\": "src" 1340 | }, 1341 | "files": [ 1342 | "src/functions_include.php" 1343 | ] 1344 | }, 1345 | "notification-url": "https://packagist.org/downloads/", 1346 | "license": [ 1347 | "MIT" 1348 | ], 1349 | "authors": [ 1350 | { 1351 | "name": "Ignace Nyamagana Butera", 1352 | "email": "nyamsprod@gmail.com", 1353 | "homepage": "https://nyamsprod.com" 1354 | } 1355 | ], 1356 | "description": "URI manipulation library", 1357 | "homepage": "http://uri.thephpleague.com", 1358 | "keywords": [ 1359 | "data-uri", 1360 | "file", 1361 | "ftp", 1362 | "http", 1363 | "https", 1364 | "parse_url", 1365 | "psr-7", 1366 | "rfc3986", 1367 | "uri", 1368 | "url", 1369 | "ws", 1370 | "wss" 1371 | ], 1372 | "time": "2017-12-01T12:05:37+00:00" 1373 | }, 1374 | { 1375 | "name": "nikic/fast-route", 1376 | "version": "v1.3.0", 1377 | "source": { 1378 | "type": "git", 1379 | "url": "https://github.com/nikic/FastRoute.git", 1380 | "reference": "181d480e08d9476e61381e04a71b34dc0432e812" 1381 | }, 1382 | "dist": { 1383 | "type": "zip", 1384 | "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", 1385 | "reference": "181d480e08d9476e61381e04a71b34dc0432e812", 1386 | "shasum": "" 1387 | }, 1388 | "require": { 1389 | "php": ">=5.4.0" 1390 | }, 1391 | "require-dev": { 1392 | "phpunit/phpunit": "^4.8.35|~5.7" 1393 | }, 1394 | "type": "library", 1395 | "autoload": { 1396 | "psr-4": { 1397 | "FastRoute\\": "src/" 1398 | }, 1399 | "files": [ 1400 | "src/functions.php" 1401 | ] 1402 | }, 1403 | "notification-url": "https://packagist.org/downloads/", 1404 | "license": [ 1405 | "BSD-3-Clause" 1406 | ], 1407 | "authors": [ 1408 | { 1409 | "name": "Nikita Popov", 1410 | "email": "nikic@php.net" 1411 | } 1412 | ], 1413 | "description": "Fast request router for PHP", 1414 | "keywords": [ 1415 | "router", 1416 | "routing" 1417 | ], 1418 | "time": "2018-02-13T20:26:39+00:00" 1419 | }, 1420 | { 1421 | "name": "psr/http-message", 1422 | "version": "1.0.1", 1423 | "source": { 1424 | "type": "git", 1425 | "url": "https://github.com/php-fig/http-message.git", 1426 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 1427 | }, 1428 | "dist": { 1429 | "type": "zip", 1430 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 1431 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 1432 | "shasum": "" 1433 | }, 1434 | "require": { 1435 | "php": ">=5.3.0" 1436 | }, 1437 | "type": "library", 1438 | "extra": { 1439 | "branch-alias": { 1440 | "dev-master": "1.0.x-dev" 1441 | } 1442 | }, 1443 | "autoload": { 1444 | "psr-4": { 1445 | "Psr\\Http\\Message\\": "src/" 1446 | } 1447 | }, 1448 | "notification-url": "https://packagist.org/downloads/", 1449 | "license": [ 1450 | "MIT" 1451 | ], 1452 | "authors": [ 1453 | { 1454 | "name": "PHP-FIG", 1455 | "homepage": "http://www.php-fig.org/" 1456 | } 1457 | ], 1458 | "description": "Common interface for HTTP messages", 1459 | "homepage": "https://github.com/php-fig/http-message", 1460 | "keywords": [ 1461 | "http", 1462 | "http-message", 1463 | "psr", 1464 | "psr-7", 1465 | "request", 1466 | "response" 1467 | ], 1468 | "time": "2016-08-06T14:39:51+00:00" 1469 | }, 1470 | { 1471 | "name": "psr/log", 1472 | "version": "1.0.2", 1473 | "source": { 1474 | "type": "git", 1475 | "url": "https://github.com/php-fig/log.git", 1476 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" 1477 | }, 1478 | "dist": { 1479 | "type": "zip", 1480 | "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 1481 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 1482 | "shasum": "" 1483 | }, 1484 | "require": { 1485 | "php": ">=5.3.0" 1486 | }, 1487 | "type": "library", 1488 | "extra": { 1489 | "branch-alias": { 1490 | "dev-master": "1.0.x-dev" 1491 | } 1492 | }, 1493 | "autoload": { 1494 | "psr-4": { 1495 | "Psr\\Log\\": "Psr/Log/" 1496 | } 1497 | }, 1498 | "notification-url": "https://packagist.org/downloads/", 1499 | "license": [ 1500 | "MIT" 1501 | ], 1502 | "authors": [ 1503 | { 1504 | "name": "PHP-FIG", 1505 | "homepage": "http://www.php-fig.org/" 1506 | } 1507 | ], 1508 | "description": "Common interface for logging libraries", 1509 | "homepage": "https://github.com/php-fig/log", 1510 | "keywords": [ 1511 | "log", 1512 | "psr", 1513 | "psr-3" 1514 | ], 1515 | "time": "2016-10-10T12:19:37+00:00" 1516 | }, 1517 | { 1518 | "name": "react/event-loop", 1519 | "version": "v0.4.3", 1520 | "source": { 1521 | "type": "git", 1522 | "url": "https://github.com/reactphp/event-loop.git", 1523 | "reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f" 1524 | }, 1525 | "dist": { 1526 | "type": "zip", 1527 | "url": "https://api.github.com/repos/reactphp/event-loop/zipball/8bde03488ee897dc6bb3d91e4e17c353f9c5252f", 1528 | "reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f", 1529 | "shasum": "" 1530 | }, 1531 | "require": { 1532 | "php": ">=5.4.0" 1533 | }, 1534 | "require-dev": { 1535 | "phpunit/phpunit": "~4.8" 1536 | }, 1537 | "suggest": { 1538 | "ext-event": "~1.0", 1539 | "ext-libev": "*", 1540 | "ext-libevent": ">=0.1.0" 1541 | }, 1542 | "type": "library", 1543 | "autoload": { 1544 | "psr-4": { 1545 | "React\\EventLoop\\": "src" 1546 | } 1547 | }, 1548 | "notification-url": "https://packagist.org/downloads/", 1549 | "license": [ 1550 | "MIT" 1551 | ], 1552 | "description": "Event loop abstraction layer that libraries can use for evented I/O.", 1553 | "keywords": [ 1554 | "asynchronous", 1555 | "event-loop" 1556 | ], 1557 | "time": "2017-04-27T10:56:23+00:00" 1558 | }, 1559 | { 1560 | "name": "seld/cli-prompt", 1561 | "version": "1.0.3", 1562 | "source": { 1563 | "type": "git", 1564 | "url": "https://github.com/Seldaek/cli-prompt.git", 1565 | "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" 1566 | }, 1567 | "dist": { 1568 | "type": "zip", 1569 | "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", 1570 | "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", 1571 | "shasum": "" 1572 | }, 1573 | "require": { 1574 | "php": ">=5.3" 1575 | }, 1576 | "type": "library", 1577 | "extra": { 1578 | "branch-alias": { 1579 | "dev-master": "1.x-dev" 1580 | } 1581 | }, 1582 | "autoload": { 1583 | "psr-4": { 1584 | "Seld\\CliPrompt\\": "src/" 1585 | } 1586 | }, 1587 | "notification-url": "https://packagist.org/downloads/", 1588 | "license": [ 1589 | "MIT" 1590 | ], 1591 | "authors": [ 1592 | { 1593 | "name": "Jordi Boggiano", 1594 | "email": "j.boggiano@seld.be" 1595 | } 1596 | ], 1597 | "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", 1598 | "keywords": [ 1599 | "cli", 1600 | "console", 1601 | "hidden", 1602 | "input", 1603 | "prompt" 1604 | ], 1605 | "time": "2017-03-18T11:32:45+00:00" 1606 | } 1607 | ], 1608 | "packages-dev": [], 1609 | "aliases": [], 1610 | "minimum-stability": "stable", 1611 | "stability-flags": { 1612 | "amphp/aerys": 20 1613 | }, 1614 | "prefer-stable": false, 1615 | "prefer-lowest": false, 1616 | "platform": [], 1617 | "platform-dev": [], 1618 | "plugin-api-version": "2.6.0" 1619 | } 1620 | -------------------------------------------------------------------------------- /config.sample.php: -------------------------------------------------------------------------------- 1 | activate()); 18 | 19 | echo "Firmata " . $board->version . " active\n"; 20 | 21 | $pin = $board->pins[13]; 22 | $pin->mode = Firmata\Pin::MODE_OUTPUT; 23 | 24 | $pinController = new PinController($pin); 25 | 26 | $router = new Router; 27 | $router->addRoute('GET', '/control', new Websocket($pinController)); 28 | $router->setFallback(new Root(__DIR__ . '/../public')); 29 | 30 | $server = new Server($router); 31 | $server->expose('127.0.0.1', 4321); 32 | $server->expose('::1', 4321); 33 | yield $server->start(); 34 | }); 35 | 36 | LoopFactory::run(); 37 | 38 | 39 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Aerys Chat 6 | 13 | 14 | 15 | 16 | 17 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/ConnectionConfig.php: -------------------------------------------------------------------------------- 1 | device = $device; 20 | } 21 | 22 | public function withBaud(int $baud): self { 23 | $clone = clone $this; 24 | $clone->baud = $baud; 25 | 26 | return $clone; 27 | } 28 | 29 | public function getBaud(): int { 30 | return $this->baud; 31 | } 32 | 33 | public function withDevice(string $device): self { 34 | $clone = clone $this; 35 | $clone->device = $device; 36 | 37 | return $clone; 38 | } 39 | 40 | public function getDevice(): string { 41 | return $this->device; 42 | } 43 | 44 | public function withRemote(string $host, int $port): self { 45 | $clone = clone $this; 46 | $clone->remoteHost = $host; 47 | $clone->remotePort = $port; 48 | 49 | return $clone; 50 | } 51 | 52 | public function getRemoteHost(): ?string { 53 | return $this->remoteHost; 54 | } 55 | 56 | public function getRemotePort(): ?int { 57 | return $this->remotePort; 58 | } 59 | } -------------------------------------------------------------------------------- /src/PinController.php: -------------------------------------------------------------------------------- 1 | pin = $pin; 21 | } 22 | 23 | public function onStart(Endpoint $endpoint) { 24 | $this->endpoint = $endpoint; 25 | } 26 | 27 | public function onHandshake(Request $request, Response $response) { 28 | if ($request->getHeader('origin') !== 'http://localhost:4321') { 29 | $response->setStatus(400); 30 | } 31 | 32 | return $response; 33 | } 34 | 35 | public function onOpen(int $clientId, Request $request) { 36 | // do nothing 37 | } 38 | 39 | public function onData(int $clientId, Message $message) { 40 | /** @var string $payload */ 41 | $payload = yield $message->buffer(); 42 | 43 | $data = json_decode($payload, true); 44 | 45 | if ($data['state'] === 'on') { 46 | $this->pin->digital = true; 47 | } else { 48 | $this->pin->digital = false; 49 | } 50 | } 51 | 52 | public function onClose(int $clientId, int $code, string $reason) { 53 | // do nothing 54 | } 55 | 56 | public function onStop() { 57 | // do nothing 58 | } 59 | } -------------------------------------------------------------------------------- /src/functions.php: -------------------------------------------------------------------------------- 1 | then(function ($value = null) use ($deferred) { 13 | $deferred->resolve($value); 14 | }, function ($exception = null) use ($deferred) { 15 | $exception = $exception instanceof \Throwable 16 | ? $exception 17 | : new \Exception("Non-throwable caught: {$exception}"); 18 | 19 | $deferred->fail($exception); 20 | }); 21 | 22 | return $deferred->promise(); 23 | } --------------------------------------------------------------------------------