Skip to content

Commit eab565a

Browse files
author
Rafael Grigorian
committed
Fixed #146
1 parent cb671f4 commit eab565a

File tree

14 files changed

+28
-28
lines changed

14 files changed

+28
-28
lines changed

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Caching/PurgeCache.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function purgeEverything () {
2525
$endpoint = sprintf ( "zones/%s/purge_cache", $zoneId );
2626
$api = Mage::getModel ("cloudflare/api_request");
2727
$api->setType ( $api::REQUEST_DELETE );
28-
$api->setData ( array ( "purge_everything" => true ) );
28+
$api->setPayload ( array ( "purge_everything" => true ) );
2929
return $api->resolve ( $endpoint );
3030
}
3131

@@ -41,7 +41,7 @@ public function purgeUrls ( $items ) {
4141
$endpoint = sprintf ( "zones/%s/purge_cache", $zoneId );
4242
$api = Mage::getModel ("cloudflare/api_request");
4343
$api->setType ( $api::REQUEST_DELETE );
44-
$api->setData ( array ( "files" => $items ) );
44+
$api->setPayload ( array ( "files" => $items ) );
4545
return $api->resolve ( $endpoint );
4646
}
4747

@@ -57,7 +57,7 @@ public function purgeHosts ( $items ) {
5757
$endpoint = sprintf ( "zones/%s/purge_cache", $zoneId );
5858
$api = Mage::getModel ("cloudflare/api_request");
5959
$api->setType ( $api::REQUEST_DELETE );
60-
$api->setData ( array ( "hosts" => $items ) );
60+
$api->setPayload ( array ( "hosts" => $items ) );
6161
return $api->resolve ( $endpoint );
6262
}
6363

@@ -73,7 +73,7 @@ public function purgeTags ( $items ) {
7373
$endpoint = sprintf ( "zones/%s/purge_cache", $zoneId );
7474
$api = Mage::getModel ("cloudflare/api_request");
7575
$api->setType ( $api::REQUEST_DELETE );
76-
$api->setData ( array ( "tags" => $items ) );
76+
$api->setPayload ( array ( "tags" => $items ) );
7777
return $api->resolve ( $endpoint );
7878
}
7979

