Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'feature/ag-version-api'
Browse files Browse the repository at this point in the history
Close #353
  • Loading branch information
weierophinney committed Aug 10, 2016
2 parents 57ba4c3 + 19c9177 commit d96fcb3
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 12 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.5.1 - TBD
## 1.5.1 - 2016-08-10

### Added

- Nothing.
- [#353](https://github.com/zfcampus/zf-apigility-admin/pull/353) adds the
`apigility-version` API, to allow reporting to the UI the current Apigility
skeleton version. It returns the value of `Apigility\VERSION` if defined, and
`@dev` if not.

### Deprecated

Expand Down
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ update your application using the following steps:
- Update your `config/development.config.php` and
`config/development.config.php.dist` files:
- Remove from the modules list:
- 'ZFTool`
- `ZFTool`
- Remove `composer.lock`
- Remove, recursively, the `vendor/` subdirectory
- Execute `composer install`
Expand Down Expand Up @@ -165,7 +165,6 @@ update your application using the following steps:
> $ ./vendor/bin/zf-development-mode status
> ```
Configuration
-------------
Expand All @@ -187,6 +186,27 @@ API Endpoints
All routes are prefixed with `/apigility` by default.
### api/apigility-version
- Since 1.5.1
Returns the current Apigility version if it can be discovered, and the string
`@dev` otherwise. The payload is in the `version` key:
```json
{
"version": "1.4.0"
}
```
- `Accept`: `application/json`
- `Content-Type`: `application/json`
- Methods: `GET`
- Errors: none
### api/config
This endpoint is for examining the application configuration, and providing
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"zendframework/zend-validator": "^2.8.1",
"zendframework/zend-view": "^2.8.1",
"zfcampus/zf-apigility": "^1.3",
"zfcampus/zf-apigility-admin-ui": "^1.3.2",
"zfcampus/zf-apigility-admin-ui": "^1.3.3",
"zfcampus/zf-apigility-provider": "^1.2",
"zfcampus/zf-api-problem": "^1.2.1",
"zfcampus/zf-configuration": "^1.2",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
Controller\Versioning::class => Controller\VersioningController::class,
],
'factories' => [
Controller\ApigilityVersionController::class => InvokableFactory::class,
Controller\AppController::class => InvokableFactory::class,
Controller\AuthenticationController::class => Controller\AuthenticationControllerFactory::class,
Controller\AuthenticationType::class => Controller\AuthenticationTypeControllerFactory::class,
Expand Down Expand Up @@ -113,6 +114,16 @@
],
'may_terminate' => false,
'child_routes' => [
'apigility-version' => [
'type' => 'Literal',
'options' => [
'route' => '/apigility-version',
'defaults' => [
'controller' => Controller\ApigilityVersionController::class,
'action' => 'index',
],
],
],
'dashboard' => [
'type' => 'Literal',
'options' => [
Expand Down Expand Up @@ -459,6 +470,7 @@

'zf-content-negotiation' => [
'controllers' => [
Controller\ApigilityVersionController::class => 'Json',
Controller\Authentication::class => 'HalJson',
Controller\AuthenticationType::class => 'Json',
Controller\Authorization::class => 'HalJson',
Expand Down Expand Up @@ -488,6 +500,10 @@
Controller\Versioning::class => 'Json',
],
'accept_whitelist' => [
Controller\ApigilityVersionController::class => [
'application/json',
'application/*+json',
],
Controller\Authentication::class => [
'application/json',
'application/*+json',
Expand Down Expand Up @@ -864,6 +880,10 @@
],

'zf-rpc' => [
Controller\ApigilityVersionController::class => [
'http_methods' => ['GET'],
'route_name' => 'zf-apigility/api/apigility-version',
],
Controller\Authentication::class => [
'http_methods' => ['GET', 'POST', 'PUT', 'DELETE'],
'route_name' => 'zf-apigility/api/authentication',
Expand Down
20 changes: 20 additions & 0 deletions src/Controller/ApigilityVersionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)
*/

namespace ZF\Apigility\Admin\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;

class ApigilityVersionController extends AbstractActionController
{
public function indexAction()
{
return new JsonModel([
'version' => defined('Apigility\VERSION') ? \Apigility\VERSION : '@dev',
]);
}
}

0 comments on commit d96fcb3

Please sign in to comment.