找到相关代码为6104个
搜索工具
排序方式:
最佳匹配
+ 支持PSR-3日志规范
+ 中间件支持(`V5.1.6+`)
+ 支持`Swoole`/`Workerman`运行(`V5.1.18+`)
官方已经正式宣布`5.1.27`版本为LTS版本。
+ 支持PSR-3日志规范
+ 中间件支持(`V5.1.6+`)
+ 支持`Swoole`/`Workerman`运行(`V5.1.18+`)
官方已经正式宣布`5.1.27`版本为LTS版本。
* 对Swoole以及协程支持改进
* 对IDE更加友好
* 统一和精简大量用法
PHP_ME(swoole_coroutine, exists, arginfo_swoole_coroutine_exists, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, yield, arginfo_swoole_coroutine_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_MALIAS(swoole_coroutine, suspend, yield, arginfo_swoole_coroutine_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, resume, arginfo_swoole_coroutine_resume, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, stats, arginfo_swoole_coroutine_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
...
PHP_ME(swoole_coroutine, getCid, arginfo_swoole_coroutine_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_MALIAS(swoole_coroutine, getuid, getCid, arginfo_swoole_coroutine_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, getPcid, arginfo_swoole_coroutine_getPcid, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, getContext, arginfo_swoole_coroutine_getContext, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME(swoole_coroutine, getBackTrace, arginfo_swoole_coroutine_getBackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
<?php
class SwooleTestClassA {
}
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Runtime;
use function Swoole\Coroutine\run;
...
Runtime::enableCoroutine(SWOOLE_HOOK_NATIVE_CURL);
$s = microtime(true);
run(function () use ($pm) {
$ch = curl_init();
$code = uniqid('swoole_');
/*
+----------------------------------------------------------------------+
| Swoole |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
...
| license@swoole.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Tianfeng Han <mikan.tenny@gmail.com> |
+----------------------------------------------------------------------+
*/
<?php
require __DIR__ . '/../include/bootstrap.php';
use Swoole\Server;
use Swoole\Client;
...
define('UNIX_SOCK_1', getenv('HOME').'/swoole.test.uinx_stream.sock');
define('UNIX_SOCK_2', getenv('HOME').'/swoole.test.uinx_dgram.sock');
define('HAVE_IPV6', boolval(@stream_socket_server('tcp://[::1]:0')));
<?php
require __DIR__ . '/../include/bootstrap.php';
use Swoole\WebSocket\Frame;
use Swoole\WebSocket\Server;
...
use Swoole\Coroutine\Http\Client;
const N = 8;
$count = 0;
$pm = new SwooleTest\ProcessManager;
});
$pm->kill();
};
$pm->childFunc = function () use ($pm) {
$http = new Swoole\Http\Server('127.0.0.1', $pm->getFreePort(), SWOOLE_BASE);
...
$http->set(['log_file' => '/dev/null']);
$http->on(Constant::EVENT_WORKER_START, function () use ($pm) {
$pm->wakeup();
});
$http->on(Constant::EVENT_REQUEST, function (Swoole\Http\Request $request, Swoole\Http\Response $response) {
--TEST--
swoole_http_server: issue 2360 (swoole_http_server silently fails to read requests)
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
...
$server->on('request', function (Swoole\Http\Request $request, Swoole\Http\Response $response) use ($pm) {
phpt_echo("received {$request->header['content-length']} bytes\n");
if (Assert::assert($request->rawContent() === $pm->getRandomData())) {
$response->end($request->rawContent());
}
推荐博客
...