Skip to content

Commit 1780c44

Browse files
committed
Only allow purging a single file.
1 parent 0cce955 commit 1780c44

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

purge.php

+3-10
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@
1818
echo "Attempting to purge: $zone_id: $file.\n";
1919

2020
$api = new NetDNA( 'jquery', $config[ 'consumer_key' ], $config[ 'consumer_secret' ] );
21-
22-
if ( empty( $file ) ) {
23-
// Purge all files
24-
$result = $api->delete( '/zones/pull.json/' . $zone_id . '/cache' );
25-
} else {
26-
// Purge single file
27-
$result = $api->delete( '/zones/pull.json/' . $zone_id . '/cache', array( 'file' => $file ) );
28-
}
29-
21+
$result = $api->delete( '/zones/pull.json/' . $zone_id . '/cache', array( 'file' => $file ) );
3022
$result = json_decode( $result, true );
23+
3124
if ( $result[ 'code' ] !== 200 ) {
3225
echo 'Error reported: ' . print_r( $result, true );
3326
} else {
34-
echo 'Done\n';
27+
echo "Done\n";
3528
}

0 commit comments

Comments
 (0)