mrjgreen/php-cli

There is no license information available for the latest version (v1.0.1) of this package.

Command component based on laravel's

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.0.1 2014-10-20 08:36 UTC

This package is not auto-updated.

Last update: 2023-07-31 19:45:56 UTC


README

A standalone interface loosely matching the new laravel 4.0 cli interface

class ExecuteControllerCommand extends Command {


	/**
	 * Execute the console command.
	 *
	 * @return void
	 */
	public function fire()
	{
		$controller = $this->getArgument('controller');
		
		$this->info($controller);
		
		$action = $this->getArgument('action');
		
		$this->error($action);
		
		$env = $this->getOption('env');
		
		$this->info($env);
		
		$verbose = $this->getOption('verbose');
		
		$this->line($verbose);
		
		if($this->confirm('Would you like to continue?')) {
		
			$password = $this->secret('Please enter a password:');
			
			$this->info($password);
			
			$this->success('Complete!');
		}

	}

	protected function getArguments()
	{
		return array(
			array('controller', self::REQUIRED),
			array('action', self::OPTIONAL),
		);
	}

	protected function getOptions()
	{
		return array(
			array('env','e', self::OPTIONAL),
			array('verbose','v', self::VALUE_NONE),
		);
	}

}

ExecuteControllerCommand::createFromCliArgs()->fire