mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Changed PHP to compare hashes
This commit is contained in:
@@ -166,10 +166,26 @@ class Debug extends CI_Controller
|
||||
redirect('debug');
|
||||
}
|
||||
|
||||
public function wavelog_version() {
|
||||
$version_tag = $this->optionslib->get_option('version');
|
||||
public function wavelog_fetch() {
|
||||
$a_versions=[];
|
||||
try {
|
||||
$st=exec('git fetch');
|
||||
$line = trim(exec('git log -n 1 --pretty=%D HEAD')); // Get local branch-descriptor
|
||||
$pieces = explode(', ', $line);
|
||||
$versions['branch'] = substr($pieces[1], strpos($pieces[1], '/') + 1);
|
||||
$versions['latest_commit_hash']=substr(trim(exec('git log --pretty="%H" -n1 HEAD..origin'.'/'.$versions['branch'])),0,8); // fetch latest commit-hash from repo
|
||||
} catch (Exception $e) {
|
||||
$versions['latest_commit_hash']='';
|
||||
$versions['branch']='';
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($version_tag);
|
||||
echo json_encode($versions);
|
||||
}
|
||||
|
||||
public function wavelog_version() {
|
||||
$commit_hash=substr(trim(exec('git log --pretty="%H" -n1 HEAD')),0,8); // Get latest LOCAL Hash
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($commit_hash);
|
||||
}
|
||||
|
||||
public function migrate_userdata() {
|
||||
|
||||
Reference in New Issue
Block a user