2014-02-14 09:51:26 -04:00
|
|
|
<?php
|
2014-04-02 17:02:02 -04:00
|
|
|
namespace ProcessMaker\Services\Api;
|
2014-02-14 09:51:26 -04:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
*
|
2014-02-14 10:00:45 -04:00
|
|
|
* @url GET /db-engines
|
2014-02-14 09:51:26 -04:00
|
|
|
*/
|
|
|
|
|
public function doGetDataBaseEngines()
|
|
|
|
|
{
|
|
|
|
|
try {
|
2014-04-02 17:02:02 -04:00
|
|
|
$oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
|
2014-02-14 09:51:26 -04:00
|
|
|
$response = $oDBConnection->getDbEngines();
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-09 15:23:38 -04:00
|
|
|
/**
|
|
|
|
|
* Get count for all lists
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /counters-lists
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCountersLists()
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userId = $this->getUserId();
|
|
|
|
|
$lists = new \ProcessMaker\BusinessModel\Lists();
|
|
|
|
|
$response = $lists->getCounters($userId);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-02-14 09:51:26 -04:00
|
|
|
|
2015-05-22 11:35:51 -04:00
|
|
|
/**t
|
2015-03-10 16:32:57 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Gustavo Cruz <gustavo.cruz@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /enabled-features
|
|
|
|
|
*/
|
|
|
|
|
public function doGetEnabledFeatures()
|
|
|
|
|
{
|
|
|
|
|
try {
|
2015-03-23 11:14:10 -04:00
|
|
|
$enabledFeatures = array();
|
2015-05-22 11:35:51 -04:00
|
|
|
/*----------------------------------********---------------------------------*/
|
2015-03-10 16:32:57 -04:00
|
|
|
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
|
|
|
|
|
foreach ($keys as $key) {
|
|
|
|
|
if (\PMLicensedFeatures
|
|
|
|
|
::getSingleton()
|
|
|
|
|
->verifyfeature($key)) {
|
|
|
|
|
$enabledFeatures[] = $key;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-05-22 11:35:51 -04:00
|
|
|
/*----------------------------------********---------------------------------*/
|
2015-03-10 16:32:57 -04:00
|
|
|
return $enabledFeatures;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|