-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.php
30 lines (24 loc) · 889 Bytes
/
install.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
<?php
include __DIR__ . '/envcheck.php';
if (file_exists($path . '/soar')) die ('soar has been installed');
$res = copyFile(__DIR__, $path . '/soar');
if (!$res) die ('copy soar to ' . $path . '/soar failed');
$file = array_values(array_filter(scandir($path . '/soar/phpmyadmin/' . $verDir), function($item){
return !preg_match('/^\./', $item) && !preg_match('/\.bak$/', $item);
}))[0];
$newFile = $path . '/soar/phpmyadmin/' . $verDir . '/' . $file;
if (intval($curVer) < 408) {
$oldFile = $path . '/libraries/' . $file;
} else {
$oldFile = $path . '/libraries/classes/Display/' . $file;
}
copyFile($oldFile, $newFile . '.bak');
copyFile($newFile, $oldFile);
$cmd = "chmod -R 777 {$path}/soar/bin";
$f = proc_open($cmd, [
['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']
], $pipes);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
echo 'soar install success' . PHP_EOL;