2017 © Pedro Peláez
 

library mysqli-pdo-bridge

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

image

anonymous-php/mysqli-pdo-bridge

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  • Thursday, June 21, 2018
  • by anonymous-php
  • Repository
  • 0 Watchers
  • 3 Stars
  • 87 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 18 Versions
  • 6 % Grown

The README.md

mysqli-pdo-bridge Build Status Latest Stable Version Total Downloads License

This library gives you the possibility to use mysqli connection with the PDO interfaces. No additional wrappers or methods provides., (*1)

Examples

New connection:, (*2)

<?php

use \Anonymous\MysqliPdoBridge\MysqliPDO;
use \Anonymous\MysqliPdoBridge\MysqliPDOStatement;

$pdo = new MysqliPDO('mysql:host=127.0.0.1;dbname=test', 'test', 'test');

/** @var MysqliPDOStatement $stmt */ 
$stmt = $pdo->prepare('SELECT * FROM test WHERE id = :id LIMIT 1');
$stmt->execute(array(':id' => 1));

$result = $stmt->fetch(\PDO::FETCH_ASSOC);

Existed connection:, (*3)

<?php

use \Anonymous\MysqliPdoBridge\MysqliPDO;

/**
 * @var \mysqli $mysqli
 */

$pdo = MysqliPDO::withConnection($mysqli);
// or
$pdo = new MysqliPDO($mysqli);

Get connection:, (*4)

<?php

use \Anonymous\MysqliPdoBridge\MysqliPDO;

/**
 * @var MysqliPDO $pdo
 */

$mysqli = $pdo->getConnection();

Installation

composer require anonymous-php/mysqli-pdo-bridge  

Error reporting

Error reporting modes implemented as in PDO but error codes and messages belong to Mysqli., (*5)

Implemented PDO fetch modes

  • PDO::FETCH_BOTH
  • PDO::FETCH_ASSOC
  • PDO::FETCH_NUM
  • PDO::FETCH_COLUMN
  • PDO::FETCH_CLASS
  • PDO::FETCH_OBJ
  • PDO::FETCH_FUNC
  • PDO::FETCH_INTO
  • PDO::FETCH_BOUND

Implemented PDO options (attributes)

  • PDO::ATTR_ERRMODE (PDO::ERRMODE_SILENT, PDO::ERRMODE_WARNING or PDO::ERRMODE_EXCEPTION, PDO::ERRMODE_SILENT by default)
  • PDO::ATTR_AUTOCOMMIT (true or false, true by default)
  • PDO::MYSQL_ATTR_USE_BUFFERED_QUERY (true or false, true by default)
  • PDO::ATTR_DEFAULT_FETCH_MODE (see implemented fetch modes)
  • PDO::MYSQL_ATTR_INIT_COMMAND (only for new connections)
  • PDO::ATTR_PERSISTENT (true or false, false by default)
  • PDO::ATTR_CONNECTION_STATUS (read only, null on error)

Possible issues

  • Stability
  • Performance
  • Exotic fetching modes
  • Cursors

Todo

  • Map "duplicate record" error on insert to PDO code
  • Method debugDumpParams
  • Tests
  • Documentation

Why?

We have a huge legacy project with mysqli which we want to refactor and we still have PHP 5.5 on several nodes., (*6)

The Versions

21/06 2018

dev-master

9999999-dev

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

21/06 2018

1.1.14

1.1.14.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

24/04 2018

1.1.13

1.1.13.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

23/04 2018

1.1.12

1.1.12.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

23/04 2018

1.1.11

1.1.11.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

20/04 2018

1.1.10

1.1.10.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

16/03 2018

1.1.9

1.1.9.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

16/03 2018

1.1.8

1.1.8.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

13/03 2018

1.1.7

1.1.7.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

13/03 2018

1.1.6

1.1.6.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

09/03 2018

1.1.5

1.1.5.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

08/02 2018

1.1.4

1.1.4.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

07/02 2018

1.1.3

1.1.3.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

07/02 2018

1.1.2

1.1.2.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

07/02 2018

1.1.1

1.1.1.0

Make your application PDO-compatible. This library gives you the possibility to use mysqli connection with the PDO interfaces.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Anonymous PHP Developer

php pdo mysql mysqli

07/02 2018

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Anonymous PHP Developer

06/02 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Anonymous PHP Developer

04/02 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Anonymous PHP Developer