-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManagerInfoService.php
More file actions
49 lines (48 loc) · 1.62 KB
/
ManagerInfoService.php
File metadata and controls
49 lines (48 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 WebFiori Framework
*
* For more information on the license, please visit:
* https://github.com/WebFiori/http/blob/master/LICENSE
*/
namespace WebFiori\Http;
/**
* A service which can be used to display information about services manager.
*
* The developer must extend this class and complete the implementation of
* the method AbstractWebService::isAuthorized() in order to use it.
*
* @author Ibrahim
*
*/
abstract class ManagerInfoService extends AbstractWebService {
/**
* Creates new instance of the class.
*
*/
public function __construct() {
parent::__construct('api-info');
$this->setDescription('Returns a JSON string that contains all '
.'needed information about all end points which are registered '
.'under given manager.');
$this->addParameter([
ParamOption::NAME => 'version',
ParamOption::TYPE => ParamType::STRING,
ParamOption::OPTIONAL => true,
ParamOption::DESCRIPTION => 'Optional parameter. '
.'If set, the information that will be returned will be specific '
.'to the given version number.'
]);
$this->setRequestMethods(RequestMethod::GET, RequestMethod::POST);
}
/**
* Sends back JSON response that contains information about the services
* at which the manager which is associated with the instance manages.
*
*/
public function processRequest() {
$this->send('application/json', $this->getManager()->toJSON());
}
}