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