Jump to content

Creating file for update checking

Featured Replies

Posted

Hello fellow developers, i've looked up Developer guide on Update Check URL but still, don't know how to use it, any idea? I've set up file called "updateCheck.php" and it's content is:

 

<?php

switch($_GET['plugin'])
{
  case 'plugin_unique_id(plugins folder name)':
    return '{
    "version": "2.0.0",
    "longversion": 20000,
    "released": 1423841958,
    "updateurl": "http://www.example.com/myapp/download"
}';
  break;
}

and i've put this link in settings: "https://example.url/cstm/plugins/updateCheck.php?plugin=plugin_unique_id"


And still, ACP isn't showing newer version, even though it should.

Try this:

<?php
header( 'Content-type: application/json' );

switch( $_GET['plugin'] )
{
	case 'my_plugin':
		$return = json_encode( array(
			'version' => "2.0.0",
			'longversion' => 20000,
			'released' => 1423841958,
			'updateurl' => "http://www.example.com/myapp/download"
		) );
		break;
	case 'my_other_plugin':
		$return = json_encode( array(
			'version' => "1.0.0",
			'longversion' => 10000,
			'released' => 1423841958,
			'updateurl' => "http://www.example.com/myapp/download"
		) );
		break;
}

echo $return;

 

  • Author

So, i've edited the file, refreshed page and still there is no information about new version.

1 minute ago, ~Jakso.` said:

So, i've edited the file, refreshed page and still there is no information about new version.

The information is fetched via the task system, did you check if the ugprade task was called after your modification? If not, try to trigger the upgradecheck task manually.

  • Author

Oh, yes, it works now! Thanks!

  • 1 month later...

Check out this application which will make your life a lot easier:

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.