diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..21be40ca --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.gitattributes export-ignore +/.github/ export-ignore +/.gitignore export-ignore +/phpunit.xml.dist export-ignore +/phpunit.xml.legacy export-ignore +/tests/ export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..85aad9c5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-22.04 + strategy: + matrix: + php: + - 8.3 + - 8.2 + - 8.1 + - 8.0 + - 7.4 + - 7.3 + - 7.2 + - 7.1 + - 7.0 + - 5.6 + - 5.5 + - 5.4 + - 5.3 + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + ini-file: development + ini-values: disable_functions='' # do not disable PCNTL functions on PHP < 8.1 + extensions: sockets, pcntl + env: + fail-fast: true # fail step if any extension can not be installed + - run: composer install + - run: vendor/bin/phpunit --coverage-text --exclude-group internet + if: ${{ matrix.php >= 7.3 }} + - run: vendor/bin/phpunit --coverage-text --exclude-group internet -c phpunit.xml.legacy + if: ${{ matrix.php < 7.3 }} + + PHPUnit-hhvm: + name: PHPUnit (HHVM) + runs-on: ubuntu-22.04 + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM + - name: Run hhvm composer.phar require --dev react/async:^2 react/promise:^2 phpunit/phpunit:^5.7 # downgrade Async and Promise for HHVM + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm composer.phar require --dev react/async:^2 react/promise:^2 phpunit/phpunit:^5.7 + - name: Run hhvm vendor/bin/phpunit --exclude-group internet + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/.gitignore b/.gitignore index 7c97585f..2866cd9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .subsplit vendor +/composer.lock diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a72355b9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - hhvm - -matrix: - allow_failures: - - php: hhvm - -install: ./scripts/travis-init.sh - -script: php vendor/bin/phpunit --coverage-text diff --git a/CHANGELOG.md b/CHANGELOG.md index f0103f00..f5f711e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,94 @@ -CHANGELOG -========= +# Changelog -### 0.4.1 (2014-04-13) +## 1.4.0 (2023-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2023/announcing-reactphp-promise-v3). + +* Feature: Add support for new Promise v3 release. + (#464 and #524 by @clue) + +* Feature: Support PHP 8.2 release. + (#491 by @Nielsvanpach) + +* Improve test suite, update dependencies and report failed assertions. + (#462 and #501 by @clue and #466 and #492 by @SimonFrings) + +## 1.3.0 (2022-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2022/announcing-reactphp-async). + +* Feature: Add new Async component to core components. + (#458 by @clue) + +* Feature: Support PHP 8.1 release. + (#451 by @clue) + +* Improve documentation, update HTTP server example for reactphp/http v1.6.0 release. + (#449 and #459 by @clue and #457 by @nhedger) + +* Improve test suite, support PHPUnit 9 and update dependencies to avoid skipping tests. + (#450 and #454 by @clue and #455 by @SimonFrings) + +## 1.2.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#445 by @clue) + +## 1.1.0 (2020-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2020/announcing-reactphp-http). + +* Feature: Add event-driven, streaming HTTP client and server implementation via [`react/http`](https://reactphp.org/http/). + (#440 by @clue) + +* Update documentation to link to project meta repo and link to our official Gitter chat room. + (#432 and #433 by @clue) + +* Improve test suite to run tests on PHP 7.4 and add `.gitattributes` to exclude dev files from exports. + (#434 by @reedy and #439 by @clue) + +## 1.0.0 (2019-07-11) + +* First stable LTS release, now following [SemVer](https://semver.org/). + We'd like to emphasize that this project is production ready and battle-tested. + We plan to support all long-term support (LTS) releases for at least 24 months, + so you have a rock-solid foundation to build on top of. + +> ReactPHP consists of a set of individual [components](https://reactphp.org/#core-components). + This means that instead of installing something like a "ReactPHP framework", + you actually can pick only the components that you need. As an alternative, + we also provide this meta package that will install all stable components at + once. Installing this is only recommended for quick prototyping, as the list + of stable components may change over time. + In other words, this meta package does not contain any source code and + instead only consists of links to all our main components, see also our + [list of components](https://reactphp.org/#core-components) for more details. + +## 0.4.2 (2014-12-11) + +**Real Split**: The one where we tag the change where the master repo pulls in all the split components. + +New component releases are now tagged and released in their respective +component repository. See also [core components](https://reactphp.org/#core-components) +to learn more about this. + +This project continues to be under active development and is anything but dead. +You can check out the combined [changelog for all ReactPHP components](https://reactphp.org/changelog.html). + +## 0.4.1 (2014-04-13) + +**Hungry Hungry CPU**: CPU starvation bug fixes and other bug fixes. * Bug fix: [EventLoop] null timeout in StreamSelectLoop causing 100% CPU usage (@clue) * Bug fix: [Socket] Check read buffer for data before shutdown signal and end emit (@ArtyDev) * Bug fix: [DNS] Fixed PSR-4 autoload path (@marcj/WyriHaximus) * Bug fix: v0.3.4 changes merged for v0.4.1 -### 0.3.4 (2014-03-30) - - * Bug fix: [Stream] Fixed 100% CPU spike from non-empty write buffer on closed stream - * Buf fix: [Socket] Reset socket to non-blocking after shutting down (PHP bug) +## 0.4.0 (2014-02-02) -### 0.4.0 (2014-02-02) +**Fore!** * Feature: Added ChildProcess to run async child processes within the event loop (@jmikola) * Feature: [EventLoop] Added `EventLoopInterface::nextTick()`, implemented in all event loops (@jmalloc) @@ -29,25 +104,32 @@ CHANGELOG * Bug fix: [Dns] Properly resolve CNAME aliases * Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0 -### 0.3.3 (2013-07-08) +## 0.3.4 (2014-03-30) + + * Bug fix: [Stream] Fixed 100% CPU spike from non-empty write buffer on closed stream + * Buf fix: [Socket] Reset socket to non-blocking after shutting down (PHP bug) + +## 0.3.3 (2013-07-08) + +**Connection state bug fixes** * Bug fix: [EventLoop] No error on removing non-existent streams (@clue) * Bug fix: [EventLoop] Do not silently remove feof listeners in `LibEvLoop` * Bug fix: [Stream] Correctly detect closed connections -### 0.3.2 (2013-05-10) +## 0.3.2 (2013-05-10) * Feature: [Dns] Support default port for IPv6 addresses (@clue) * Bug fix: [Stream] Make sure CompositeStream is closed properly -### 0.3.1 (2013-04-21) +## 0.3.1 (2013-04-21) * Feature: [Socket] Support binding to IPv6 addresses (@clue) * Feature: [SocketClient] Support connecting to IPv6 addresses (@clue) * Bug fix: [Stream] Allow any `ReadableStreamInterface` on `BufferedSink::createPromise()` * Bug fix: [HttpClient] Correct requirement for socket-client -### 0.3.0 (2013-04-14) +## 0.3.0 (2013-04-14) * BC break: [EventLoop] New timers API (@nrk) * BC break: [EventLoop] Remove check on return value from stream callbacks (@nrk) @@ -55,58 +137,87 @@ CHANGELOG * Feature: [SocketClient] New SocketClient component extracted from HttpClient (@clue) * Feature: [Stream] Factory method for BufferedSink -### 0.2.7 (2013-01-05) +### EventLoop + +* The timer callback now receives a `Timer` instance, with the following + useful methods: + + * `cancel` + * `isActive` + * `setData($data)` + * `getData` + + And some other less common ones. These are prefered over + `LoopInterface::cancelTimer` and `LoopInterface::isTimerActive`. + +* You can no longer return a boolean from a periodic timer callback to abort + it. + +### HttpClient + +* `HttpClient\*ConnectionManager` has been moved to `SocketClient\*Connector`, + and the `getConnection` method has been renamed to `create`. + + Before: + + $connectionManager->getConnection($host, $port); + + After: + + $connector->create($host, $port); + +## 0.2.7 (2013-01-05) * Bug fix: [EventLoop] Fix libevent timers with PHP 5.3 * Bug fix: [EventLoop] Fix libevent timer cancellation (@nrk) -### 0.2.6 (2012-12-26) +## 0.2.6 (2012-12-26) * Feature: [Cache] New cache component, used by DNS * Bug fix: [Http] Emit end event when Response closes (@beaucollins) * Bug fix: [EventLoop] Plug memory issue in libevent timers (@cameronjacobson) * Bug fix: [EventLoop] Correctly pause LibEvLoop on stop() -### 0.2.5 (2012-11-26) +## 0.2.5 (2012-11-26) * Feature: [Stream] Make BufferedSink trigger progress events on the promise (@jsor) * Feature: [HttpClient] Use a promise-based API internally * Bug fix: [HttpClient] Use DNS resolver correctly -### 0.2.4 (2012-11-18) +## 0.2.4 (2012-11-18) * Feature: [Stream] Added ThroughStream, CompositeStream, ReadableStream and WritableStream * Feature: [Stream] Added BufferedSink * Feature: [Dns] Change to promise-based API (@jsor) -### 0.2.3 (2012-11-14) +## 0.2.3 (2012-11-14) * Feature: LibEvLoop, integration of `php-libev` * Bug fix: Forward drain events from HTTP response (@cs278) * Dependency: Updated guzzle deps to `3.0.*` -### 0.2.2 (2012-10-28) +## 0.2.2 (2012-10-28) * Major: Dropped Espresso as a core component now available as `react/espresso` only * Feature: DNS executor timeout handling (@arnaud-lb) * Feature: DNS retry executor (@arnaud-lb) * Feature: HTTP client (@arnaud-lb) -### 0.2.1 (2012-10-14) +## 0.2.1 (2012-10-14) * Feature: Support HTTP 1.1 continue * Bug fix: Check for EOF in `Buffer::write()` * Bug fix: Make `Espresso\Stack` work with invokables (such as `Espresso\Application`) * Minor adjustments to DNS parser -### 0.2.0 (2012-09-10) +## 0.2.0 (2012-09-10) * Feature: DNS resolver -### 0.1.1 (2012-07-12) +## 0.1.1 (2012-07-12) * Bug fix: Testing and functional against PHP >= 5.3.3 and <= 5.3.8 -### 0.1.0 (2012-07-11) +## 0.1.0 (2012-07-11) * First tagged release diff --git a/README.md b/README.md index dfe1502f..f8e1d0f2 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,294 @@ -# React - -Event-driven, non-blocking I/O with PHP. +
+ ReactPHP Logo +
+ +
+ +
+ Event-driven, non-blocking I/O with PHP. +
+ +
+ +
+ Build Status +
+ +
+ +ReactPHP is a low-level library for event-driven programming in PHP. At its core +is an event loop, on top of which it provides low-level utilities, such as: +Streams abstraction, async DNS resolver, network client/server, HTTP +client/server and interaction with processes. Third-party libraries can use these +components to create async network clients/servers and more. -[![Build Status](https://secure.travis-ci.org/reactphp/react.png?branch=master)](http://travis-ci.org/reactphp/react) [![Code Climate](https://codeclimate.com/github/reactphp.svg)](https://codeclimate.com/github/reactphp) +```php +listen($socket); -``` -php ~/composer.phar require react/react +echo "Server running at http://127.0.0.1:8080" . PHP_EOL; ``` -## What is it? - -React is a low-level library for event-driven programming in PHP. At its core -is an event loop, on top of which it provides low-level utilities, such as: -Streams abstraction, async dns resolver, network client/server, http -client/server, interaction with processes. Third-party libraries can use these -components to create async network clients/servers and more. - +This simple web server written in ReactPHP responds with "Hello World!" for every request. + +ReactPHP is production ready and battle-tested with millions of installations +from all kinds of projects around the world. Its event-driven architecture makes +it a perfect fit for efficient network servers and clients handling hundreds or +thousands of concurrent connections, long-running applications and many other +forms of cooperative multitasking with non-blocking I/O operations. What makes +ReactPHP special is its vivid ecosystem with hundreds of third-party libraries +allowing you to integrate with many existing systems, such as common network +services, database systems and other third-party APIs. + +* **Production ready** and battle-tested. +* **Rock-solid** with stable long-term support (LTS) releases. +* **Requires no extensions** and runs on any platform - no excuses! +* Takes advantage of **optional extensions** to get better performance when available. +* **Highly recommends latest version of PHP 7+** for best performance and support. +* **Supports legacy PHP 5.3+ and HHVM** for maximum compatibility. +* **Well designed** and **reusable components**. +* **Decoupled parts** so they can be replaced by alternate implementations. +* Carefully **tested** (unit & functional). +* Promotes **standard PSRs** where possible for maximum interoperability. +* Aims to be **technology neutral**, so you can use your preferred application stack. +* Small **core team of professionals** supported by **large network** of outside contributors. + +ReactPHP is non-blocking by default. Use workers for blocking I/O. The event loop is based on the reactor pattern (hence the name) and strongly inspired by libraries such as EventMachine (Ruby), Twisted (Python) and Node.js (V8). -## Design goals +> This repository you're currently looking at is mostly used as a meta + repository to discuss and plan all things @ReactPHP. See the individual + components linked below for more details about each component, its + documentation and source code. -* Usable with a bare minimum of PHP extensions, add more extensions to get better performance. -* Provide a standalone event-loop component that can be re-used by other libraries. -* Decouple parts so they can be replaced by alternate implementations. +## Core Components -React is non-blocking by default. Use workers for blocking I/O. +* **EventLoop** + ReactPHP's core reactor event-loop. + [Read the documentation](https://github.com/reactphp/event-loop) -## High-level abstractions +* **Stream** + Event-driven readable and writable streams for non-blocking I/O in ReactPHP. + [Read the documentation](https://github.com/reactphp/stream) -There are two main abstractions that make dealing with control flow a lot more -manageable. +* **Promise** + Promises/A implementation for PHP. + [Read the documentation](https://github.com/reactphp/promise) -* **Stream:** A stream represents an I/O source (ReadableStream) or - destination (WritableStream). These can be used to model pipes, similar - to a unix pipe that is composed of processes. Streams represent very large - values as chunks. +* **Async** + Async utilities and fibers for ReactPHP. + [Read the documentation](https://github.com/reactphp/async) -* **Promise:** A promise represents an eventual return value. Promises can be - composed and are a lot easier to deal with than traditional CPS callback - spaghetti and allow for almost sane error handling. Promises represent the - computation for producing single values. +## Network Components -You should use these abstractions whenever you can. +* **Socket** + Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP. + [Read the documentation](https://github.com/reactphp/socket) -## Usage +* **Datagram** + Event-driven UDP client and server sockets for ReactPHP. + [Read the documentation](https://github.com/reactphp/datagram) -Here is an example of a simple HTTP server listening on port 1337: -```php - 'text/plain'); +* **Cache** + Async caching for ReactPHP. + [Read the documentation](https://github.com/reactphp/cache) - $response->writeHead(200, $headers); - $response->end($text); -}; +* **ChildProcess** + Library for executing child processes. + [Read the documentation](https://github.com/reactphp/child-process) -$loop = React\EventLoop\Factory::create(); -$socket = new React\Socket\Server($loop); -$http = new React\Http\Server($socket); +* **PromiseTimer** + Trivial timeout implementation for ReactPHP's Promise lib. + [Read the documentation](https://github.com/reactphp/promise-timer) -$http->on('request', $app); +* **PromiseStream** + The missing link between Promise-land and Stream-land, built on top of ReactPHP. + [Read the documentation](https://github.com/reactphp/promise-stream) -$socket->listen(1337); -$loop->run(); -``` +## Built with ReactPHP + +* **Thruway** + PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging + Protocol) for Real-Time Application Messaging + [voryx/Thruway](https://github.com/voryx/Thruway) + +* **PPM - PHP Process Manager** + PPM is a process manager, supercharger and load balancer for modern PHP + applications. + [php-pm/php-pm](https://github.com/php-pm/php-pm) + +* **php-ar-drone** + 🚁 Port of node-ar-drone which allows user to control a Parrot AR Drone over + PHP + [jolicode/php-ar-drone](https://github.com/jolicode/php-ar-drone) + +* **Ratchet** + Asynchronous WebSocket server + [ratchetphp/Ratchet](https://github.com/ratchetphp/Ratchet) + +* **Predis\Async** + Asynchronous PHP client library for Redis built on top of ReactPHP + [nrk/predis-async](https://github.com/nrk/predis-async) + +* **clue/redis-server** + A Redis server implementation in pure PHP + [clue/redis-server](https://github.com/clue/php-redis-server) + +[And many more on our wiki page »](https://github.com/reactphp/react/wiki/Users) + +## Articles + +* **Sergey Zhuk** + A series of articles covering ReactPHP: from the basics to the real + application examples. + [sergeyzhuk.me](http://sergeyzhuk.me/reactphp-series) -## Documentation +* **Cees-Jan Kiewiet** + Blog series about several ReactPHP components and how they work. + [blog.wyrihaximus.net](http://blog.wyrihaximus.net/categories/reactphp-series/) -Superficial documentation can be found in the README files of the individual -components. See `vendor/react/*/src/README.md`. +* **Loïc Faugeron** + Super Speed Symfony - ReactPHP. + [gnugat.github.io](https://gnugat.github.io/2016/04/13/super-speed-sf-react-php.html) -## Community +* **Marc J. Schmidt** + Bring High Performance Into Your PHP App (with ReactPHP). + [marcjschmidt.de](http://marcjschmidt.de/blog/2014/02/08/php-high-performance.html) + +* **Marc Morera** + When ReactPHP meet Symfony + [medium.com/@apisearch](https://medium.com/@apisearch/symfony-and-reactphp-series-82082167f6fb) -Check out #reactphp on irc.freenode.net. Also follow -[@reactphp](https://twitter.com/reactphp) on twitter. +## Talks + +* **Christian Lück** + [Pushing the limits with ReactPHP](https://www.youtube.com/watch?v=-5ZdGUvOqx4) + +* **Jeremy Mikola** + [Async PHP With React](https://www.youtube.com/watch?v=s6xrnYae1FU) + +* **Igor Wiedler** + [Event-driven PHP](https://www.youtube.com/watch?v=MWNcItWuKpI) + +## Getting started + +ReactPHP consists of a set of individual [components](#core-components). +This means that instead of installing something like a "ReactPHP framework", you actually +pick only the components that you need. + +This project follows [SemVer](https://semver.org/) for all its stable components. +The recommended way to install these components is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +For example, this may look something like this: + +```bash +# recommended install: pick required components +composer require react/event-loop react/http +``` + +As an alternative, we also provide a meta package that will install all stable +components at once. Installing this is only recommended for quick prototyping, +as the list of stable components may change over time. This meta package can be +installed like this: + +```bash +# quick protoyping only: install all stable components +composer require react/react:^1.4 +``` + +For more details, check out [ReactPHP's homepage](https://reactphp.org/) for +quickstart examples and usage details. + +See also the combined [changelog for all ReactPHP components](https://reactphp.org/changelog.html) +for details about version upgrades. + +## Support + +Do you have a question and need help with ReactPHP? Don't worry, we're here to help! + +As a first step, check the elaborate documentation that comes with each +component (see links to individual documentation for each component above). +If you find your question is not answered within the documentation, there's a +fair chance that it may be relevant to more people. Please do not hesitate to +file your question as an issue in the relevant component so others can also +participate. + +You can also check out our official [Gitter chat room](https://gitter.im/reactphp/reactphp). +Most of the people involved in this project are available in this chat room, so many +questions get answered in a few minutes to some hours. We also use this chat room +to announce all new releases and ongoing development efforts, so consider +staying in this chat room for a little longer. + +Also follow [@reactphp](https://twitter.com/reactphp) on Twitter for updates. +We use this mostly for noteworthy, bigger updates and to keep the community +updated about ongoing development efforts. You can always use the `#reactphp` +hashtag if you have anything to share! + +We're a very open project and we prefer public communication whenever possible, +so that more people can participate and help getting the best solutions available. +At the same time, we realize that some things are better addressed in private. +Whether you just want to say *thank you*, want to report a security issue or +want to help sponsor a certain feature development, you can reach out to the +core team in private by sending an email to `support@reactphp.org`. Please keep in +mind that we're a small team of volunteers and do our best to support anybody +reaching out. + +Do you want to support ReactPHP? Awesome! Let's start with letting the the world +know why you think ReactPHP is awesome and try to help others getting on board! +Send a tweet, write a blog post, give a talk at your local user group or +conference or even write a book. There are many ways you can help. You can +always reach out to us in private and help others in our support channels. +Thank you! ## Tests -To run the test suite, you need install the dependencies via composer, then -run PHPUnit. +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org/): + +```bash +composer install +``` + +To run the test suite, go to the project root and run: + +```bash +vendor/bin/phpunit +``` - $ composer install - $ phpunit +The test suite also contains a number of functional integration tests that rely +on a stable internet connection. Due to the vast number of integration tests, +these are skipped by default during CI runs. If you also do not want to run these, +they can simply be skipped like this: + +```bash +vendor/bin/phpunit --exclude-group internet +``` ## License diff --git a/UPGRADE-0.3.md b/UPGRADE-0.3.md deleted file mode 100644 index e26bce81..00000000 --- a/UPGRADE-0.3.md +++ /dev/null @@ -1,33 +0,0 @@ -UPGRADE for 0.3.x -================= - -EventLoop ---------- - -* The timer callback now receives a `Timer` instance, with the following - useful methods: - - * `cancel` - * `isActive` - * `setData($data)` - * `getData` - - And some other less common ones. These are prefered over - `LoopInterface::cancelTimer` and `LoopInterface::isTimerActive`. - -* You can no longer return a boolean from a periodic timer callback to abort - it. - -HttpClient ----------- - -* `HttpClient\*ConnectionManager` has been moved to `SocketClient\*Connector`, - and the `getConnection` method has been renamed to `create`. - - Before: - - $connectionManager->getConnection($host, $port); - - After: - - $connector->create($host, $port); diff --git a/benchmark/bench.php b/benchmark/bench.php deleted file mode 100644 index 0a21c835..00000000 --- a/benchmark/bench.php +++ /dev/null @@ -1,47 +0,0 @@ -prev = microtime(true); - } - - public function snap() { - $prev = $this->prev; - - $current = microtime(true); - $this->prev = $current; - - return $current - $prev; - } - - public function printSnap($name) { - printf("%-40s: %s s\n", $name, $this->snap()); - } -} - -function benchLoops(array $tests) { - $loops = array( - 'StreamSelectLoop', - 'LibEventLoop', - 'LibEvLoop', - // 'LibUvLoop', - ); - - foreach ($tests as $testName => $test) { - foreach ($loops as $loopName) { - $loopClass = "React\\EventLoop\\$loopName"; - $loop = new $loopClass(); - - $bench = new Bench(); - $bench->start(); - - $test($loop); - - $bench->printSnap("$loopName: $testName"); - } - - printf("----------------------------------------\n"); - } -} diff --git a/benchmark/timers.php b/benchmark/timers.php deleted file mode 100644 index e0c30a34..00000000 --- a/benchmark/timers.php +++ /dev/null @@ -1,32 +0,0 @@ - function ($loop) use ($x) { - for ($i = 0; $i < $x; $i++) { - $loop->addTimer(1, function ($signature, $loop) {}); - } - $loop->run(); - }, - $x . ' periodic timers' => function ($loop) use ($x) { - for ($i = 0; $i < $x; $i++) { - $loop->addPeriodicTimer(2, function ($signature, $loop) use (&$i, $x) { - if ($i >= $x) { - $loop->cancelTimer($signature); - } - }); - } - $loop->run(); - }, -); - -benchLoops($tests); diff --git a/composer.json b/composer.json index cbdee523..3f752a63 100644 --- a/composer.json +++ b/composer.json @@ -1,36 +1,32 @@ { "name": "react/react", - "description": "Nuclear Reactor written in PHP.", - "keywords": ["event-loop", "reactor", "asynchronous"], + "description": "ReactPHP: Event-driven, non-blocking I/O with PHP.", + "keywords": ["reactor", "asynchronous", "ReactPHP"], + "homepage": "https://reactphp.org/", "license": "MIT", "support": { - "issues": "https://github.com/reactphp/react/issues", - "irc": "irc://irc.freenode.org/reactphp" + "chat": "https://gitter.im/reactphp/reactphp" }, "require": { - "php": ">=5.4.0", - "react/cache": "0.4.*", - "react/child-process": "0.4.*", - "react/dns": "0.4.*", - "react/event-loop": "0.4.*", - "react/http-client": "0.4.*", - "react/http": "0.4.*", - "react/promise": "~2.1", - "react/socket-client": "0.4.*", - "react/socket": "0.4.*", - "react/stream": "0.4.*" + "php": ">=5.3.8", + "react/async": "^4.3 || ^3.2 || ^2.2", + "react/cache": "^1.1", + "react/dns": "^1.13", + "react/event-loop": "^1.5", + "react/http": "^1.11", + "react/promise": "^3.2 || ^2.10 || ^1.3", + "react/promise-stream": "^1.7", + "react/promise-timer": "^1.11", + "react/socket": "^1.15", + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "clue/stream-filter": "^1.3", + "phpunit/phpunit": "^9.6 || ^7.5 || ^5.7 || ^4.8.36" }, - "suggest": { - "ext-libevent": "Allows for use of a more performant event-loop implementation.", - "ext-libev": "Allows for use of a more performant event-loop implementation.", - "ext-event": "Allows for use of a more performant event-loop implementation." - }, - "extra": { - "branch-alias": { - "dev-master": "0.5-dev" + "config": { + "preferred-install": { + "react/*": "source" } } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index d4e2496b..00000000 --- a/composer.lock +++ /dev/null @@ -1,1325 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "4f42a5c687c75d76ed0d9a4d167ed8ab", - "packages": [ - { - "name": "evenement/evenement", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", - "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-0": { - "Evenement": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ], - "time": "2012-11-02 14:49:47" - }, - { - "name": "guzzle/parser", - "version": "v3.9.2", - "target-dir": "Guzzle/Parser", - "source": { - "type": "git", - "url": "https://github.com/guzzle/parser.git", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle\\Parser": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Interchangeable parsers used by Guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "URI Template", - "cookie", - "http", - "message", - "url" - ], - "time": "2014-02-05 18:29:46" - }, - { - "name": "react/cache", - "version": "v0.4.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "9882ab5d8b00617baae83c6996f5a34668c11beb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/9882ab5d8b00617baae83c6996f5a34668c11beb", - "reference": "9882ab5d8b00617baae83c6996f5a34668c11beb", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Cache\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async caching.", - "keywords": [ - "cache" - ], - "time": "2014-02-02 01:11:26" - }, - { - "name": "react/child-process", - "version": "v0.4.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/child-process.git", - "reference": "8bf211533bcbb2034e00528a47400367570dc3d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/8bf211533bcbb2034e00528a47400367570dc3d7", - "reference": "8bf211533bcbb2034e00528a47400367570dc3d7", - "shasum": "" - }, - "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0", - "react/event-loop": "0.4.*", - "react/stream": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Library for executing child processes.", - "keywords": [ - "process" - ], - "time": "2014-02-02 01:11:26" - }, - { - "name": "react/dns", - "version": "v0.4.1", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf", - "reference": "8c5ccc35dcb4b06b70eb9201842363fac7b0f3cf", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "react/cache": "0.4.*", - "react/promise": "~2.0", - "react/socket": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Dns\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async DNS resolver.", - "keywords": [ - "dns", - "dns-resolver" - ], - "time": "2014-04-12 14:09:10" - }, - { - "name": "react/event-loop", - "version": "v0.4.1", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "18c5297087ca01de85518e2b55078f444144aa1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/18c5297087ca01de85518e2b55078f444144aa1b", - "reference": "18c5297087ca01de85518e2b55078f444144aa1b", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "suggest": { - "ext-event": "~1.0", - "ext-libev": "*", - "ext-libevent": ">=0.1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\EventLoop\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Event loop abstraction layer that libraries can use for evented I/O.", - "keywords": [ - "event-loop" - ], - "time": "2014-02-26 17:36:58" - }, - { - "name": "react/http", - "version": "v0.4.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/http.git", - "reference": "7b9d293b7a3f73acd840a341497e267d8562d637" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/http/zipball/7b9d293b7a3f73acd840a341497e267d8562d637", - "reference": "7b9d293b7a3f73acd840a341497e267d8562d637", - "shasum": "" - }, - "require": { - "guzzle/parser": "~3.0", - "php": ">=5.4.0", - "react/socket": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Http\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Library for building an evented http server.", - "keywords": [ - "http" - ], - "time": "2014-02-02 01:11:26" - }, - { - "name": "react/http-client", - "version": "v0.4.1", - "source": { - "type": "git", - "url": "https://github.com/reactphp/http-client.git", - "reference": "9f5e634351ad7f82431afa0568798ad99ec20034" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/http-client/zipball/9f5e634351ad7f82431afa0568798ad99ec20034", - "reference": "9f5e634351ad7f82431afa0568798ad99ec20034", - "shasum": "" - }, - "require": { - "evenement/evenement": "~2.0", - "guzzle/parser": "~3.0", - "php": ">=5.4.0", - "react/dns": "0.4.*", - "react/event-loop": "0.4.*", - "react/socket-client": "0.4.*", - "react/stream": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5-dev" - } - }, - "autoload": { - "psr-4": { - "React\\HttpClient\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Asynchronous HTTP client library.", - "keywords": [ - "http" - ], - "time": "2014-11-23 15:04:25" - }, - { - "name": "react/promise", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "937b04f1b0ee8f6d180e75a0830aac778ca4bcd6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/937b04f1b0ee8f6d180e75a0830aac778ca4bcd6", - "reference": "937b04f1b0ee8f6d180e75a0830aac778ca4bcd6", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@googlemail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "time": "2014-10-15 20:05:57" - }, - { - "name": "react/socket", - "version": "v0.4.2", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", - "shasum": "" - }, - "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0", - "react/event-loop": "0.4.*", - "react/stream": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Socket\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Library for building an evented socket server.", - "keywords": [ - "Socket" - ], - "time": "2014-05-25 17:02:16" - }, - { - "name": "react/socket-client", - "version": "v0.4.2", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket-client.git", - "reference": "5b4ccbb9071f81280f20971cccd2abe980d027ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket-client/zipball/5b4ccbb9071f81280f20971cccd2abe980d027ca", - "reference": "5b4ccbb9071f81280f20971cccd2abe980d027ca", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "react/dns": "0.4.*", - "react/event-loop": "0.4.*", - "react/promise": "~2.0", - "react/stream": "0.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "React\\SocketClient\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async connector to open TCP/IP and SSL/TLS based connections.", - "keywords": [ - "Socket" - ], - "time": "2014-10-16 22:23:10" - }, - { - "name": "react/stream", - "version": "v0.4.2", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "acc7a5fec02e0aea674560e1d13c40ed0c8c5465" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/acc7a5fec02e0aea674560e1d13c40ed0c8c5465", - "reference": "acc7a5fec02e0aea674560e1d13c40ed0c8c5465", - "shasum": "" - }, - "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0" - }, - "require-dev": { - "react/event-loop": "0.4.*", - "react/promise": "~2.0" - }, - "suggest": { - "react/event-loop": "0.4.*", - "react/promise": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5-dev" - } - }, - "autoload": { - "psr-4": { - "React\\Stream\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Basic readable and writable stream interfaces that support piping.", - "keywords": [ - "pipe", - "stream" - ], - "time": "2014-09-10 03:32:31" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2014-10-13 12:58:55" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.0.13", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", - "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.1" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2014-12-03 06:41:44" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.3.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "File/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2013-10-10 15:34:57" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2014-01-30 17:20:04" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2013-08-02 07:42:54" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2014-08-31 06:12:13" - }, - { - "name": "phpunit/phpunit", - "version": "4.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bbe7bcb83b6ec1a9eaabbe1b70d4795027c53ee0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bbe7bcb83b6ec1a9eaabbe1b70d4795027c53ee0", - "reference": "bbe7bcb83b6ec1a9eaabbe1b70d4795027c53ee0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.2", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.1", - "sebastian/exporter": "~1.0", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2014-12-05 06:49:03" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c63d2367247365f688544f0d500af90a11a44c65" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", - "reference": "c63d2367247365f688544f0d500af90a11a44c65", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.1", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.3" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2014-10-03 05:12:11" - }, - { - "name": "sebastian/comparator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c484a80f97573ab934e37826dba0135a3301b26a", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2014-11-16 21:32:38" - }, - { - "name": "sebastian/diff", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2014-08-15 10:29:00" - }, - { - "name": "sebastian/environment", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2014-10-25 08:00:45" - }, - { - "name": "sebastian/exporter", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2014-09-10 00:51:36" - }, - { - "name": "sebastian/global-state", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2014-10-06 09:23:50" - }, - { - "name": "sebastian/version", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-03-07 15:35:33" - }, - { - "name": "symfony/yaml", - "version": "v2.6.1", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com/", - "time": "2014-12-02 20:19:20" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "platform": { - "php": ">=5.4.0" - }, - "platform-dev": [] -} diff --git a/examples/child-child.php b/examples/child-child.php deleted file mode 100644 index a86064ec..00000000 --- a/examples/child-child.php +++ /dev/null @@ -1,10 +0,0 @@ -on('exit', function($exitCode, $termSignal) { - echo "Child exit\n"; -}); - -$loop->addTimer(0.001, function($timer) use ($process) { - $process->start($timer->getLoop()); - - $process->stdout->on('data', function($output) { - echo "Child script says: {$output}"; - }); -}); - -$loop->addPeriodicTimer(5, function($timer) { - echo "Parent cannot be blocked by child\n"; -}); - -$loop->run(); diff --git a/examples/dns-resolver.php b/examples/dns-resolver.php deleted file mode 100644 index 3cac3bee..00000000 --- a/examples/dns-resolver.php +++ /dev/null @@ -1,23 +0,0 @@ -create('8.8.8.8', $loop); - -$domain = 'igor.io'; - -$dns - ->resolve($domain) - ->then(function ($ip) { - echo "Host: $ip\n"; - }, function ($e) { - echo "Error: {$e->getMessage()}\n"; - }); - -echo "Resolving domain $domain...\n"; - -$loop->run(); diff --git a/examples/echo-server.php b/examples/echo-server.php deleted file mode 100644 index 8f1ec12c..00000000 --- a/examples/echo-server.php +++ /dev/null @@ -1,18 +0,0 @@ -on('connection', function ($conn) { - $conn->pipe($conn); -}); - -echo "Socket server listening on port 4000.\n"; -echo "You can connect to it by running: telnet localhost 4000\n"; - -$socket->listen(4000); -$loop->run(); diff --git a/examples/http-client.php b/examples/http-client.php deleted file mode 100644 index af8925ae..00000000 --- a/examples/http-client.php +++ /dev/null @@ -1,40 +0,0 @@ -createCached('8.8.8.8', $loop); - -$factory = new React\HttpClient\Factory(); -$client = $factory->create($loop, $dnsResolver); - -$request = $client->request('GET', 'https://api.github.com/repos/reactphp/react/commits'); -$request->on('response', function ($response) { - $buffer = ''; - - $response->on('data', function ($data) use (&$buffer) { - $buffer .= $data; - echo "."; - }); - - $response->on('end', function () use (&$buffer) { - $decoded = json_decode($buffer, true); - $latest = $decoded[0]['commit']; - $author = $latest['author']['name']; - $date = date('F j, Y', strtotime($latest['author']['date'])); - - echo "\n"; - echo "Latest commit on react was done by {$author} on {$date}\n"; - echo "{$latest['message']}\n"; - }); -}); -$request->on('end', function ($error, $response) { - echo $error; -}); -$request->end(); - -$loop->run(); diff --git a/examples/next-tick.php b/examples/next-tick.php deleted file mode 100644 index 64b9bcfb..00000000 --- a/examples/next-tick.php +++ /dev/null @@ -1,58 +0,0 @@ -addTimer( - 0, - function () { - echo 'timer' . PHP_EOL; - } -); - -$loop->nextTick( - function ($loop) { - echo 'next-tick #1' . PHP_EOL; - - $loop->nextTick( - function () { - echo 'next-tick #2' . PHP_EOL; - } - ); - } -); - -$loop->futureTick( - function ($loop) { - echo 'future-tick #1' . PHP_EOL; - - $loop->futureTick( - function () { - echo 'future-tick #2' . PHP_EOL; - } - ); - } -); - -$loop->run(); diff --git a/examples/parallel-download.php b/examples/parallel-download.php deleted file mode 100644 index 90c8edf8..00000000 --- a/examples/parallel-download.php +++ /dev/null @@ -1,46 +0,0 @@ - 'http://nodejs.org/dist/v0.6.18/node-v0.6.18.tar.gz', - 'php-5.5.15.tar.gz' => 'http://it.php.net/get/php-5.5.15.tar.gz/from/this/mirror', -); - -foreach ($files as $file => $url) { - $readStream = fopen($url, 'r'); - $writeStream = fopen($file, 'w'); - - stream_set_blocking($readStream, 0); - stream_set_blocking($writeStream, 0); - - $read = new React\Stream\Stream($readStream, $loop); - $write = new React\Stream\Stream($writeStream, $loop); - - $read->on('end', function () use ($file, &$files) { - unset($files[$file]); - echo "Finished downloading $file\n"; - }); - - $read->pipe($write); -} - -$loop->addPeriodicTimer(5, function ($timer) use (&$files) { - if (0 === count($files)) { - $timer->cancel(); - } - - foreach ($files as $file => $url) { - $mbytes = filesize($file) / (1024 * 1024); - $formatted = number_format($mbytes, 3); - echo "$file: $formatted MiB\n"; - } -}); - -echo "This script will show the download status every 5 seconds.\n"; - -$loop->run(); diff --git a/examples/pump-shitload-of-data.php b/examples/pump-shitload-of-data.php deleted file mode 100644 index 7efad58e..00000000 --- a/examples/pump-shitload-of-data.php +++ /dev/null @@ -1,23 +0,0 @@ -on('connection', function ($conn) { - $shitload = str_repeat('a', 1024*1024*32); - $conn->write($shitload); - $conn->end(); -}); - -echo "Socket server listening on port 4000.\n"; -echo "You can connect to it by running: telnet localhost 4000\n"; - -$socket->listen(4000); -$loop->run(); diff --git a/examples/scalability.php b/examples/scalability.php deleted file mode 100644 index 84276118..00000000 --- a/examples/scalability.php +++ /dev/null @@ -1,21 +0,0 @@ -addReadStream($s, function ($s) use ($i) { - $c=stream_socket_accept($s); - $len=strlen($i)+4; - fwrite($c,"HTTP/1.1 200 OK\r\nContent-Length: $len\r\n\r\nHi:$i\n"); - echo "Served on port 800$i\n"; - }); -} - -echo "Access your brand new HTTP server on 127.0.0.1:800x. Replace x with any number from 0-9\n"; - -$loop->run(); diff --git a/examples/tcp-chat.php b/examples/tcp-chat.php deleted file mode 100644 index 8ed2ffc5..00000000 --- a/examples/tcp-chat.php +++ /dev/null @@ -1,35 +0,0 @@ -on('connection', function ($conn) use ($conns) { - $conns->attach($conn); - - $conn->on('data', function ($data) use ($conns, $conn) { - foreach ($conns as $current) { - if ($conn === $current) { - continue; - } - - $current->write($conn->getRemoteAddress().': '); - $current->write($data); - } - }); - - $conn->on('end', function () use ($conns, $conn) { - $conns->detach($conn); - }); -}); - -echo "Socket server listening on port 4000.\n"; -echo "You can connect to it by running: telnet localhost 4000\n"; - -$socket->listen(4000); -$loop->run(); diff --git a/examples/test-close-conn.php b/examples/test-close-conn.php deleted file mode 100644 index a949aeaa..00000000 --- a/examples/test-close-conn.php +++ /dev/null @@ -1,22 +0,0 @@ -on('connection', function ($conn) use (&$i, $loop) { - $i++; - - $conn->on('end', function () use (&$i) { - $i--; - }); -}); - -$loop->addPeriodicTimer(2, function () use (&$i) { - echo "$i open connections?\n"; -}); - -$socket->listen(8080); -$loop->run(); diff --git a/examples/test-memory-http.php b/examples/test-memory-http.php deleted file mode 100644 index 634dd8bc..00000000 --- a/examples/test-memory-http.php +++ /dev/null @@ -1,28 +0,0 @@ -on('request', function ($request, $response) use (&$i) { - $i++; - $response->writeHead(); - $response->end("Hello World!\n"); -}); - -$loop->addPeriodicTimer(2, function () use (&$i) { - $kmem = memory_get_usage(true) / 1024; - echo "Request: $i\n"; - echo "Memory: $kmem KiB\n"; -}); - -$socket->listen(8080); -$loop->run(); diff --git a/examples/test-memory.php b/examples/test-memory.php deleted file mode 100644 index 4e478011..00000000 --- a/examples/test-memory.php +++ /dev/null @@ -1,26 +0,0 @@ -addPeriodicTimer(0.001, function () use (&$i, $loop) { - $i++; - - // $loop->addTimer(1, function ($timer) { - // }); - - $loop->addPeriodicTimer(1, function ($timer) { - $timer->cancel(); - }); -}); - -$loop->addPeriodicTimer(2, function () use (&$i) { - $kmem = memory_get_usage(true) / 1024; - echo "Run: $i\n"; - echo "Memory: $kmem KiB\n"; -}); - -$loop->run(); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e48665f8..d5d26a2e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,30 @@ - + + cacheResult="false" + colors="true" + convertDeprecationsToExceptions="true"> - + + + ./vendor/react/event-loop/tests/ ./vendor/react/*/tests/ - - - - ./src/ - - + + + ./vendor/react/*/src/ + + + + + + + + + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy new file mode 100644 index 00000000..2cd2f9b1 --- /dev/null +++ b/phpunit.xml.legacy @@ -0,0 +1,26 @@ + + + + + + + ./vendor/react/*/tests/ + + + + + ./vendor/react/*/src/ + + + + + + + + + + + diff --git a/resources/avatar.png b/resources/avatar.png deleted file mode 100644 index a3a94454..00000000 Binary files a/resources/avatar.png and /dev/null differ diff --git a/resources/logo.png b/resources/logo.png deleted file mode 100644 index 16366398..00000000 Binary files a/resources/logo.png and /dev/null differ diff --git a/resources/logo.psd b/resources/logo.psd deleted file mode 100644 index 849b36c3..00000000 Binary files a/resources/logo.psd and /dev/null differ diff --git a/resources/logo_huge.png b/resources/logo_huge.png deleted file mode 100644 index c08bcdb2..00000000 Binary files a/resources/logo_huge.png and /dev/null differ diff --git a/scripts/travis-init.sh b/scripts/travis-init.sh deleted file mode 100755 index 6360e58f..00000000 --- a/scripts/travis-init.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail - -if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then - - # install "libevent" (used by 'event' and 'libevent' PHP extensions) - sudo apt-get install -y libevent-dev - - # install 'event' PHP extension - echo "yes" | pecl install event - - # install 'libevent' PHP extension - curl http://pecl.php.net/get/libevent-0.0.5.tgz | tar -xz - pushd libevent-0.0.5 - phpize - ./configure - make - make install - popd - echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')" - - # install 'libev' PHP extension - git clone --recursive https://github.com/m4rw3r/php-libev - pushd php-libev - phpize - ./configure --with-libev - make - make install - popd - echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')" - -fi - -composer self-update -composer install --dev --prefer-source diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b363791d..2af732cf 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,19 @@ $paths) { + foreach ((array)$paths as $path) { + $autoload->addPsr4($namespace, $base . $path); + } + } + } }