承接 leafs/db 相关项目开发

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

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

leafs/db

最新稳定版本:v4.0.2

Composer 安装命令:

composer require leafs/db

包简介

Leaf PHP db module.

README 文档

README



Leaf Db v4



Latest Stable Version Total Downloads License

Leaf DB is a simple, lightweight and easy to use database module for PHP. It gives you a simple interface to connect to your database and perform basic operations like creating tables, inserting data, selecting data and more without the need for complex ORMs or database libraries. Leaf DB is built on top of PDO, so it supports all the features of PDO and is compatible with most databases.

Installation

You can easily install Leaf using Composer.

leaf install db # or with composer composer require leafs/db

Basic usage

After installing leaf db, you need to connect to your database to use any of the db functions.

$db = new Leaf\Db('127.0.0.1', 'dbName', 'user', 'password'); # or $db = new Leaf\Db(); $db->connect('127.0.0.1', 'dbName', 'user', 'password');

If you're using leaf db in a leaf 4 app, you will have access to the db global

db()->connect('127.0.0.1', 'dbName', 'user', 'password');

This is done automatically if you are using Leaf MVC.

From there, you can use any db method.

$users = db()->select('users')->all();

Checkout leaf db's complete documentation.

统计信息

  • 总下载量: 27.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 3
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固