1 | <?php |
||
22 | class UpdaterController extends FOSRestController |
||
23 | { |
||
24 | /** |
||
25 | * Downloads all available updates to the server on which current |
||
26 | * app instance is running. Downloaded update packages, by default will be saved |
||
27 | * to 'app/cache/{env}' directory, until defined differently in bundle config. |
||
28 | * |
||
29 | * @ApiDoc( |
||
30 | * resource=true, |
||
31 | * description="Downloads updates", |
||
32 | * statusCodes={ |
||
33 | * 200="Returned on success.", |
||
34 | * 404="Returned when file could not be found at specified url." |
||
35 | * } |
||
36 | * ) |
||
37 | * @Route("/api/updates/download/{resource}", options={"expose"=true}) |
||
38 | * @Method("GET") |
||
39 | */ |
||
40 | public function downloadAction($resource) |
||
50 | |||
51 | /** |
||
52 | * Installs all available updates for given resource (e.g. core, plugin etc). |
||
53 | * If the updating process fails, it rollback all the changes and throws |
||
54 | * Exception with status code 500. |
||
55 | * |
||
56 | * @ApiDoc( |
||
57 | * resource=true, |
||
58 | * description="Installs all available updates.", |
||
59 | * statusCodes={ |
||
60 | * 200="Returned on success.", |
||
61 | * 404="Returned when fupdate package could not be found.", |
||
62 | * 422="Returned when given resource doesn't exist.", |
||
63 | * 500="Returned when instance could not be updated." |
||
64 | * } |
||
65 | * ) |
||
66 | * @Route("/api/updates/install/{resource}", options={"expose"=true}) |
||
67 | * @Method("POST") |
||
68 | */ |
||
69 | public function installAction($resource) |
||
81 | |||
82 | /** |
||
83 | * Gets all availbale updates which can be downloaded and installed. |
||
84 | * Updates can be fetched by diffrent channels: security, default, nightly. |
||
85 | * * security - security updates, |
||
86 | * * default - default updates (stable ones), |
||
87 | * * nightly - not stable updates. |
||
88 | * |
||
89 | * @ApiDoc( |
||
90 | * resource=true, |
||
91 | * description="Gets all availbale updates.", |
||
92 | * statusCodes={ |
||
93 | * 200="Returned when updates are available.", |
||
94 | * 404="Returned when updates are not available." |
||
95 | * } |
||
96 | * ) |
||
97 | * @Route("/api/updates/{channel}", options={"expose"=true}) |
||
98 | * @Method("GET") |
||
99 | */ |
||
100 | public function getAction($channel = '') |
||
108 | |||
109 | /** |
||
110 | * Gets the latest available update package which can be applied |
||
111 | * to the current application. |
||
112 | * |
||
113 | * @ApiDoc( |
||
114 | * resource=true, |
||
115 | * description="Gets the latest available update package." |
||
116 | * ) |
||
117 | * @Route("/api/updates/latest/", options={"expose"=true}) |
||
118 | * @Method("GET") |
||
119 | */ |
||
120 | public function latestAction() |
||
126 | } |
||
127 |