PHP Classes

V3ctor WareHouse: Store and retrieve objects in MongoDB and MySQL

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 93 All time: 9,888 This week: 455Up
Version License PHP version Categories
v3wh 1.0Custom (specified...5PHP 5, Databases


This package can store and retrieve objects in MongoDB, MySQL and Microsoft SQL Server.

There is a factory class that will create instances of the warehouse classes.

The warehouse classes can create, retrieve, update and delete objects given their keys and values in PHP variables.

Picture of Yorch Ponce
Name: Yorch Ponce <contact>
Classes: 6 packages by
Country: Mexico Mexico
Age: 43
All time rank: 206022 in Mexico Mexico
Week rank: 307 Up4 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 1x


require 'config.php';

// For JavaScript SDK
header("Access-Control-Allow-Origin: *");

// Init Database Connection
V3WareHouse::getInstance("v3MongoDB", $hostname, $username, $password, $dbname, $port);

// Init Application
$app = new V3Application($dbname, $key);

// Add Custom Route
$app->addRoute('/openshift', function () {
$app = \Slim\Slim::getInstance();

$app->response()->header('Content-Type', 'application/json');

$msg = array("msg" => "Hello localhost !!!");

$envvar = getenv('OPENSHIFT_MONGODB_DB_HOST');

                if (! empty(
$msg = array("msg" => "Hello Openshift !!!");

// Start V3ctor Application



V3 WareHouse Core


V3ctor WareHouse Core for MongoDb and MySQL.


Developer Documentation

Execute phpdoc -d v3wh/

Unit Test

For run Unit Test, complete information connection and execute the next commands: > phpunit V3WareHouseTest.php


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


//$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);



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.


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

  Files folder image Files  
File Role Description
Files folder imagev3mysql (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file demo.sql Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file Doc. Documentation
Plain text file V3WareHouse.class.php Class Class source
Accessible without login Plain text file V3WareHouseMyTest.php Test Class source
Accessible without login Plain text file V3WareHouseTest.php Test Class source
Plain text file WareHouse.class.php Class Class source

  Files folder image Files  /  v3mysql  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Plain text file DB.php Class Class source
  Accessible without login Plain text file index.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,888
This week:455Up