lys/spring-php

SpringPHP是一款基于Swoole的高性能框架

v0.1.6 2023-11-01 02:54 UTC

README

SpringPHP is a high-performance framework based on Swoole.

Official website (Under construction)

https://bbs.what.pub

About Project

SpringPHP is my first framework and also the precipitation of my own technology.

TODO

  • MVC
  • Custom routing
  • Support for file-based session components
  • RPC、WebSocket RPC
  • Timed task
  • Support Socket, WebSocket, HTTP
  • Support for multiple modules
  • Case practice
  • Improve documentation

Introduction

It is currently in the testing stage, please use it in the production environment with caution.

Environment

  • PHP >= 7.2

  • Swoole >= 4.1.0

Installation

php composer.phar create-project spring-php/demo [Directory name] [Version]

As follows:

//You can freely delete unwanted code
php composer.phar create-project spring-php/demo demo dev-master

Demo

https://github.com/1107012776/spring-php-demo

Example

Start up

php spring-php start   //Guardian mode needs to add -d after start

////////////////////////////////////////////////////////////////////
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//                          SpringPHP                             //
//            https://github.com/1107012776/spring-php            //
////////////////////////////////////////////////////////////////////

Shut down

php spring-php stop

Restart worker

php spring-php reload

View program process

php spring-php process
 spring-php
  \_ spring-php.Manager
  |       \_ spring-php.task.2 pid=29352
  |       \_ spring-php.task.3 pid=29354
  |       \_ spring-php.worker.0 listen:0.0.0.0:7999
  |       \_ spring-php.worker.1 listen:0.0.0.0:7999
  |       \_ spring-php RenderWorker unix worker pid=29363
  |       \_ spring-php RenderWorker unix worker pid=29364
  |       \_ spring-php RenderWorker unix worker pid=29365
  |       \_ spring-php.Crontab worker pid=29368
  \_ spring-php.Manager
  |       \_ spring-php.task.2 pid=29349
  |       \_ spring-php.task.3 pid=29350
  |       \_ spring-php.worker.0 listen:0.0.0.0:8098
  |       \_ spring-php.worker.1 listen:0.0.0.0:8098
  |       \_ spring-php RenderWorker worker pid=29357 listen:0.0.0.0:8099
  |       \_ spring-php RenderWorker worker pid=29369 listen:0.0.0.0:8100
  \_ spring-php.Manager
          \_ spring-php.task.2 pid=29358
          \_ spring-php.task.3 pid=29359
          \_ spring-php.worker.0 listen:0.0.0.0:8297
          \_ spring-php.worker.1 listen:0.0.0.0:8297
          \_ spring-php RenderWorker worker pid=29366 listen:0.0.0.0:8298
          \_ spring-php RenderWorker worker pid=29367 listen:0.0.0.0:8299

Page visitor counter

visitor counter