mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
update readme & fix update download latest code
This commit is contained in:
@@ -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
|
||||
- Redis:optional
|
||||
|
||||
|
||||
@@ -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:可选
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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'=> '结果'
|
||||
];
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user