Completed
Branch master (bc9f89)
by Sand
02:02
created
SandCage.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 
29 29
 	/** 
30
-	* The "schedule-tasks" service
31
-	* @param array $payload values to send
32
-	* @param string $callback_endpoint to send the callback to
33
-	*/ 
30
+	 * The "schedule-tasks" service
31
+	 * @param array $payload values to send
32
+	 * @param string $callback_endpoint to send the callback to
33
+	 */ 
34 34
 	public function scheduleFiles($payload, $callback_endpoint='') {
35 35
 
36 36
 		$this->post = true;
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	/** 
48
-	* The "destroy-files" service
49
-	* @param array $payload values to send
50
-	* @param string $callback_endpoint to send the callback to
51
-	*/ 
48
+	 * The "destroy-files" service
49
+	 * @param array $payload values to send
50
+	 * @param string $callback_endpoint to send the callback to
51
+	 */ 
52 52
 	public function destroyFiles($payload, $callback_endpoint='') {
53 53
 
54 54
 		$this->post = true;
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	/** 
66
-	* The "list-files" service
67
-	* @param array $payload values to send
68
-	*/ 
66
+	 * The "list-files" service
67
+	 * @param array $payload values to send
68
+	 */ 
69 69
 	public function listFiles($payload) {
70 70
 
71 71
 		$this->post = true;
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	/** 
79
-	* The "get-info" service
80
-	* @param array $payload values to send
81
-	*/ 
79
+	 * The "get-info" service
80
+	 * @param array $payload values to send
81
+	 */ 
82 82
 	public function getInfo($payload) {
83 83
 
84 84
 		$this->post = true;
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	}
90 90
 
91 91
 	/** 
92
-	* Send a requst using cURL 
93
-	* @param string $service_endpoint to request
94
-	*/ 
92
+	 * Send a requst using cURL 
93
+	 * @param string $service_endpoint to request
94
+	 */ 
95 95
 	public function call($service_endpoint) {
96 96
 
97 97
 		// Initialize the cURL session
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	}
131 131
 
132 132
 	/** 
133
-	* Return the HTTP status of the call
134
-	* @return array or FALSE on failure 
135
-	*/ 
133
+	 * Return the HTTP status of the call
134
+	 * @return array or FALSE on failure 
135
+	 */ 
136 136
 	public function getHttpStatus() {
137 137
 
138 138
 		return $this->status;
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 	/** 
143
-	* Return the HTTP status of the call
144
-	* @return array or FALSE on failure  
145
-	*/ 
143
+	 * Return the HTTP status of the call
144
+	 * @return array or FALSE on failure  
145
+	 */ 
146 146
 	public function getResponse() {
147 147
 
148 148
 		return $this->response;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	* @param array $payload values to send
32 32
 	* @param string $callback_endpoint to send the callback to
33 33
 	*/ 
34
-	public function scheduleFiles($payload, $callback_endpoint='') {
34
+	public function scheduleFiles($payload, $callback_endpoint = '') {
35 35
 
36 36
 		$this->post = true;
37 37
 		$this->post_fields = array('key'=>$this->sandcage_api_key) + $payload;
38 38
 
39
-		if ( $callback_endpoint != '' ) {
39
+		if ($callback_endpoint != '') {
40 40
 			$this->post_fields['callback_url'] = $callback_endpoint;
41 41
 		}
42 42
 
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 	* @param array $payload values to send
50 50
 	* @param string $callback_endpoint to send the callback to
51 51
 	*/ 
52
-	public function destroyFiles($payload, $callback_endpoint='') {
52
+	public function destroyFiles($payload, $callback_endpoint = '') {
53 53
 
54 54
 		$this->post = true;
55 55
 		$this->post_fields = array('key'=>$this->sandcage_api_key) + $payload;
56 56
 
57
-		if ( $callback_endpoint != '' ) {
57
+		if ($callback_endpoint != '') {
58 58
 			$this->post_fields['callback_url'] = $callback_endpoint;
59 59
 		}
60 60
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); 
103 103
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
104 104
 
105
-		if ( $this->post ) { 
105
+		if ($this->post) { 
106 106
 			curl_setopt($ch, CURLOPT_POST, true); 
107 107
 			curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($this->post_fields)); 
108 108
 		}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		$this->response = curl_exec($ch);
112 112
 
113 113
 		// Retry if certificates are missing.
114
-		if ( curl_errno($ch) == CURLE_SSL_CACERT ) {
114
+		if (curl_errno($ch) == CURLE_SSL_CACERT) {
115 115
 
116 116
 			// Set the pem file holding the CA Root Certificates to verify the peer with.
117 117
 			curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
Please login to merge, or discard this patch.
examples/get-info - example 2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 $get_info_status = $sandcage->getHttpStatus();
17 17
 $get_info_response = $sandcage->getResponse();
18 18
 
19
-if ( $get_info_status['http_code'] == 200 ) {
19
+if ($get_info_status['http_code'] == 200) {
20 20
 	echo $get_info_response;
21 21
 } else {
22 22
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/get-info - example 1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $get_info_status = $sandcage->getHttpStatus();
13 13
 $get_info_response = $sandcage->getResponse();
14 14
 
15
-if ( $get_info_status['http_code'] == 200 ) {
15
+if ($get_info_status['http_code'] == 200) {
16 16
 	echo $get_info_response;
17 17
 } else {
18 18
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/list-files - with page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $list_files_status = $sandcage->getHttpStatus();
13 13
 $list_files_response = $sandcage->getResponse();
14 14
 
15
-if ( $list_files_status['http_code'] == 200 ) {
15
+if ($list_files_status['http_code'] == 200) {
16 16
 	echo $list_files_response;
17 17
 } else {
18 18
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/list-files - in directory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $list_files_status = $sandcage->getHttpStatus();
13 13
 $list_files_response = $sandcage->getResponse();
14 14
 
15
-if ( $list_files_status['http_code'] == 200 ) {
15
+if ($list_files_status['http_code'] == 200) {
16 16
 	echo $list_files_response;
17 17
 } else {
18 18
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/schedule-files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 $get_info_status = $sandcage->getHttpStatus();
53 53
 $get_info_response = $sandcage->getResponse();
54 54
 
55
-if ( $get_info_status['http_code'] == 200 ) {
55
+if ($get_info_status['http_code'] == 200) {
56 56
 	echo $get_info_response;
57 57
 } else {
58 58
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/list-files - with page and results per page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 $list_files_status = $sandcage->getHttpStatus();
14 14
 $list_files_response = $sandcage->getResponse();
15 15
 
16
-if ( $list_files_status['http_code'] == 200 ) {
16
+if ($list_files_status['http_code'] == 200) {
17 17
 	echo $list_files_response;
18 18
 } else {
19 19
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/destroy-files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 $get_info_status = $sandcage->getHttpStatus();
17 17
 $get_info_response = $sandcage->getResponse();
18 18
 
19
-if ( $get_info_status['http_code'] == 200 ) {
19
+if ($get_info_status['http_code'] == 200) {
20 20
 	echo $get_info_response;
21 21
 } else {
22 22
 	echo "An error occured.";
Please login to merge, or discard this patch.
examples/list-files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 $list_files_status = $sandcage->getHttpStatus();
11 11
 $list_files_response = $sandcage->getResponse();
12 12
 
13
-if ( $list_files_status['http_code'] == 200 ) {
13
+if ($list_files_status['http_code'] == 200) {
14 14
 	echo $list_files_response;
15 15
 } else {
16 16
 	echo "An error occured.";
Please login to merge, or discard this patch.