PluginProbe
JetBackup – Backup, Restore & Migrate / 3.1.21.3
JetBackup – Backup, Restore & Migrate v3.1.21.3
3.1.23.6 3.1.23.5 3.1.23.3 3.1.22.4 3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 All 82 releases
backup / src / JetBackup / JetBackupLinux / Query.php
Query.php
37 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace JetBackup\JetBackupLinux;
4
5 use JetBackup\Exception\JetBackupLinuxException;
6 use JetBackup\SocketAPI\Exception\SocketAPIException;
7 use JetBackup\SocketAPI\SocketAPI;
8
9 if (!defined( '__JETBACKUP__')) die('Direct access is not allowed');
10
11 class Query extends SocketAPI {
12
13 /**
14 * @param $function
15 *
16 * @return Query
17 * @throws JetBackupLinuxException
18 */
19 public static function api($function):Query {
20 if(!function_exists('socket_connect'))
21 throw new JetBackupLinuxException("The function socket_connect not installed or disabled within your PHP.");
22 return new Query($function);
23 }
24
25 public function execute() {
26
27 try {
28 $response = parent::execute();
29 } catch(SocketAPIException $e) {
30 throw new JetBackupLinuxException($e->getMessage());
31 }
32
33 if(!$response['success']) throw new JetBackupLinuxException($response['message']);
34 return $response['data'];
35 }
36
37 }