simbiat/db-installer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

simbiat/db-installer

Composer 安装命令:

composer require simbiat/db-installer

包简介

Install database dependencies for a library based on the current version.

README 文档

README

Small library to install or update database dependencies of a library, based on its current version.

new \Simbiat\Database\Installer($dbh)::install(string $pattern, string $version = '0.0.0', string $replace_string = '', string $replace_with = '')

The constructor of the Installer class requires a \PDO object to establish connection, or it can be or null if you are using DB Pool library.

Then pass a pattern for glob() to get the files with SQL commands you need to run and current version string. The function will scan the respective folder(s) for files and then compare their names to the version provided. Those files that have a "greater" version number (based on version_compare()) will be concatenated and then run against the database. If the commands succeed, the function will return true, otherwise an exception will be thrown.

You can also pass $replace_string and $replace_with that will preg_replace() in the resulting set of queries. This is useful if you need to customize a database prefix, for example.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2025-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固