modificato config.local per utilizzare un mongo remoto (pc-rik)

inserito qualche memo
This commit is contained in:
Riccardo Di Dato
2016-01-15 13:09:23 +01:00
parent d45f7f5c62
commit 104e01d910
5 changed files with 22 additions and 111 deletions
+8 -1
View File
@@ -1,3 +1,10 @@
modificare ".build.conf" nella root del progetto per impostare i path
modificare l path nello script di crontab in /oth/OSConfig
su mongo se non funzionano i text index:
use admin
db.runCommand({
setParameter: 1,
textSearchEnabled: 1
});
+10
View File
@@ -0,0 +1,10 @@
{
"titolo":"",
"sottotitolo":"",
"testo":"",
"isAnsa":false,
"about":{
"author":"",
"date":""
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ Creation Date: 07/gen/2016
// $dbconn->password = "root";
$database = new stdClass();
$database->dbName = "fdn2";
$database->connectionString = null;
$database->connectionString = "mongodb://10.0.0.2:27017";
$currentSystem = new stdClass();
$currentSystem->storageBaseDir = "/home/asdynamics/storage"; // Il path con storage ecc in cui mettere immagini, file temporanei ecc
+3 -3
View File
@@ -19,9 +19,9 @@ class GenericDao{
$this->mongoObj = new MongoClient();
}
else {
if (!preg_match("~^mongo[:][/][/]\w+[:]\w+$~",$connectionString)){
throw new CoreException("Invalid connectionString parameter passed to 'GenericDao::__construct()' ('".print_r($connectionString,true)."')");
}
// if (!preg_match("~^mongo[:][/][/]\w+[:].+$~",$connectionString)){
// throw new CoreException("Invalid connectionString parameter passed to 'GenericDao::__construct()' ('".print_r($connectionString,true)."')");
// }
$this->mongoObj = new MongoClient($connectionString);
}
@@ -47,112 +47,6 @@ $exposedFields = array(
$ret = DatatablesHelper::getResult($useModel, $permissionFlagRequired, $exposedFields);
echo json_encode($ret);
// $ret = new stdClass();
// $ret->draw = $_POST["draw"];
// $ret->recordsTotal = 0;
// $ret->recordsFiltered = 0;
// $ret->data = array();
// if (AdminLoginManager::isLogged()){
// $admin = AdminLoginManager::getLogged();
// if ($admin->hasRole($permissionFlagRequired)){
// $dao = GlobalVariables::get("dao");
// $filter = array();
// $options = array('limit'=>$_POST["length"], 'skip'=>$_POST["start"]);
// if (sizeof($_POST["order"])>0){
// foreach ($_POST["order"] as $details){
// $key = $_POST["columns"][$details["column"]]["data"];
// $options["sort"][$key] = strcasecmp($details["dir"], "asc")==0?1:-1;
// }
// }
// $models = $dao->query($useModel, $filter, $options);
// if (sizeof($models)>0){
// foreach ($models as $model){
// $result = new stdClass();
// foreach ($exposedFields as $key=>$subfield){
// if (is_array($subfield)){
// $result->$key = new stdClass();
// if (sizeof($subfield)>0){
// foreach ($subfield as $field){
// $result->$key->$field = $model->$key->$field;
// }
// }
// }
// else {
// $result->$key = $model->$key;
// }
// }
// $result->titolo = $model->titolo;
// $result->sottotitolo = $model->sottotitolo;
// $result->about = $model->about;
// $ret->data[] = $result;
// }
// }
// $ret->recordsTotal = $dao->count($useModel);
// $ret->recordsFiltered = $dao->count($useModel,$filter);
// }
// }
// echo json_encode($ret);
die();
$table = 'datatables_demo';
// Table's primary key
$primaryKey = 'id';
// Array of database columns which should be read and sent back to DataTables.
// The `db` parameter represents the column name in the database, while the `dt`
// parameter represents the DataTables column identifier. In this case object
// parameter names
$columns = array(
array( 'db' => 'first_name', 'dt' => 'first_name' ),
array( 'db' => 'last_name', 'dt' => 'last_name' ),
array( 'db' => 'position', 'dt' => 'position' ),
array( 'db' => 'office', 'dt' => 'office' ),
array(
'db' => 'start_date',
'dt' => 'start_date',
'formatter' => function( $d, $row ) {
return date( 'jS M y', strtotime($d));
}
),
array(
'db' => 'salary',
'dt' => 'salary',
'formatter' => function( $d, $row ) {
return '$'.number_format($d);
}
)
);
// SQL server connection information
$sql_details = array(
'user' => '',
'pass' => '',
'db' => '',
'host' => ''
);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP
* server-side, there is no need to edit below this line.
*/
require( 'ssp.class.php' );
echo json_encode(
SSP::simple( $_POST, $sql_details, $table, $primaryKey, $columns )
);
?>