yorch/v3wh

V3ctor WareHouse Core for MongoDb and MySQL

dev-master 2018-12-29 20:34 UTC

README

Description

V3ctor WareHouse Core for MongoDb and MySQL.

Requirements

Developer Documentation

Execute phpdoc -d v3wh/

Unit Test

For run Unit Test, complete information connection and execute the next commands:

phpunit V3WareHouseTest.php

Installation

Create file composer.json


{
    "require": {
    	"php": ">=5.4.0",
        "yorch/v3wh" : "dev-master",
        "monolog/monolog": "1.13.1",
        "catfan/medoo": "v1.1.2"
    }
}

Execute composer.phar install

Example


//$v3ctor = V3WareHouse::getInstance('v3Mongo', $hostname, $username, $password, $dbname, $port);

// For PHP 7
$v3ctor = V3WareHouse::getInstance('v3MongoDB', $hostname, $username, $password, $dbname, $port);

if (! $v3ctor->isConnected())
    die("Unable load V3ctor WareHouse");

$doc = array('r' => 666);

$newObject = $v3ctor->newObject("demo", $doc);

var_dump($newObject);

Notes

v3wh is a Core for MongoDb and needs php mongo module. For MySQL and SQL Server support is required _id field in the table, check demo.sql.

References

http://es.wikipedia.org/wiki/Singleton

P.D. Let's go play !!!