update readme & fix update download latest code

This commit is contained in:
xiaomlove
2022-02-14 01:42:24 +08:00
parent 8b041f838a
commit 10a3f959db
6 changed files with 16 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel Framework + E
- Exam
- H&R
- Attendance
- Medal
- Forum
- Multi-language
- Automatic backup
@@ -19,7 +20,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel Framework + E
- ....
## System Requirements
- PHP: 7.3|8.0, must have extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd
- PHP: 8.0, must have extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd
- Mysql: 5.7 latest version or above
- Redisoptional

View File

@@ -10,6 +10,7 @@
- 考核
- H&R
- 签到
- 勋章
- 论坛
- 多语言
- 自动备份
@@ -18,7 +19,7 @@
- ....
## 系统要求
- PHP: 7.3|8.0必须扩展bcmath, ctype, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd
- PHP: 8.0必须扩展bcmath, ctype, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd
- Mysql: 5.7最新版或以上版本
- Redis可选

View File

@@ -556,8 +556,9 @@ class Install
public function executeCommand($command)
{
$this->doLog("command: $command");
$result = exec($command, $output, $result_code);
$this->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result));
$this->doLog(sprintf('result_code: %s, result: %s', $result_code, $result));
$this->doLog("output: " . json_encode($output));
if ($result_code != 0) {
throw new \RuntimeException(json_encode($output));

View File

@@ -129,7 +129,7 @@ class Update extends Install
* attendance change, do migrate
*/
if (WITH_LARAVEL && !NexusDB::schema()->hasColumn('attendance', 'total_days')) {
$this->runMigrate(database_path('migrations/2021_06_13_215440_add_total_days_to_attendance_table.php'));
$this->runMigrate('database/migrations/2021_06_13_215440_add_total_days_to_attendance_table.php');
$this->migrateAttendance();
}
@@ -139,7 +139,7 @@ class Update extends Install
* add seed points to user
*/
if (WITH_LARAVEL && !NexusDB::schema()->hasColumn('users', 'seed_points')) {
$this->runMigrate(database_path('migrations/2021_06_24_013107_add_seed_points_to_users_table.php'));
$this->runMigrate('database/migrations/2021_06_24_013107_add_seed_points_to_users_table.php');
$result = $this->initSeedPoints();
$this->doLog("[INIT SEED POINTS], $result");
}
@@ -226,6 +226,7 @@ class Update extends Install
$suffix = '.tar.gz';
}
$filename = sprintf('%s/nexusphp-%s-%s%s', sys_get_temp_dir(), $basename, date('YmdHis'), $suffix);
$this->doLog("download from: $url, save to filename: $filename");
$client = new Client();
$response = $client->request('GET', $url, ['sink' => $filename]);
if (($statusCode = $response->getStatusCode()) != 200) {
@@ -273,7 +274,7 @@ class Update extends Install
->whereNull('seed_points')
->limit($size)
->update([
'seed_points' => NexusDB::raw('seed_points = seedbonus')
'seed_points' => NexusDB::raw('seedbonus')
]);
$result += $affectedRows;
$this->doLog("affectedRows: $affectedRows, query: " . last_query());

View File

@@ -54,7 +54,7 @@ if ($currentStep == 2) {
$time = \Carbon\Carbon::parse($latestCommit['committer']['date']);
$time->tz = nexus_env('TIMEZONE');
$tableRows[] = [
'checkbox' => sprintf('<input type="radio" name="version_url" value="development"/>'),
'checkbox' => sprintf('<input type="radio" name="version_url" value="development|%s"/>', $latestCommit['sha']),
'tag_name' => '最新开发代码',
'name' => "仅限开发测试!最新提交:" . $latestCommit['commit']['message'],
'published_at' => $time->format('Y-m-d H:i:s'),
@@ -85,8 +85,9 @@ if ($currentStep == 2) {
$downloadUrl = '';
if ($_REQUEST['version_url'] == 'manual') {
$update->nextStep();
} elseif ($_REQUEST['version_url'] == 'development') {
$downloadUrl = 'https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip';
} elseif (\Illuminate\Support\Str::startsWith($_REQUEST['version_url'], 'development')) {
$downloadUrlArr = explode('|', $_REQUEST['version_url']);
$downloadUrl = sprintf('https://github.com/xiaomlove/nexusphp/archive/%s.zip', $downloadUrlArr[1]);
} else {
$versionUrlArr = explode('|', $_REQUEST['version_url']);
$version = strtolower($versionUrlArr[0]);
@@ -191,7 +192,7 @@ if (!empty($error)) {
echo'<div class="step-' . $currentStep . ' text-center">';
$header = [
'label' => '项目',
'require' => '要求',
'required' => '要求',
'current'=> '当前',
'result'=> '结果'
];

View File

@@ -207,7 +207,7 @@ if (isset($_GET['off_details']) && $_GET["off_details"]){
}
else {
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "offers.php?id=$id&off_details=1&", array(lastpagedefault => 1));
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "offers.php?id=$id&off_details=1&", array('lastpagedefault' => 1));
$subres = sql_query("SELECT id, text, user, added, editedby, editdate FROM comments WHERE offer = " . sqlesc($id) . " ORDER BY id $limit") or sqlerr(__FILE__, __LINE__);
$allrows = array();