phillipsharring/handlr-app-skeleton 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

phillipsharring/handlr-app-skeleton

最新稳定版本:v0.1.0

Composer 安装命令:

composer create-project phillipsharring/handlr-app-skeleton

包简介

App skeleton for Handlr, a lightweight PHP middleware framework

README 文档

README

Handlr

Starter project for building applications with Handlr Framework, a lightweight PHP middleware-style framework.

Installation

Using the Handlr Installer (recommended)

composer global require phillipsharring/handlr-installer:dev-main --prefer-stable

handlr new my-project

Using Composer

composer create-project phillipsharring/handlr-app my-project

Cloning the repository

git clone git@github.com:phillipsharring/handlr-app.git my-project
cd my-project
rm -rf .git
composer install
git init

Project Structure

app/                  Application code (PSR-4: App\)
  Auth/               Authentication (login, signup, logout, data layer)
  Events/             Event listener registration
  Users/              User CRUD handlers
  Roles/              Role & permission CRUD handlers
bootstrap.php         DI container setup, config loading, event registration
migrations/           Database migrations
seeds/                Database seeders
public/               Web root (index.php)
logs/                 Application logs
tests/                Pest test suite

Configuration

Copy .env.example to .env and configure your database connection:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_app
DB_USERNAME=root
DB_PASSWORD=

Development

Local Server

composer run dev

Starts PHP's built-in server at http://localhost:8000.

Database

composer run migrate          # Run next pending migration
composer run migrate:fresh    # Drop all tables and re-run all migrations
composer run migrate:rollback # Roll back the last migration
composer run seed             # Run seeders
composer run seed:fresh       # Truncate seeded tables and re-seed
composer run fresh            # migrate:fresh + seed:fresh

Code Generation

composer run make:migration CreateItemsTable
composer run make:record Item
composer run make:table ItemsTable
composer run make:handler CreateItem
composer run make:pipe PostCreateItem
composer run make:scaffold Item    # All of the above at once

Tests

composer run test

Architecture

This skeleton follows the Handlr convention of organizing code by feature, not by type:

app/
  Users/
    CreateUser/
      PostCreateUser.php         (Pipe  - HTTP layer)
      CreateUserHandler.php      (Handler  - business logic)
      CreateUserInput.php        (HandlerInput  - validated input)
    Read/
      GetUsersList.php           (Pipe  - list endpoint)
      GetOneUser.php             (Pipe  - detail endpoint)
    Data/
      UsersTable.php             (Table  - CRUD)
      UsersAdminQuery.php        (Query  - complex reads)
    Domain/
      UserRecord.php             (Record  - domain object)

Pipes handle HTTP (extract input, call handler, format response). Handlers contain business logic (receive typed input, return result). Routes wire pipes together in app/routes.php.

What's Included

  • User, role, and permission management (CRUD + assignment)
  • Session-based authentication (login, logout, signup)
  • CSRF protection with token rotation
  • CORS handling (same-origin)
  • Event system with listener registration
  • Database migrations for users, roles, permissions, and sessions

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固