Hyperf release v1.1.14 and super global variable component


Update content

This week’s update mainly does a lot of optimization work for json-rpc components and adds keepaliveio function for AMQP. At the same time, we also released the hyperf / super globals component. By installing this component, the underlying layer will automatically hook off$_ GET、$_ POST、$_ REQUEST、$_ SERVER、$_ COOKIE、$_ These super global variables, session, can keep the usage of php-fpm without causing data confusion between coroutines. At the same time, we also fixed some component bugs, which were released in version 1.1.14. It is highly recommended to use user updates to json-rpc, AMQP, aliyun ACM and devtool.
Direct access to the official website hyperf.io Or document hyperf.wiki View updates.

newly added

  • #1166 added keepaliveio function to AMQP;
  • #1208 for json-rpc responseerror.data.codeValue to pass exception code;
  • #1208 isHyperf\Rpc\Contract\TransporterInterfaceIncreasedrecvmethod;
  • #In 1215, the hyperf / super globals component is added to adapt to some third-party packages that do not support psr-7;
  • #1219 increased AMQP consumersenableProperty to control whether the consumer starts with the server;


  • #1208 fixed the problem that exception and error could not be handled correctly under json-rpc TCP server;
  • #1208 fixed the problem that json-rpc did not check whether the request ID and the response ID were consistent;
  • #1223 fix configprovider scanner will not scan composer.json The configuration of require dev in;
  • #1254 repair executioninit-proxy.shThe command will report that bash does not exist in some environments such as alpine;


  • #1208 optimizes some logic of json-rpc components;
  • #1174 adjustedHyperf\Utils\ParallelIn the format of abnormal output, trace information will now be printed together;
  • #1224 allows the configuration acquisition process of aliyun ACM configuration center to parse UTF-8 characters. At the same time, the configuration will be automatically obtained once after the worker is started, and the pulled configuration will now be transferred to the user-defined process;
  • #1235 releases the corresponding connection after the AMQP producer executes declare;


  • #1227 upgradejcchavezs/zipkin-php-opentracingDepends on version 0.1.4;

About hyperf

Hyperf is based onSwoole 4.4+The implementation of the high-performance, high flexibility PHP coprocessing framework, built-in coroutine server and a large number of commonly used components, performance than the traditional based onPHP-FPMThe standard components are implemented based on PSR standard and based on powerful dependency injection design, which ensures that most components or classes areReplaceableAndReusableYes.

Framework component library in addition to the common coprocessor versionMySQL clientRedis client, we also have a program version for youEloquent ORMWebsocket server and clientJSON RPC server and clientGrpc server and clientOpentracing (Zipkin, Jaeger) clientGuzzle HTTP clientElasticsearch clientConsult clientEtcd clientAMQP componentsNATs componentsConfiguration centers of Apollo, etcd, zookeeper and alicloud ACMFault current limiter based on token bucket algorithmUniversal connection poolFuseSwagger document generationSwoole TrackerBlade, Smarty, twig, plates and thinktemplate view enginesSnowflake global ID generatorPrometheus monitoringIt can save the trouble of implementing the corresponding version of the coroutine.

Hyperf also providesDependency injection container based on psr-11annotationAOP aspect oriented programmingMiddleware based on psr-15Custom processEvent manager based on psr-14Redis / rabbitmq message queueAutomatic model cachingCache based on psr-16Crontab second level timing taskSessionI18N internationalizationValidation form validationAnd other very convenient functions to meet the rich technical and business scenarios, out of the box.

The original intention of the framework

Although the framework based on PHP language is in the era of a hundred flowers contending, we still can’t see a perfect framework for the coexistence of elegant design and ultra-high performance, nor a framework that paves the way for PHP microservices. This is hyperf And the original intention of our team members, we will continue to invest and make efforts to this end. You are also welcome to join us in the open source construction.

Design concept

Hyperspeed + Flexibility = HyperfFrom the name, we willUltra high speedandflexibilityAs a gene for hyperf.

  • For ultra-high speed, we base on the swote coprocessor and do a lot of optimization in the framework design to ensure the output of ultra-high performance.
  • For flexibility, we are based on hyperf’s powerful dependency injection components. The components are implemented based on PSR standard contracts and contracts defined by hyperf. Most components or classes in the framework are replaceable.

Based on the above characteristics, hyperf will have rich possibilities, such as implementing single web services, API services, gateway services, distributed middleware, microservice architecture, game server, Internet of things (IOT).

Complete documentation

We have invested a lot of time in the construction of documents to solve various problems caused by the lack of documents. The documents also provide a lot of examples, which are equally friendly to novices.
Official development document of hyperf

Production available

We have done a lot of unit testing for the components to ensure that the logic is correct, which currently exists1291A total of3803Before the formal opening of hyperf (June 20, 2019), we have already passed the test of severe production environment. Now, many large Internet enterprises have deployed hyperf to their production environment and run stably.

Official website and communication

GitHub point star supports us
Gitee code cloud point star supports us
Hyperf official website
Hyperf documents
QQ group: 862099724