new endpoint for get configuration PM
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user