WP_CLI\Bootstrap

IncludeRequestsAutoloader::store_requests_metaprivateWP-CLI 1.0

Store meta information about the used Requests integration.

This can be used for all the conditional code that needs to work across multiple Requests versions.

Метод класса: IncludeRequestsAutoloader{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->store_requests_meta( $class_name, $source );
$class_name(строка) (обязательный)
The class name of the Requests integration.
$source(строка) (обязательный)
The source of the Requests integration.

Код IncludeRequestsAutoloader::store_requests_meta() WP-CLI 2.13.0-alpha

private function store_requests_meta( $class_name, $source ) {
	RequestsLibrary::set_version(
		RequestsLibrary::CLASS_NAME_V2 === $class_name
			? RequestsLibrary::VERSION_V2
			: RequestsLibrary::VERSION_V1
	);
	RequestsLibrary::set_source( $source );
	RequestsLibrary::set_class_name( $class_name );
}