PHPackages                             dcrswoole/framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. dcrswoole/framework

ActiveProject[Framework](/categories/framework)

dcrswoole/framework
===================

 PHP coroutine framework.

1.3.9(1y ago)781MITPHPPHP &gt;=8.3.0CI failing

Since Feb 4Pushed 2w ago2 watchersCompare

[ Source](https://github.com/guanhui07/dcr-swoole)[ Packagist](https://packagist.org/packages/dcrswoole/framework)[ RSS](/packages/dcrswoole-framework/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (35)Versions (24)Used By (0)

dcr-swoole，基于Swoole 实现的框架
=========================

[](#dcr-swoole基于swoole-实现的框架)

- laravel orm
- restful route
- predis
- guzzle
- monolog
- http websocket
- rabbitmq
- container
- event
- middleware 支持注解配置中间件
- validate
- crontab
- command
- collection
- carbon
- dotenv config
- 支持注解配置路由 注解配置中间件
- aop 切面
- process

### 安装

[](#安装)

```
composer create-project dcrswoole/framework skeleton
cp .env.example  .env

```

### 分层 (demo未按此方式)

[](#分层-demo未按此方式)

controller-&gt;service -&gt;repository-&gt;model

### http:

[](#http)

```
php ./bin/start.php http:start

```

### websocket:

[](#websocket)

```
php ./bin/start.php ws:start

```

### console:

[](#console)

```
php artisan test

```

### crontab:

[](#crontab)

```
/config/crontab.php  enable 改为 true 开启

```

### migrate:

[](#migrate)

```
php migrate.php  migrations:generate
php migrate.php migrations:migrate
```

### container

[](#container)

```
use DcrSwoole\Utils\ApplicationContext;

ApplicationContext::getContainer();
//或 di();
```

路由注解和中间件注解
----------

[](#路由注解和中间件注解)

```
    #[RequestMapping(methods: "GET , POST" , path:"/api/json")]
    #[Middlewares(AuthMiddleware::class , TestMiddleware::class)]
    public function test()
    {
        return 'hello';
    }
```

路由注解 和 中间件注解 以及Inject注解 使用
--------------------------

[](#路由注解-和-中间件注解-以及inject注解--使用)

```
