Merged in cochalo/processmaker (pull request #194)
Adicion de end point SYSTEM para DBEngines
This commit is contained in:
@@ -100,22 +100,7 @@ class DataBaseConnection
|
||||
|
||||
if (isset($dataDBConnection['DBS_TYPE'])) {
|
||||
$typesExists = array();
|
||||
G::LoadClass( 'dbConnections' );
|
||||
$dbs = new dbConnections($pro_uid);
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
foreach ($dbServices as $value) {
|
||||
$typesExists[] = $value['id'];
|
||||
}
|
||||
if (!in_array($dataDBConnection['DBS_TYPE'], $typesExists)) {
|
||||
throw (new \Exception("This 'dbs_type' is invalid"));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($dataDBConnection['DBS_TYPE'])) {
|
||||
$typesExists = array();
|
||||
|
||||
$dbs = new dbConnections($pro_uid);
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
$dbServices = $this->getDbEngines();
|
||||
foreach ($dbServices as $value) {
|
||||
$typesExists[] = $value['id'];
|
||||
}
|
||||
@@ -313,6 +298,23 @@ class DataBaseConnection
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Data Base Engines
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDbEngines () {
|
||||
if (!class_exists('dbConnections')) {
|
||||
G::LoadClass('dbConnections');
|
||||
}
|
||||
$dbs = new dbConnections();
|
||||
$dbServices = $dbs->getDbServicesAvailables();
|
||||
return $dbServices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Process Uid
|
||||
* @var string $pro_uid. Uid for process
|
||||
|
||||
@@ -58,12 +58,12 @@ class DataBaseConnection extends Api
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $dbs_type {@from body} {@required true}
|
||||
* @param string $dbs_server {@from body} {@required true}
|
||||
* @param string $dbs_database_name {@from body} {@required true}
|
||||
* @param string $dbs_type {@from body} {@min 1}
|
||||
* @param string $dbs_server {@from body} {@min 1}
|
||||
* @param string $dbs_database_name {@from body} {@min 1}
|
||||
* @param string $dbs_username {@from body}
|
||||
* @param string $dbs_port {@from body} {@type float}
|
||||
* @param string $dbs_encode {@from body} {@required true}
|
||||
* @param string $dbs_encode {@from body} {@min 1}
|
||||
* @param string $dbs_password {@from body}
|
||||
* @param string $dbs_description {@from body}
|
||||
* @return array
|
||||
@@ -99,12 +99,12 @@ class DataBaseConnection extends Api
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $dbs_type {@from body} {@required true}
|
||||
* @param string $dbs_server {@from body} {@required true}
|
||||
* @param string $dbs_database_name {@from body} {@required true}
|
||||
* @param string $dbs_type {@from body} {@min 1}
|
||||
* @param string $dbs_server {@from body} {@min 1}
|
||||
* @param string $dbs_database_name {@from body} {@min 1}
|
||||
* @param string $dbs_username {@from body}
|
||||
* @param string $dbs_port {@from body} {@type float}
|
||||
* @param string $dbs_encode {@from body} {@required true}
|
||||
* @param string $dbs_encode {@from body} {@min 1}
|
||||
* @param string $dbs_password {@from body}
|
||||
* @param string $dbs_description {@from body}
|
||||
* @return array
|
||||
|
||||
33
workflow/engine/src/Services/Api/ProcessMaker/System.php
Normal file
33
workflow/engine/src/Services/Api/ProcessMaker/System.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
/**
|
||||
* Pmtable Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class System extends Api
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /dbEngines
|
||||
*/
|
||||
public function doGetDataBaseEngines()
|
||||
{
|
||||
try {
|
||||
$oDBConnection = new \BusinessModel\DataBaseConnection();
|
||||
$response = $oDBConnection->getDbEngines();
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user