1 | <?php |
||
3 | class RatingApiController extends ApiController |
||
4 | { |
||
5 | private static $url_handlers = [ |
||
|
|||
6 | 'GET $Vendor/$Package' => 'index', |
||
7 | ]; |
||
8 | |||
9 | private static $allowed_actions = [ |
||
10 | 'index', |
||
11 | ]; |
||
12 | |||
13 | /** |
||
14 | * Set the default cache lifetime in seconds. Only used outside of "dev" environments. |
||
15 | * |
||
16 | * @config |
||
17 | * @var int |
||
18 | */ |
||
19 | private static $cache_age = 10800; |
||
20 | |||
21 | public function index(SS_HTTPRequest $request) |
||
44 | |||
45 | /** |
||
46 | * Given a package name, return the Addon model for it |
||
47 | * |
||
48 | * @param string $packageName |
||
49 | * @return Addon |
||
50 | */ |
||
51 | protected function getAddon($packageName) |
||
55 | |||
56 | /** |
||
57 | * Get the module metrics that will be returned |
||
58 | * |
||
59 | * @param Addon $addon |
||
60 | * @param boolean $detailed |
||
61 | * @return array |
||
62 | */ |
||
63 | protected function getAddonMetrics(Addon $addon, $detailed) |
||
83 | } |
||
84 |