/** * copy from modules/command.php * @param $subcommand * @param string|array $param_id get first params for default * @param $command if not specific get module name as command name * @return string */ public function get_cli_cmd($subcommand, $param_id = 0, $command_name = '') { $module = $this->get_current_module(); if ((empty($command_name) || !$module->exist_command($command_name)) && !HW_CLI_Command_Utilities::is_sys_cmd($command_name)) { $command_name = $module->option('module_name'); } $wp_cli = HW_HOANGWEB_PATH . 'lib/wp.phar'; //wp cli phar $home_url = home_url(); $home_path = get_home_path(); //prepare arguments if (is_array($param_id)) { $args = HW_CLI_Command_Utilities::parse_cmd_args($param_id); } elseif (is_string($param_id) || is_numeric($param_id)) { $args = "--___config_id={$param_id}"; } else { $args = ''; } //$cmd ="@echo Off&&"; //$cmd .= "SET PATH=%PATH%;E:/HoangData/xampp_htdocs/wp.phar&&"; $cmd = "php {$wp_cli} {$command_name} {$subcommand} {$args} --url={$home_url} --path={$home_path}"; #$cmd .= "timeout /t 50"; //pause for 50s return $cmd; }