-
Notifications
You must be signed in to change notification settings - Fork 128
/
Copy pathupdate.php
47 lines (43 loc) · 1.14 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* The remote host file to process update requests
*
*/
if ( !isset( $_POST['action'] ) ) {
echo '0';
exit;
}
//set up the properties common to both requests
$obj = new stdClass();
$obj->slug = 'plugin.php';
$obj->name = 'Plugin';
$obj->plugin_name = 'plugin.php';
$obj->new_version = '1.1';
// the url for the plugin homepage
$obj->url = 'http://www.example.com/plugins/my-plugin';
//the download location for the plugin zip file (can be any internet host)
$obj->package = 'http://mybucket.s3.amazonaws.com/plugin/plugin.zip';
switch ( $_POST['action'] ) {
case 'version':
//echo serialize( $obj );
echo json_encode( $obj );
break;
case 'info':
$obj->requires = '4.0';
$obj->tested = '4.0';
$obj->downloaded = 12540;
$obj->last_updated = '2012-10-17';
$obj->sections = array(
'description' => 'The new version of the Auto-Update plugin',
'another_section' => 'This is another section',
'changelog' => 'Some new features'
);
$obj->download_link = $obj->package;
//echo serialize($obj);
echo json_encode( $obj );
case 'license':
//echo serialize( $obj );
echo json_encode( $obj );
break;
}
?>