Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bartko-s/stefano-db
[DEPRECATED]
https://github.com/bartko-s/stefano-db
Last synced: 5 days ago
JSON representation
[DEPRECATED]
- Host: GitHub
- URL: https://github.com/bartko-s/stefano-db
- Owner: bartko-s
- Created: 2013-06-03T09:38:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-10-01T10:11:31.000Z (over 2 years ago)
- Last Synced: 2024-12-10T03:53:17.405Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[DEPRECATED] Stefano Db
=======================Zend DB from [v.2.4.0](https://github.com/zendframework/zend-db/releases/tag/release-2.4.0) support nested transactions. Please use [Zend Db](https://github.com/zendframework/zend-db/) instead of this library. This library is NOT MAINTAINED anymore.
[![Build Status](https://app.travis-ci.com/bartko-s/stefano-db.svg?branch=master)](https://app.travis-ci.com/bartko-s/stefano-db)
[![Code Coverege](https://coveralls.io/repos/bartko-s/stefano-db/badge.png?branch=master)](https://coveralls.io/r/bartko-s/stefano-db?branch=master)Installation using Composer
--------------------------
1. Run command ``` composer require stefano/stefano-db ```Features
------------
- extend Zend Framework 2 Database adapter. For more info see [Zend Db](http://framework.zend.com/manual/2.3/en/index.html#zend-db)
- nested transaction. For more info see [Stefano nested transaction](https://github.com/bartko-s/stefano-nested-transaction/)
- execute defined queries after db connection will be createdDb Adapter Configuration
------------------------```
//$option for more info see Zend Framework 2 Db documentation
$adapter = new \StefanoDb\Adapter\Adapter($options);
```Nested transaction API
----------------------```
$adapter->begin();
$adapter->commit();
$adapter->rollback();
```Usage with Zend Framework 2 MVC
-------------------------------- single DB connection configuration
```
return array(
//single DB connection
'db' => array(
'driver' => '',
'database' => '',
'username' => '',
'password' => '',
'sqls' => array(
"SET time_zone='+0:00'",
"....."
),
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter'
=> '\StefanoDb\Adapter\Service\AdapterServiceFactory',
),
),
);
```- multiple DB connection configuration
```
return array(
'db' => array(
'adapters' => array(
'Db/Write' => array(
'driver' => '',
'database' => '',
'username' => '',
'password' => '',
'sqls' => array(
"SET time_zone='+0:00'",
"....."
),
),
'Db/Read' => array(
'driver' => '',
'database' => '',
'username' => '',
'password' => '',
'sqls' => array(
"SET time_zone='+0:00'",
"....."
),
),
),
),
'service_manager' => array(
'abstract_factories' => array(
'\StefanoDb\Adapter\Service\AdapterAbstractServiceFactory',
),
),
);
```