ody / ody-skel
This package is abandoned and no longer maintained.
The author suggests using the ody/framework package instead.
There is no license information available for the latest version (0.0.1) of this package.
A minimal skeleton for ODY framework
0.0.1
2025-03-05 22:49 UTC
Requires
- php: >=8.3
- ext-json: *
- ody/core: ^0.0.2
- ody/database: ^0.0.2
- ody/http-server: ^0.0.2
- ody/scheduler: ^0.0.1
- ody/swoole: ^0.0.2
- ody/websocket: ^0.0.2
This package is auto-updated.
Last update: 2025-03-27 22:12:30 UTC
README
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