承接 thephprame/thephprame-core 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

thephprame/thephprame-core

最新稳定版本:v1.0.5

Composer 安装命令:

composer require thephprame/thephprame-core

包简介

Core of the phprame framework

README 文档

README

Core utilities and base classes for the phprame PHP micro-framework.

This package contains the core building blocks used by thephprame applications: base controller and model classes, HTTP request/response wrappers, routing helpers, middleware base, and lightweight helpers for files, cookies, encryption and database access.

Key Features

  • Minimal, framework-agnostic helpers for small apps
  • Base classes: controllers, models and middleware
  • Request/Response and routing support
  • Small utility helpers: Files, Cookies, Encryption, Database

Installation

If the package is available via Composer (packagist):

composer require thephprame/thephprame-core

For local development (when using this repo as a local package), add a path repository to your application's composer.json and require the package by name:

"repositories": [
  { "type": "path", "url": "../local-packages/thephprhame-core" }
]

Then run composer require thephprame/thephprame-core in your application.

Quick Usage

These examples illustrate common patterns — adapt them to your app structure.

Controllers

Extend the base controller to create action methods used by routes:

class HomeController extends Controller
{
    public function index()
    {
        return Response::view('home', ['name' => 'world']);
    }
}

Models

Create models by extending Model for simple DB interactions:

class User extends Model
{
    protected $table = 'users';
}

$user = (new User())->find(1);

Routing

Register routes using the Routes helper (see the application's Routes files):

Routes::get('/', [HomeController::class, 'index']);
Routes::post('/api/items', [ItemController::class, 'store']);

Request / Response

Use Request to access input and Response to send responses:

$name = Request::input('name', 'guest');
return Response::json(['hello' => $name]);

Utility Classes (brief)

  • Controller — base controller class
  • Model — base model with simple DB helpers
  • Routes — route registration helpers
  • Request / Response — HTTP wrappers
  • Middleware — base middleware class
  • Database / DatabaseHelper — DB connection and helpers
  • Encryption — encryption utilities
  • File / Files — file helpers
  • Cookie / Cookies — cookie helpers
  • IException — core exception interface

Contributing

Contributions are welcome. Please open issues or pull requests against the repository. Keep changes focused and include tests/examples where appropriate.

License

The package is distributed under the MIT License. See the composer.json for license metadata.

Authors

See composer.json authors field for package authors.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-21