ap-lib/mysql-instance
Composer 安装命令:
composer require ap-lib/mysql-instance
包简介
README 文档
README
A lightweight MySQL connection instancer with a simple and efficient API.
Installation
composer require ap-lib/mysql-instancer
Features
- Singleton-based MySQL connection management
- Easy configuration handling
- Automatic connection instantiation
- Scheme bases settings object, can be used for conf module
Requirements
- PHP 8.3 or higher
- MySQL database
Getting Started
Define a MySQL Instance
class DbName { use MysqlInstance; static protected function conf(): Mysql { return Core::conf()->db_name(); } }
Usage
$connection = DbName::get() ->select("users") ->fetchAll();
This retrieves a singleton instance of the Connect object with the predefined configuration.
License
This project is licensed under the MIT License.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-14