@@ -89,7 +89,7 @@ public function purgePrefixes ( $items ) {
8989
$endpoint = sprintf ( "zones/%s/purge_cache", $zoneId );
9090
$api = Mage::getModel ("cloudflare/api_request");
9191
$api->setType ( $api::REQUEST_DELETE );
92-
$api->setData ( array ( "prefixes" => $items ) );
92+
$api->setPayload ( array ( "prefixes" => $items ) );
9393
return $api->resolve ( $endpoint );
9494
}
9595

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Dns/CustomNameservers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function edit ( $records ) {
4949
$endpoint = $this->getEndpoint ();
5050
$api = Mage::getModel ("cloudflare/api_request");
5151
$api->setType ( $api::REQUEST_PATCH );
52-
$api->setData ( array ( "vanity_name_servers" => $records ));
52+
$api->setPayload ( array ( "vanity_name_servers" => $records ));
5353
$response = $api->resolve ( $endpoint );
5454
if ( $response->success ) {
5555
$response->result = $response->result->vanity_name_servers_ips

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Dns/DnsRecords.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function import ( $file ) {
4141
$api = Mage::getModel ("cloudflare/api_request");
4242
$api->setHeader ( "Content-Type", "multipart/form-data" );
4343
$api->setType ( $api::REQUEST_POST );
44-
$api->setData ( array (
44+
$api->setPayload ( array (
4545
"file" => new CurlFile (
4646
$file ["tmp_name"],
4747
"text/plain",
@@ -159,7 +159,7 @@ public function editRecord (
159159
$endpoint = $this->getEndpoint ("dns_records/$id");
160160
$api = Mage::getModel ("cloudflare/api_request");
161161
$api->setType ( $api::REQUEST_PUT );
162-
$api->setData ( $data );
162+
$api->setPayload ( $data );
163163
return $api->resolve ( $endpoint );
164164
}
165165

@@ -255,7 +255,7 @@ public function createRecord (
255255
$endpoint = $this->getEndpoint ();
256256
$api = Mage::getModel ("cloudflare/api_request");
257257
$api->setType ( $api::REQUEST_POST );
258-
$api->setData ( $data );
258+
$api->setPayload ( $data );
259259
return $api->resolve ( $endpoint );
260260
}
261261

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Firewall/AccessRules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function add ( $target, $value, $mode, $notes ) {
4343
$endpoint = $this->getEndpoint ("firewall/access_rules/rules");
4444
$api = Mage::getModel ("cloudflare/api_request");
4545
$api->setType ( $api::REQUEST_POST );
46-
$api->setData ( array (
46+
$api->setPayload ( array (
4747
"mode" => $mode,
4848
"configuration" => array (
4949
"target" => $target,
@@ -65,7 +65,7 @@ public function updateMode ( $id, $mode ) {
6565
$endpoint = $this->getEndpoint ("firewall/access_rules/rules/$id");
6666
$api = Mage::getModel ("cloudflare/api_request");
6767
$api->setType ( $api::REQUEST_PATCH );
68-
$api->setData ( array (
68+
$api->setPayload ( array (
6969
"mode" => $mode
7070
));
7171
return $api->resolve ( $endpoint );
@@ -83,7 +83,7 @@ public function updateNote ( $id, $notes ) {
8383
$endpoint = $this->getEndpoint ("firewall/access_rules/rules/$id");
8484
$api = Mage::getModel ("cloudflare/api_request");
8585
$api->setType ( $api::REQUEST_PATCH );
86-
$api->setData ( array (
86+
$api->setPayload ( array (
8787
"notes" => $notes
8888
));
8989
return $api->resolve ( $endpoint );

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Firewall/UserAgentBlocking.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function update ( $id, $mode, $paused, $value, $description ) {
5757
$endpoint = $this->getEndpoint ("firewall/ua_rules/$id");
5858
$api = Mage::getModel ("cloudflare/api_request");
5959
$api->setType ( $api::REQUEST_PUT );
60-
$api->setData ( array (
60+
$api->setPayload ( array (
6161
"configuration" => array (
6262
"target" => "ua",
6363
"value" => $value
@@ -83,7 +83,7 @@ public function create ( $mode, $paused, $value, $description ) {
8383
$endpoint = $this->getEndpoint ();
8484
$api = Mage::getModel ("cloudflare/api_request");
8585
$api->setType ( $api::REQUEST_POST );
86-
$api->setData ( array (
86+
$api->setPayload ( array (
8787
"configuration" => array (
8888
"target" => "ua",
8989
"value" => $value

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Firewall/ZoneLockdown.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function create ( $desc, $urls, $config, $paused, $priority = null ) {
6363
$endpoint = $this->getEndpoint ();
6464
$api = Mage::getModel ("cloudflare/api_request");
6565
$api->setType ( $api::REQUEST_POST );
66-
$api->setData ( array (
66+
$api->setPayload ( array (
6767
"description" => $desc,
6868
"urls" => $urls,
6969
"configurations" => $config,
@@ -89,7 +89,7 @@ public function edit ( $id, $desc, $urls, $config, $paused, $priority = null ) {
8989
$endpoint = $this->getEndpoint ( $this->_endpoint . "/$id" );
9090
$api = Mage::getModel ("cloudflare/api_request");
9191
$api->setType ( $this->_usePatchToSet ? $api::REQUEST_PATCH : $api::REQUEST_PUT );
92-
$api->setData ( array (
92+
$api->setPayload ( array (
9393
"description" => $desc,
9494
"urls" => $urls,
9595
"configurations" => $config,

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/PageRules/PageRules.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function create ( $target, $actions, $status = true, $priority = 1 ) {
7575
$endpoint = $this->getEndpoint ();
7676
$api = Mage::getModel ("cloudflare/api_request");
7777
$api->setType ( $api::REQUEST_POST );
78-
$api->setData ( array (
78+
$api->setPayload ( array (
7979
"targets" => array (
8080
array (
8181
"target" => "url",
@@ -121,7 +121,7 @@ public function edit ( $id, $target, $actions, $status = true ) {
121121
$endpoint = $this->getEndpoint ("pagerules/$id");
122122
$api = Mage::getModel ("cloudflare/api_request");
123123
$api->setType ( $api::REQUEST_PATCH );
124-
$api->setData ( array (
124+
$api->setPayload ( array (
125125
"targets" => array (
126126
array (
127127
"target" => "url",
@@ -148,7 +148,7 @@ public function toggle ( $id, $state ) {
148148
$endpoint = $this->getEndpoint ("pagerules/$id");
149149
$api = Mage::getModel ("cloudflare/api_request");
150150
$api->setType ( $api::REQUEST_PATCH );
151-
$api->setData ( array (
151+
$api->setPayload ( array (
152152
"status" => $state === true ? "active" : "disabled"
153153
));
154154
return $api->resolve ( $endpoint );
@@ -178,7 +178,7 @@ public function priority ( $priorites ) {
178178
$endpoint = $this->getEndpoint ("pagerules/priorities");
179179
$api = Mage::getModel ("cloudflare/api_request");
180180
$api->setType ( $api::REQUEST_PUT );
181-
$api->setData ( $priorites );
181+
$api->setPayload ( $priorites );
182182
return $api->resolve ( $endpoint );
183183
}
184184

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function setHeader ( $key, $value ) {
134134
* @param mixed value Payload for CF API request
135135
* @return void
136136
*/
137-
public function setData ( $value ) {
137+
public function setPayload ( $value ) {
138138
$this->_data = $value;
139139
}
140140

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Setter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function setValue ( $value ) {
6262
$endpoint = sprintf ( "zones/%s/%s", $zoneId, $this->_endpoint );
6363
$api = Mage::getModel ("cloudflare/api_request");
6464
$api->setType ( $this->_usePatchToSet ? $api::REQUEST_PATCH : $api::REQUEST_PUT );
65-
$api->setData ( array ( "$this->_dataKey" => $value ) );
65+
$api->setPayload ( array ( "$this->_dataKey" => $value ) );
6666
return $api->resolve ( $endpoint );
6767
}
6868

src/app/code/community/JetRails/Cloudflare/Model/Adminhtml/Api/Speed/AutoMinify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function change ( $js, $css, $html ) {
3232
$endpoint = $this->getEndpoint ();
3333
$api = Mage::getModel ("cloudflare/api_request");
3434
$api->setType ( $api::REQUEST_PATCH );
35-
$api->setData ( array ( "value" => array (
35+
$api->setPayload ( array ( "value" => array (
3636
"js" => $js == "true" ? "on" : "off",
3737
"css" => $css == "true" ? "on" : "off",
3838
"html" => $html == "true" ? "on" : "off"

0 commit comments

Comments
 (0)