Automattic\WooCommerce\Internal\ProductFeed\Storage
JsonFileFeed::open_handle
Opens the feed file handle, throwing if it cannot be opened.
Метод класса: JsonFileFeed{}
Хуков нет.
Возвращает
resource. The opened file handle.
Использование
// private - только в коде основоного (родительского) класса $result = $this->open_handle( $path, $mode );
- $path(строка) (обязательный)
- The file path to open.
- $mode(строка) (обязательный)
- The fopen() mode.
Код JsonFileFeed::open_handle() JsonFileFeed::open handle WC 11.2.2
private function open_handle( string $path, string $mode ) {
$handle = fopen( $path, $mode );
if ( false === $handle ) {
throw new Exception(
esc_html(
sprintf(
/* translators: %s: file path */
__( 'Unable to open feed file: %s', 'woocommerce' ),
$path
)
)
);
}
$this->file_handle = $handle;
return $handle;
}