new endpoint for get configuration PM

This commit is contained in:
Ronald Quenta
2015-04-30 17:08:24 -04:00
parent 5ccc12b450
commit 877ce12abd
2 changed files with 31 additions and 0 deletions

View File

@@ -1051,5 +1051,18 @@ class Light
}
return $result;
}
/**
* Get configuration
* @return mixed
*/
public function getConfiguration()
{
$sysConf = \System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() );
$response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) );
return $response;
}
}

View File

@@ -1117,4 +1117,22 @@ class Light extends Api
}
return $return;
}
/**
* Get configuration ProcessMaker
*
* @return array
*
* @url GET /config
*/
public function getConfiguration()
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light();
$response = $oMobile->getConfiguration();
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
}