Automattic\WooCommerce\Internal\ProductFeed\Storage
JsonFileFeed::end
{@inheritDoc}
Метод класса: JsonFileFeed{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$JsonFileFeed = new JsonFileFeed(); $JsonFileFeed->end(): void;
Код JsonFileFeed::end() JsonFileFeed::end WC 11.2.2
public function end(): void {
if ( ! is_resource( $this->file_handle ) ) {
return;
}
fwrite( $this->file_handle, ']' );
// Do not unlock explicitly before closing: fclose() flushes PHP's userspace stream buffer to the
// OS and only then releases the lock. Unlocking first would open a window in which another process
// could acquire the lock and start writing while this process's buffered bytes are still pending,
// interleaving output — the exact corruption the lock prevents.
fclose( $this->file_handle );
$this->file_handle = null;
$this->file_completed = true;
}