Browse Source

manage help command

feature/refactor-php
harshadyeola 9 years ago
parent
commit
d06301e230
  1. 2
      php/commands/help.php
  2. 24
      php/commands/site.php
  3. 71
      php/commands/stack.php
  4. 68
      php/config-spec.php
  5. 2
      templates/man-params.mustache

2
php/commands/help.php

@ -39,7 +39,7 @@ class Help_Command extends EE_CLI_Command {
// WordPress is already loaded, so there's no chance we'll find the command
if ( function_exists( 'add_filter' ) ) {
$command_string = implode( ' ', $args );
\EE_CLI::error( sprintf( "'%s' is not a registered wp command.", $command_string ) );
\EE_CLI::error( sprintf( "'%s' is not a registered ee command.", $command_string ) );
}
}

24
php/commands/site.php

@ -11,30 +11,6 @@
*/
class Site_Command extends EE_CLI_Command {
/**
* Remove a value from the object cache.
*
* <sitename>
* : Cache key.
*[--cache=<cache>]
* : Webroot
* [--user]
* [--pass]
* [--email]
* : Method for grouping data within the cache which allows the same key to be used across groups.
*/
public function create( $args, $assoc_args ) {
if (isset($assoc_args['cache'])){
EE_CLI::success( 'Site Successfully created with ' . $assoc_args['cache'] . ' cache.' );
}
}
/**
* Remove a value from the object cache.
*

71
php/commands/stack.php

@ -12,69 +12,76 @@
class Stack_Command extends EE_CLI_Command {
/**
* Remove a value from the object cache.
*
*
*
* Install package into system.
*[--package=<package>]
*
*
* : Install packages
*
*/
public function install( $args, $assoc_args ) {
if (isset($assoc_args['package'])){
EE_CLI::success( 'Package succesfully installed : ' . $assoc_args['package'] );
}
EE_CLI::success( 'Package succesfully installed : ' . $assoc_args['package'] );
}
/**
* Install package into system.
*[--package=<package>]
* : Install packages
*
*/
public function remove( $args, $assoc_args ) {
//removing packages
EE_CLI::success( 'Package succesfully removed : ' . $assoc_args['package'] );
}
/**
* Install package into system.
*[--package=<package>]
* : Install packages
*
*/
public function purge( $args, $assoc_args ) {
//purging packages
EE_CLI::success( 'Package succesfully purged : ' . $assoc_args['package'] );
}
/**
* Install package into system.
*[--package=<package>]
* : Install packages
*
*/
public function start( $args, $assoc_args ) {
//start service
EE_CLI::success( 'Service succesfully started : ' . $assoc_args['package'] );
}
/**
* Install package into system.
*[--package=<package>]
* : Install packages
*
*/
public function stop( $args, $assoc_args ) {
//stop service
EE_CLI::success( 'Service succesfully stopped : ' . $assoc_args['package'] );
}
/**
* Install package into system.
*[--package=<package>]
* : Install packages
*
*/
public function upgrade( $args, $assoc_args ) {
//removing packages
//upgraded packages
EE_CLI::success( 'Package succesfully upgraded : ' . $assoc_args['package'] );
}
}
EE_CLI::add_command( 'stack', 'Stack_Command' );

68
php/config-spec.php

@ -1,61 +1,11 @@
<?php
return array(
'path' => array(
'runtime' => '=<path>',
'file' => '<path>',
'desc' => 'Path to the WordPress files',
),
'url' => array(
'runtime' => '=<url>',
'file' => '<url>',
'desc' => 'Pretend request came from given URL. In multisite, this argument is how the target site is specified.',
),
'blog' => array(
'deprecated' => 'Use --url instead.',
'runtime' => '=<url>',
),
'config' => array(
'deprecated' => 'Use the WP_CLI_CONFIG_PATH environment variable instead.',
'deprecated' => 'Use the EE_CLI_CONFIG_PATH environment variable instead.',
'runtime' => '=<path>',
),
'user' => array(
'runtime' => '=<id|login|email>',
'file' => '<id|login|email>',
'desc' => 'Set the WordPress user',
),
'skip-plugins' => array(
'runtime' => '[=<plugin>]',
'file' => '<list>',
'desc' => 'Skip loading all or some plugins',
'default' => '',
),
'skip-themes' => array(
'runtime' => '[=<theme>]',
'file' => '<list>',
'desc' => 'Skip loading all or some themes',
'default' => '',
),
'require' => array(
'runtime' => '=<path>',
'file' => '<path>',
'desc' => 'Load PHP file before running the command (may be used more than once)',
'multiple' => true,
'default' => array(),
),
'disabled_commands' => array(
'file' => '<list>',
'default' => array(),
'desc' => '(Sub)commands to disable',
),
'color' => array(
'runtime' => true,
'file' => '<bool>',
@ -83,20 +33,4 @@ return array(
'default' => false,
'desc' => 'Suppress informational messages',
),
'apache_modules' => array(
'file' => '<list>',
'desc' => 'List of Apache Modules that are to be reported as loaded',
'multiple' => true,
'default' => array(),
),
# --allow-root => (NOT RECOMMENDED) Allow wp-cli to run as root. This poses
# a security risk, so you probably do not want to do this.
'allow-root' => array(
'file' => false, # Explicit. Just in case the default changes.
'runtime' => '',
'hidden' => true,
),
);

2
templates/man-params.mustache

@ -10,5 +10,5 @@
{{/parameters}}
{{#root_command}}
Run 'EE help <command>' to get more information on a specific command.
Run 'ee help <command>' to get more information on a specific command.
{{/root_command}}

Loading…
Cancel
Save