PluginProbe
Depicter — Popup & Slider Builder / 1.3.2
Depicter — Popup & Slider Builder v1.3.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Controllers / Ajax / AppInfoAjaxController.php

AppInfoAjaxController.php in Depicter — Popup & Slider Builder 1.3.2, at app/src/Controllers/Ajax/AppInfoAjaxController.php

36 lines 866 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Controllers\Ajax;
3
4 use Averta\WordPress\Utility\JSON;
5 use Depicter\GuzzleHttp\Exception\GuzzleException;
6 use Psr\Http\Message\ResponseInterface;
7 use WPEmerge\Requests\RequestInterface;
8
9 class AppInfoAjaxController {
10
11 /**
12 * Retrieves Lists of all entries. (GET)
13 *
14 * @param RequestInterface $request
15 * @param string $view
16 *
17 * @return ResponseInterface
18 * @throws GuzzleException
19 */
20 public function changelogs( RequestInterface $request, string $view)
21 {
22 try {
23 $response = \Depicter::remote()->get( 'v1/core/changelogs', [ 'query' => $request->getQueryParams() ] );
24 return \Depicter::json(
25 JSON::decode( $response->getBody(), true )
26 )->withStatus( 200 );
27
28 } catch( \Exception $exception ) {
29 return \Depicter::json([
30 'errors' => [ $exception->getMessage() ]
31 ])->withStatus( 503 );
32 }
33 }
34
35 }
36