-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
45 lines (38 loc) · 919 Bytes
/
index.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
<?php
require('NotusFlow.php');
$output = '';
$error = '';
$info = '';
$flow = new NotusFlow();
//var_dump($flow->getBranches());
//var_dump($flow->getCurrentBranch());
//$flow->fetchRepo();
//$flow->changeBranch('master');
//$flow->pullRepo();
//$flow->clearDiskCache();
if (!isset($_POST['action'])) {
require('template.php');
exit;
}
try {
switch(strtolower($_POST['action'])) {
case 'changebranch':
$output = $flow->changeBranch($_POST['branch']);
$flow->pullRepo();
$flow->clearDiskCache();
$info = "Branch changed";
break;
case 'gitpull':
$output = $flow->pullRepo();
$info = "git pull finished successfully";
break;
case 'clearcache':
$output = $flow->clearDiskCache();
$output .= "./concat_files.sh && rm core/cache/* && ./memcached_clear.sh";
$info = "Cache cleared";
break;
}
} catch (Exception $e) {
$error = $e->getMessage();
}
require('template.php');