diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index 98c92052b..e5a4421e0 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -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; + } + } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index 1fcd65d68..7d4b06f8e 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -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; + } }