mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
30
app/Commands/PublishCommand.php
Normal file
30
app/Commands/PublishCommand.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class PublishCommand extends Command
|
||||
{
|
||||
protected $signature = 'publish';
|
||||
|
||||
protected $description = 'Publish the expose configuration file';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$configFile = implode(DIRECTORY_SEPARATOR, [
|
||||
$_SERVER['HOME'],
|
||||
'.expose',
|
||||
'config.php'
|
||||
]);
|
||||
|
||||
if (file_exists($configFile)) {
|
||||
$this->error('Expose configuration file already exists at '.$configFile);
|
||||
return;
|
||||
}
|
||||
|
||||
file_put_contents($configFile, file_get_contents(base_path('config/expose.php')));
|
||||
|
||||
$this->info('Published expose configuration file to: ' . $configFile);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user