Ejemplo n.º 1
0
        WP_CLI::line("PHP binary:\t" . $php_bin);
        WP_CLI::line("PHP version:\t" . PHP_VERSION);
        WP_CLI::line("php.ini used:\t" . get_cfg_var('cfg_file_path'));
        WP_CLI::line("wp-cli root:\t" . WP_CLI_ROOT);
        WP_CLI::line("wp-cli version:\t" . WP_CLI_VERSION);
    }
    private static function generate_man($args)
    {
        $command = Dispatcher\traverse($args);
        if (!$command) {
            WP_CLI::error(sprintf("'%s' command not found."));
        }
        foreach (self::$man_dirs as $dest_dir => $src_dir) {
            \WP_CLI\Man\generate($src_dir, $dest_dir, $command);
        }
    }
    private static function render_automcomplete()
    {
        foreach (self::$root->get_subcommands() as $name => $command) {
            $subcommands = $command->get_subcommands();
            self::line($name . ' ' . implode(' ', array_keys($subcommands)));
        }
    }
    // back-compat
    static function addCommand($name, $class)
    {
        self::add_command($name, $class);
    }
}
WP_CLI::$root = new Dispatcher\RootCommand();