mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
update readme & fix update download latest code
This commit is contained in:
+2
-1
@@ -11,6 +11,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel Framework + E
|
|||||||
- Exam
|
- Exam
|
||||||
- H&R
|
- H&R
|
||||||
- Attendance
|
- Attendance
|
||||||
|
- Medal
|
||||||
- Forum
|
- Forum
|
||||||
- Multi-language
|
- Multi-language
|
||||||
- Automatic backup
|
- Automatic backup
|
||||||
@@ -19,7 +20,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel Framework + E
|
|||||||
- ....
|
- ....
|
||||||
|
|
||||||
## System Requirements
|
## 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
|
- Mysql: 5.7 latest version or above
|
||||||
- Redis:optional
|
- Redis:optional
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
- 考核
|
- 考核
|
||||||
- H&R
|
- 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最新版或以上版本
|
- Mysql: 5.7最新版或以上版本
|
||||||
- Redis:可选
|
- Redis:可选
|
||||||
|
|
||||||
|
|||||||
@@ -556,8 +556,9 @@ class Install
|
|||||||
|
|
||||||
public function executeCommand($command)
|
public function executeCommand($command)
|
||||||
{
|
{
|
||||||
|
$this->doLog("command: $command");
|
||||||
$result = exec($command, $output, $result_code);
|
$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));
|
$this->doLog("output: " . json_encode($output));
|
||||||
if ($result_code != 0) {
|
if ($result_code != 0) {
|
||||||
throw new \RuntimeException(json_encode($output));
|
throw new \RuntimeException(json_encode($output));
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class Update extends Install
|
|||||||
* attendance change, do migrate
|
* attendance change, do migrate
|
||||||
*/
|
*/
|
||||||
if (WITH_LARAVEL && !NexusDB::schema()->hasColumn('attendance', 'total_days')) {
|
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();
|
$this->migrateAttendance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ class Update extends Install
|
|||||||
* add seed points to user
|
* add seed points to user
|
||||||
*/
|
*/
|
||||||
if (WITH_LARAVEL && !NexusDB::schema()->hasColumn('users', 'seed_points')) {
|
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();
|
$result = $this->initSeedPoints();
|
||||||
$this->doLog("[INIT SEED POINTS], $result");
|
$this->doLog("[INIT SEED POINTS], $result");
|
||||||
}
|
}
|
||||||
@@ -226,6 +226,7 @@ class Update extends Install
|
|||||||
$suffix = '.tar.gz';
|
$suffix = '.tar.gz';
|
||||||
}
|
}
|
||||||
$filename = sprintf('%s/nexusphp-%s-%s%s', sys_get_temp_dir(), $basename, date('YmdHis'), $suffix);
|
$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();
|
$client = new Client();
|
||||||
$response = $client->request('GET', $url, ['sink' => $filename]);
|
$response = $client->request('GET', $url, ['sink' => $filename]);
|
||||||
if (($statusCode = $response->getStatusCode()) != 200) {
|
if (($statusCode = $response->getStatusCode()) != 200) {
|
||||||
@@ -273,7 +274,7 @@ class Update extends Install
|
|||||||
->whereNull('seed_points')
|
->whereNull('seed_points')
|
||||||
->limit($size)
|
->limit($size)
|
||||||
->update([
|
->update([
|
||||||
'seed_points' => NexusDB::raw('seed_points = seedbonus')
|
'seed_points' => NexusDB::raw('seedbonus')
|
||||||
]);
|
]);
|
||||||
$result += $affectedRows;
|
$result += $affectedRows;
|
||||||
$this->doLog("affectedRows: $affectedRows, query: " . last_query());
|
$this->doLog("affectedRows: $affectedRows, query: " . last_query());
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ if ($currentStep == 2) {
|
|||||||
$time = \Carbon\Carbon::parse($latestCommit['committer']['date']);
|
$time = \Carbon\Carbon::parse($latestCommit['committer']['date']);
|
||||||
$time->tz = nexus_env('TIMEZONE');
|
$time->tz = nexus_env('TIMEZONE');
|
||||||
$tableRows[] = [
|
$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' => '最新开发代码',
|
'tag_name' => '最新开发代码',
|
||||||
'name' => "仅限开发测试!最新提交:" . $latestCommit['commit']['message'],
|
'name' => "仅限开发测试!最新提交:" . $latestCommit['commit']['message'],
|
||||||
'published_at' => $time->format('Y-m-d H:i:s'),
|
'published_at' => $time->format('Y-m-d H:i:s'),
|
||||||
@@ -85,8 +85,9 @@ if ($currentStep == 2) {
|
|||||||
$downloadUrl = '';
|
$downloadUrl = '';
|
||||||
if ($_REQUEST['version_url'] == 'manual') {
|
if ($_REQUEST['version_url'] == 'manual') {
|
||||||
$update->nextStep();
|
$update->nextStep();
|
||||||
} elseif ($_REQUEST['version_url'] == 'development') {
|
} elseif (\Illuminate\Support\Str::startsWith($_REQUEST['version_url'], 'development')) {
|
||||||
$downloadUrl = 'https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip';
|
$downloadUrlArr = explode('|', $_REQUEST['version_url']);
|
||||||
|
$downloadUrl = sprintf('https://github.com/xiaomlove/nexusphp/archive/%s.zip', $downloadUrlArr[1]);
|
||||||
} else {
|
} else {
|
||||||
$versionUrlArr = explode('|', $_REQUEST['version_url']);
|
$versionUrlArr = explode('|', $_REQUEST['version_url']);
|
||||||
$version = strtolower($versionUrlArr[0]);
|
$version = strtolower($versionUrlArr[0]);
|
||||||
@@ -191,7 +192,7 @@ if (!empty($error)) {
|
|||||||
echo'<div class="step-' . $currentStep . ' text-center">';
|
echo'<div class="step-' . $currentStep . ' text-center">';
|
||||||
$header = [
|
$header = [
|
||||||
'label' => '项目',
|
'label' => '项目',
|
||||||
'require' => '要求',
|
'required' => '要求',
|
||||||
'current'=> '当前',
|
'current'=> '当前',
|
||||||
'result'=> '结果'
|
'result'=> '结果'
|
||||||
];
|
];
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ if (isset($_GET['off_details']) && $_GET["off_details"]){
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
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__);
|
$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();
|
$allrows = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user