getid3_handler::fseek()protectedWP 1.0

{} Это метод класса: getid3_handler{}

Хуков нет.

Возвращает

int.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->fseek( $bytes, $whence );
$bytes(int) (обязательный)
-
$whence(int)
-
По умолчанию: SEEK_SET

Код getid3_handler::fseek() WP 6.0.2

protected function fseek($bytes, $whence=SEEK_SET) {
	if ($this->data_string_flag) {
		switch ($whence) {
			case SEEK_SET:
				$this->data_string_position = $bytes;
				break;

			case SEEK_CUR:
				$this->data_string_position += $bytes;
				break;

			case SEEK_END:
				$this->data_string_position = $this->data_string_length + $bytes;
				break;
		}
		return 0; // fseek returns 0 on success
	}

	$pos = $bytes;
	if ($whence == SEEK_CUR) {
		$pos = $this->ftell() + $bytes;
	} elseif ($whence == SEEK_END) {
		$pos = $this->getid3->info['filesize'] + $bytes;
	}
	if (!getid3_lib::intValueSupported($pos)) {
		throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10);
	}

	// https://github.com/JamesHeinrich/getID3/issues/327
	$result = fseek($this->getid3->fp, $bytes, $whence);
	if ($result !== 0) { // fseek returns 0 on success
		throw new getid3_exception('cannot fseek('.$pos.'). resource/stream does not appear to support seeking', 10);
	}
	return $result;
}