定制 ody/ody-skel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ody/ody-skel

最新稳定版本:0.0.1

Composer 安装命令:

composer require ody/ody-skel

包简介

A minimal skeleton for ODY framework

README 文档

README

Actions Status License

Ody

A lightweight REST API framework build from scratch on top of Swoole HTTP server for shits and giggles.

Use at your own risk!

Install

sudo apt install php8.3-swoole

git pull https://github.com/ody-dev/ody-skeleton.git
composer install

Run the HTTP server

server:start [-d|--daemonize] [-w|--watch]

Run on Swoole

Only works on unix systems!

php ody server:start --watcher

Routes

Add routes to App/route.php. Routes via annotations on controllers is a planned feature.

Route::get('/users', '\App\Http\Controllers\UserController:index');
Route::get('/users/{id}', '\App\Http\Controllers\UserController:find');
Route::post('/users', '\App\Http\Controllers\UserController:create');
Route::put('/users/{id}', '\App\Http\Controllers\UserController:update');

Grouping routes

Route::group('/api', function (RouteCollectorProxy $group) {
    $group->get('/users', '\App\Http\Controllers\UserController:index');
});

Adding middleware to routes

Route::get('/users', '\App\Http\Controllers\UserController:index')->add(new Middleware());

Route::group('/api', function (RouteCollectorProxy $group) {
    $group->get('/users', '\App\Http\Controllers\UserController:index');
})->add(new Middleware());

Migrations

php ody migration:create: UserMigration

# Available commands:

      migrations:clear     Rollback all migrations and delete log table
      migrations:create    Create migration
      migrations:diff      Makes diff of source and target database or diff of migrations and database
      migrations:dump      Dump actual database structure to migration file
      migrations:rollback  Rollback migrations
      migrations:run       Run migrations
      migrations:status    List of migrations already executed and list of migrations to execute

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-03-05