定制 seinopsys/postgresql-database-class 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

seinopsys/postgresql-database-class

最新稳定版本:v3.1.1

Composer 安装命令:

composer require seinopsys/postgresql-database-class

包简介

PHP wrapper class for PDO-based interaction with PostgreSQL databases, heavily based on ThingEngineer's MysqliDb class

README 文档

README

This project is a PostgreSQL version of ThingEngineer's MysqliDb Class, that supports the basic functionality and syntax provided by said class, tailored specifically to PostgreSQL.

Installation

This class requires PHP 5.4+ or 7+ to work. You can either place the src/PostgresDb.php in your project and require/include it, or use Composer (strongly recommended)

composer require seinopsys/postgresql-database-class:^3.0

Usage

$db = new \SeinopSys\PostgresDb($database_name, $host, $username, $password);

For a more in-depth guide see USAGE.md

Upgrading from 2.x

  1. Removed deprecated methods

    These methods were deprecated in version 2.x and have been removed in 3.x. Use the renamed variants as indicated below:

    2.x 3.x
    $db->rawQuery(…); $db->query(…);
    $db->rawQuerySingle(…); $db->querySingle(…);
    $db->pdo(); $db->getConnection();
  2. Namespace change

    As of 3.x - to comply fully with the PSR-2 coding standard - the class now resides in the SeinopSys namespace. Here's a handy table to show what you need to change and how:

    2.x 3.x
    $db = new PostgresDb(…); $db = new \SeinopSys\PostgresDb(…);
    $db = new \PostgresDb(…); $db = new \SeinopSys\PostgresDb(…);
    use \PostgresDb;

    $db = new PostgresDb(…);
    use \SeinopSys\PostgresDb;

    $db = new PostgresDb(…);
  3. Internal code structure changes

    As of 3.x all private/protected methods and properties have dropped the _ prefix, so be sure to update your wrapper class (if you use one).

统计信息

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

GitHub 信息

  • Stars: 35
  • Watchers: 6
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2016-10-12