mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
fix #601 add consistency, add type key, rename install_name -> name
This commit is contained in:
@@ -30,32 +30,35 @@ return call_user_func(function() {
|
||||
$app["appbox"] = \appbox::get_instance($app['Core']);
|
||||
|
||||
$app->get(
|
||||
'/', function() use ($app) {
|
||||
'/', function(Request $request) use ($app) {
|
||||
$registry = $app["Core"]->getRegistry();
|
||||
|
||||
$apiAdapter = new \API_V1_adapter(false, $app["appbox"], $app["Core"]);
|
||||
$versionNumber = (float) \Alchemy\Phrasea\Core\Version::getNumber();
|
||||
$ret = array(
|
||||
'install_name' => $registry->get('GV_homeTitle'),
|
||||
'description' => $registry->get('GV_metaDescription'),
|
||||
'documentation' => 'https://docs.phraseanet.com/Devel',
|
||||
'versions' => array(
|
||||
'1' => array(
|
||||
'number' => $apiAdapter->get_version(),
|
||||
'uri' => '/api/v1/',
|
||||
'authenticationProtocol' => 'OAuth2',
|
||||
'authenticationVersion' => 'draft#v9',
|
||||
'authenticationEndPoints' => array(
|
||||
'authorization_token' => '/api/oauthv2/authorize',
|
||||
'access_token' => '/api/oauthv2/token'
|
||||
|
||||
$result = new \API_V1_result($request, $apiAdapter);
|
||||
|
||||
$result->set_datas(
|
||||
array(
|
||||
'name' => $registry->get('GV_homeTitle'),
|
||||
'type' => 'phraseanet',
|
||||
'description' => $registry->get('GV_metaDescription'),
|
||||
'documentation' => 'https://docs.phraseanet.com/Devel',
|
||||
'versions' => array(
|
||||
'1' => array(
|
||||
'number' => $apiAdapter->get_version(),
|
||||
'uri' => '/api/v1/',
|
||||
'authenticationProtocol' => 'OAuth2',
|
||||
'authenticationVersion' => 'draft#v9',
|
||||
'authenticationEndPoints' => array(
|
||||
'authorization_token' => '/api/oauthv2/authorize',
|
||||
'access_token' => '/api/oauthv2/token'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$json = $app["Core"]['Serializer']->serialize($ret, 'json');
|
||||
|
||||
return new Response($json, 200, array('content-type' => 'application/json'));
|
||||
return $result->get_response();
|
||||
});
|
||||
|
||||
return $app;
|
||||
|
@@ -24,7 +24,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $version = '1.1';
|
||||
protected $version = '1.2';
|
||||
|
||||
/**
|
||||
* Appbox where the API works
|
||||
|
Reference in New Issue
Block a user