Merge branch 'development' of https://gitlab.telaaedifex.com/xevidos/codiad into development

This commit is contained in:
xevidos 2018-07-18 17:02:06 -04:00
commit cb044a00ce
2 changed files with 24 additions and 6 deletions

View File

@ -41,7 +41,7 @@ class Update {
$this->archive = "https://gitlab.telaaedifex.com/xevidos/codiad/-/archive/master/codiad-master.zip"; $this->archive = "https://gitlab.telaaedifex.com/xevidos/codiad/-/archive/master/codiad-master.zip";
$this->commits = "https://gitlab.telaaedifex.com/api/v4/projects/3/repository/commits/"; $this->commits = "https://gitlab.telaaedifex.com/api/v4/projects/3/repository/commits/";
$this->tags = "https://gitlab.telaaedifex.com/api/v4/projects/3/repository/tags/"; $this->tags = "https://gitlab.telaaedifex.com/api/v4/projects/3/repository/tags/";
//$this->protocol = $this->CheckProtocol(); $this->protocol = $this->CheckProtocol();
} }
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
@ -127,11 +127,28 @@ class Update {
//echo var_dump( $response );
//return "[".formatJSEND("success", array("currentversion"=>$local[0]['version'],"remoteversion"=>$latest,"message"=>$message,"archive"=>$archive,"nightly"=>$nightly,"name"=>$local[0]['name']))."]"; //return "[".formatJSEND("success", array("currentversion"=>$local[0]['version'],"remoteversion"=>$latest,"message"=>$message,"archive"=>$archive,"nightly"=>$nightly,"name"=>$local[0]['name']))."]";
return "[".formatJSEND("success", array("currentversion"=>$current_version,"remoteversion"=>$response["name"],"message"=>$response["message"],"archive"=>$archive,"nightly"=>$nightly,"name"=>$response["author_name"]))."]"; return "[".formatJSEND("success", array("currentversion"=>$current_version,"remoteversion"=>$response["name"],"message"=>$response["message"],"archive"=>$archive,"nightly"=>$nightly,"name"=>$response["author_name"]))."]";
} }
function CheckProtocol() {
if( extension_loaded( 'curl' ) ) {
//Curl is loaded
return "curl";
} elseif( ini_get('allow_url_fopen') ) {
//Remote get file is enabled
return "fopen";
} else {
//None are enabled exit.
return "none";
}
}
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// Get Local Version // Get Local Version
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
@ -187,6 +204,6 @@ class Update {
break; break;
} }
return json_decode(file_get_contents($remoteurl), true); //return( json_decode( file_get_contents( $remoteurl ), true ) );
} }
} }

View File

@ -12,9 +12,10 @@
// Verify Session or Key // Verify Session or Key
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
require_once('../../common.php');
checkSession(); checkSession();
switch($_GET['action']){ switch($_GET['action']){
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Update // Update
@ -32,7 +33,7 @@ checkSession();
} else { } else {
require_once('class.update.php'); require_once('./class.update.php');
$update = new Update(); $update = new Update();
$vars = json_decode($update->Check(), true); $vars = json_decode($update->Check(), true);