Automattic\WooCommerce\Internal\Admin\Logging\FileV2

File::get_stream()publicWC 1.0

Open a read-only stream for this file.

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

Хуков нет.

Возвращает

resource|false.

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

$File = new File();
$File->get_stream();

Код File::get_stream() WC 9.7.1

public function get_stream() {
	if ( ! $this->is_readable() ) {
		return false;
	}

	if ( ! is_resource( $this->stream ) ) {
		// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen -- No suitable alternative.
		$this->stream = fopen( $this->path, 'rb' );
	}

	return $this->stream;
}