WP_CLI\Bootstrap

InitializeLogger::declare_loggers()privateWP-CLI 1.0

Load the class declarations for the loggers.

Method of the class: InitializeLogger{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->declare_loggers();

InitializeLogger::declare_loggers() code WP-CLI 2.8.0-alpha

private function declare_loggers() {
	$logger_dir = WP_CLI_ROOT . '/php/WP_CLI/Loggers';
	$iterator   = new DirectoryIterator( $logger_dir );

	// Make sure the base class is declared first.
	include_once "$logger_dir/Base.php";

	foreach ( $iterator as $filename ) {
		if ( '.php' !== substr( $filename, - 4 ) ) {
			continue;
		}

		include_once "$logger_dir/$filename";
	}
}