tgrj/tweb_db
最新稳定版本:v1.1.0
Composer 安装命令:
composer require tgrj/tweb_db
包简介
minimalistic db handler
README 文档
README
minimalistic db handler
Idea
It's no database abstraction framework or so. It's rather some kind of wrapper for some PHP functions and some pre-defined functions doing some very basic database work. The usage of the database later in the project will get the PDO from this module and use it for further actual database handling.
Usage
- tweb_get_pdo(string $config_key = 'db')
$config_keyis a tweb_config key, under which the db array config is stored. it should at least contain the key type, which is either sqlite or mysql. For the first one the config array should also contain file. For mysql it should contain host, dbname, username, password. The function will return a PDO instance on success, or throw an exception otherwise.
- tweb_execute_sql_file(\PDO $pdo, string $sql_file)
- With that function you can execute SQL code from the given file.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-03