diff --git a/composer.json b/composer.json index 5bfb6980f..532db6506 100644 --- a/composer.json +++ b/composer.json @@ -49,6 +49,9 @@ "scripts": { "post-create-project-cmd": [ "php artisan key:generate" + ], + "post-update-cmd": [ + "php artisan october:util set build" ] }, "config": { diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index a8cc7f346..92873c01c 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -357,6 +357,22 @@ class UpdateManager return $this; } + /** + * Asks the gateway for the lastest build number and stores it. + * @return void + */ + public function setBuildNumberManually() + { + $result = $this->requestServerData('ping'); + $build = (int) array_get($result, 'pong', 420); + + Parameter::set([ + 'system::core.build' => $build + ]); + + return $build; + } + // // Modules // diff --git a/modules/system/console/OctoberUtil.php b/modules/system/console/OctoberUtil.php index 0228c3b75..74c270855 100644 --- a/modules/system/console/OctoberUtil.php +++ b/modules/system/console/OctoberUtil.php @@ -6,6 +6,7 @@ use Config; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; +use System\Classes\UpdateManager; use System\Classes\CombineAssets; /** @@ -109,6 +110,21 @@ class OctoberUtil extends Command // Utilties // + protected function utilSetBuild() + { + $build = UpdateManager::instance()->setBuildNumberManually(); + + $this->comment('-'); + $this->comment('*** October sets build: '.$build); + $this->comment('-'); + sleep(1); + $this->comment('Ping? Pong!'); + $this->comment('-'); + sleep(1); + $this->comment('Ping? Pong!'); + $this->comment('-'); + } + protected function utilCompileJs() { $this->utilCompileAssets('js');