Update initializing copyright_text option

This commit is contained in:
printempw 2018-08-16 15:15:46 +08:00
parent 8f55aab848
commit ca8a01aced
2 changed files with 9 additions and 2 deletions

View File

@ -30,7 +30,7 @@ return [
'score_per_player' => '100',
'sign_after_zero' => 'false',
'version' => '',
'copyright_text' => '<strong>Copyright &copy; '.getdate()['year'].' <a href="{site_url}">{site_name}</a>.</strong> All rights reserved.',
'copyright_text' => '<strong>Copyright &copy; {year} <a href="{site_url}">{site_name}</a>.</strong> All rights reserved.',
'auto_del_invalid_texture' => 'false',
'allow_downloading_texture' => 'true',
'texture_name_regexp' => '',

View File

@ -15,13 +15,20 @@ class ImportOptions extends Migration
// import options
$options = config('options');
$options['version'] = config('app.version');
$options['version'] = config('app.version');
$options['announcement'] = str_replace(
'{version}',
$options['version'],
$options['announcement']
);
$options['copyright_text'] = str_replace(
'{year}',
Carbon\Carbon::now()->year,
$options['copyright_text']
);
foreach ($options as $key => $value) {
Option::set($key, $value);
}