<?php
							 | 
						|
								
							 | 
						|
								namespace App\Commands;
							 | 
						|
								
							 | 
						|
								use Illuminate\Console\Scheduling\Schedule;
							 | 
						|
								use LaravelZero\Framework\Commands\Command;
							 | 
						|
								
							 | 
						|
								use App\Facades\Install;
							 | 
						|
								
							 | 
						|
								/**
							 | 
						|
								 *  Install php-fpm
							 | 
						|
								 *
							 | 
						|
								 *  @author Björn Hase, Tentakelfabrik
							 | 
						|
								 *  @license http://opensource.org/licenses/MIT The MIT License
							 | 
						|
								 *  @link https://gitea.tentakelfabrik.de/Tentakelfabrik/mcp
							 | 
						|
								 *
							 | 
						|
								 */
							 | 
						|
								class AdminerInstallCommand extends Command
							 | 
						|
								{
							 | 
						|
								
							 | 
						|
								    /**
							 | 
						|
								     * The signature of the command.
							 | 
						|
								     *
							 | 
						|
								     * @var string
							 | 
						|
								     */
							 | 
						|
								    protected $signature = 'adminer:install {destination}';
							 | 
						|
								
							 | 
						|
								    /**
							 | 
						|
								     * The description of the command.
							 | 
						|
								     *
							 | 
						|
								     * @var string
							 | 
						|
								     */
							 | 
						|
								    protected $description = 'Install Adminer.';
							 | 
						|
								
							 | 
						|
								    /**
							 | 
						|
								     * Execute the console command.
							 | 
						|
								     *
							 | 
						|
								     * @return mixed
							 | 
						|
								     */
							 | 
						|
								    public function handle()
							 | 
						|
								    {
							 | 
						|
								        $this->info('Adminer installing...');
							 | 
						|
								
							 | 
						|
								        // download adminer
							 | 
						|
								        system('wget "http://www.adminer.org/latest.php" -O '.$this->argument('destination').'/index.php');
							 | 
						|
								
							 | 
						|
								        // check if nginx is ready and installed
							 | 
						|
								        if (file_exists($this->argument('destination').'/index.php')) {
							 | 
						|
								            $this->info('Adminer installing...Success! \o/');
							 | 
						|
								        } else {
							 | 
						|
								            $this->error('Failed! Please check log-file!');
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								}
							 |