Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robbestad/sardatabases
A ZF2 module to make connecting to databases a breeze. Currently includes support for MongoDB.
https://github.com/robbestad/sardatabases
Last synced: about 2 months ago
JSON representation
A ZF2 module to make connecting to databases a breeze. Currently includes support for MongoDB.
- Host: GitHub
- URL: https://github.com/robbestad/sardatabases
- Owner: robbestad
- Created: 2014-01-09T14:13:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-05T09:40:36.000Z (almost 11 years ago)
- Last Synced: 2024-11-10T13:43:19.865Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 296 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Database modules for ZF2
A ZF2 module to make connecting to databases a breeze
Currently includes support for MongoDB and MySQL. More will be added eventually
## Note about MAMP and MySQL
For local testing, use 127.0.0.1 instead of localhost, and uncheck "Allow local access only" in the MAMP PRO settings.###More info
http://blog.robbestad.com
### How to use
In your composer.json, add the following line
"svenanders/sardatabases": "dev-master"
Add the following line to your **application.config.php**:
'modules' => array(
'SarDatabases',
),
In your code, include the class:use SarDatabases;
and then in your functions, use it like this:
$dbConn = new Databases\SarMongo("environment", "database", "collection");
$cursor = $dbConn->find(array("key" => "value"));Supports:
->find
->insert
->update
->deleteTests:
execute **phpunit vendor/svenanders/sardatabases/tests/** from the root of your project to run the tests
#####License:
Sven Anders Robbestad (C) 2014