承接 simbiat/db-installer 相关项目开发

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

邮箱: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
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

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

其他信息

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