承接 ap-lib/mysql-instance 相关项目开发

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

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

ap-lib/mysql-instance

Composer 安装命令:

composer require ap-lib/mysql-instance

包简介

README 文档

README

MIT License

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-14