WIP: Untested, solo caricati file di test
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* Comment this file content if the service doesn't use any database
|
||||
*
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 14 dic 2016
|
||||
*/
|
||||
|
||||
use ASD\DB\DaoRegistry;
|
||||
use ASD\DB\Mongo\MongoDao;
|
||||
|
||||
$dbName = getenv("ASD_MONGO_DBNAME");
|
||||
$dbUser = getenv("ASD_MONGO_USER");
|
||||
$dbPass = getenv("ASD_MONGO_PASSWORD");
|
||||
$dbLocation = getenv("ASD_MONGO_LOCATION");
|
||||
|
||||
$connectionString = "mongodb://".$dbUser.":".$dbPass."@".$dbLocation."/".$dbName;
|
||||
if ($dbUser === false || $dbPass === false) {
|
||||
$connectionString = "mongodb://".$dbLocation."/".$dbName;
|
||||
}
|
||||
|
||||
DaoRegistry::addDao(new MongoDao("main", $dbName, $connectionString), true);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user