Merge remote branch 'upstream/master' into BUG-9630
This commit is contained in:
@@ -193,39 +193,39 @@ class Main extends Controller
|
||||
$availableLangArray = $this->getLanguagesList();
|
||||
|
||||
G::LoadClass ('serverConfiguration');
|
||||
if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) {
|
||||
//get the serverconf singleton, and check if we can send the heartbeat
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION','HEART_BEAT_CONF');
|
||||
$sflag = (trim($sflag)!='')? $sflag : '1';
|
||||
//get date of next beat
|
||||
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF');
|
||||
$this->memcache->set('nextBeatDate', $nextBeatDate, 1*3600);
|
||||
}
|
||||
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
|
||||
$sflag = (trim($sflag) != '') ? $sflag : '1';
|
||||
|
||||
//get date of next beat
|
||||
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||
|
||||
//if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
|
||||
if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
|
||||
if (($sflag == 1) && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
|
||||
//To do: we need to change to ExtJs
|
||||
$this->setJSVar('flagHeartBeat', 1);
|
||||
} else {
|
||||
$this->setJSVar('flagHeartBeat', 0);
|
||||
}
|
||||
|
||||
//check if we show the panel with the getting started info
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration ();
|
||||
$oCriteria = new Criteria ('workflow');
|
||||
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
|
||||
$oCriteria->add (ConfigurationPeer::OBJ_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
|
||||
$oCriteria->add (ConfigurationPeer::PRO_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::USR_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::APP_UID, '');
|
||||
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
|
||||
if ($flagGettingStarted == 0) {
|
||||
$this->setJSVar('flagGettingStarted', 1);
|
||||
} else {
|
||||
$this->setJSVar('flagGettingStarted', 0);
|
||||
if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) {
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration ();
|
||||
$oCriteria = new Criteria ('workflow');
|
||||
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
|
||||
$oCriteria->add (ConfigurationPeer::OBJ_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
|
||||
$oCriteria->add (ConfigurationPeer::PRO_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::USR_UID, '');
|
||||
$oCriteria->add (ConfigurationPeer::APP_UID, '');
|
||||
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
|
||||
$this->memcache->set('flagGettingStarted', $flagGettingStarted, 8*3600) ;
|
||||
}
|
||||
|
||||
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
|
||||
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
||||
|
||||
@@ -2,23 +2,7 @@
|
||||
|
||||
class Services_Rest_Case
|
||||
{
|
||||
public function get()
|
||||
{
|
||||
echo 'hello world';
|
||||
}
|
||||
|
||||
public function options22()
|
||||
{
|
||||
echo 'opts';
|
||||
}
|
||||
|
||||
public function post()
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
echo '{"response": "hello post"}';
|
||||
}
|
||||
|
||||
protected function get11($id = '', $start=null, $limit=null, $type=null, $filter=null, $search=null, $process=null, $user=null, $status=null, $typeResource=null, $dateFrom=null, $dateTo=null)
|
||||
protected function get($id = '', $start=null, $limit=null, $type=null, $filter=null, $search=null, $process=null, $user=null, $status=null, $typeResource=null, $dateFrom=null, $dateTo=null)
|
||||
{
|
||||
if (empty($id)) {
|
||||
// getting all records.
|
||||
|
||||
@@ -428,14 +428,15 @@
|
||||
// disable until confirm that rest is enabled & configured on rest-config.ini file
|
||||
$isRestRequest = false;
|
||||
$confFile = '';
|
||||
$restApiClassPath = '';
|
||||
|
||||
// try load and getting rest configuration
|
||||
if (file_exists(PATH_DATA_SITE . 'rest-config.ini')) {
|
||||
$confFile = PATH_DATA_SITE . 'rest-config.ini';
|
||||
$restApiClassPath = PATH_DATA_SITE;
|
||||
} elseif (file_exists(PATH_CONFIG . 'rest-config.ini')) {
|
||||
$confFile = PATH_CONFIG . 'rest-config.ini';
|
||||
}
|
||||
|
||||
if (! empty($confFile) && $restConfig = @parse_ini_file($confFile, true)) {
|
||||
if (array_key_exists('enable_service', $restConfig)) {
|
||||
if ($restConfig['enable_service'] == 'true' || $restConfig['enable_service'] == '1') {
|
||||
@@ -725,7 +726,7 @@
|
||||
$controller->setHttpRequestData($_REQUEST);
|
||||
$controller->call($controllerAction);
|
||||
} elseif ($isRestRequest) {
|
||||
G::dispatchRestService(SYS_TARGET, $restConfig);
|
||||
G::dispatchRestService(SYS_TARGET, $restConfig, $restApiClassPath);
|
||||
} else {
|
||||
require_once $phpFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user