Browse Source

make nginx stack install dynamic

feature/refactor-php
harshadyeola 9 years ago
parent
commit
36a29cffd9
  1. 27
      php/EE_CLI/Runner.php

27
php/EE_CLI/Runner.php

@ -256,6 +256,26 @@ class Runner {
return array( $args, $assoc_args ); return array( $args, $assoc_args );
} }
/*
Dynamic arguments for stack to be checked before parsing
*/
private static function stack_work($args, $assoc_args)
{
print_r($args);
print_r($assoc_args);
foreach ( $assoc_args as $key => $value) {
if ($args[0] === 'stack') {
if ($args[1] === 'install'){
// check if key matches any stack config
// otherwise throw error if not exists
unset( $assoc_args[ $key ] );
}
}
}
return array( $args, $assoc_args );
}
/** /**
* Whether or not the output should be rendered in color * Whether or not the output should be rendered in color
* *
@ -303,17 +323,22 @@ class Runner {
list( $this->arguments, $this->assoc_args ) = self::back_compat_conversions( list( $this->arguments, $this->assoc_args ) = self::back_compat_conversions(
$args, $assoc_args ); $args, $assoc_args );
list( $this->arguments, $this->assoc_args ) = self::stack_work(
$args, $assoc_args );
$configurator->merge_array( $runtime_config ); $configurator->merge_array( $runtime_config );
} }
list( $this->config, $this->extra_config ) = $configurator->to_array(); list( $this->config, $this->extra_config ) = $configurator->to_array();
} }
public function start() { public function start() {
$this->init_config(); $this->init_config();
$this->init_colorization(); $this->init_colorization();
$this->init_logger(); $this->init_logger();
print_r($this->assoc_args);
EE_CLI::debug( $this->_global_config_path_debug ); EE_CLI::debug( $this->_global_config_path_debug );
EE_CLI::debug( $this->_project_config_path_debug ); EE_CLI::debug( $this->_project_config_path_debug );
@ -360,6 +385,8 @@ class Runner {
//$this->check_wp_version(); //$this->check_wp_version();
$this->_run_command(); $this->_run_command();
} }

Loading…
Cancel
Save