get_bloginfo( 'name' ); * => string(6) "WP-CLI" */ public function __invoke( $_, $assoc_args ) { $implementations = array( 'Psy\\Shell', 'Boris\\Boris', 'WP_CLI\\Shell\\REPL', ); if ( Utils\get_flag_value( $assoc_args, 'basic' ) ) { $class = 'WP_CLI\\Shell\\REPL'; } else { foreach ( $implementations as $candidate ) { if ( class_exists( $candidate ) ) { $class = $candidate; break; } } } if ( 'Psy\\Shell' === $class ) { $shell = new Psy\Shell(); $shell->run(); } else { $repl = new $class( 'wp> ' ); $repl->start(); } } }