Класс SplTempFileObject

(PHP 5 >= 5.1.2, PHP 7)

Введение

Класс SplTempFileObject предлагает объектно-ориентированный интерфейс для работы с временными файлами.

Обзор классов

SplTempFileObject extends SplFileObject implements SeekableIterator , RecursiveIterator {
/* Методы */
public __construct ([ int $max_memory ] )
/* Наследуемые методы */
public SplFileObject::__construct ( string $filename [, string $open_mode = "r" [, bool $use_include_path = false [, resource $context ]]] )
public string|array SplFileObject::current ( void )
public bool SplFileObject::eof ( void )
public bool SplFileObject::fflush ( void )
public string SplFileObject::fgetc ( void )
public array SplFileObject::fgetcsv ([ string $delimiter = "," [, string $enclosure = "\"" [, string $escape = "\\" ]]] )
public string SplFileObject::fgets ( void )
public string SplFileObject::fgetss ([ string $allowable_tags ] )
public bool SplFileObject::flock ( int $operation [, int &$wouldblock ] )
public int SplFileObject::fpassthru ( void )
public int SplFileObject::fputcsv ( array $fields [, string $delimiter = "," [, string $enclosure = '"' ]] )
public string SplFileObject::fread ( int $length )
public mixed SplFileObject::fscanf ( string $format [, mixed &$... ] )
public int SplFileObject::fseek ( int $offset [, int $whence = SEEK_SET ] )
public array SplFileObject::fstat ( void )
public int SplFileObject::ftell ( void )
public bool SplFileObject::ftruncate ( int $size )
public int SplFileObject::fwrite ( string $str [, int $length ] )
public void SplFileObject::getChildren ( void )
public array SplFileObject::getCsvControl ( void )
public int SplFileObject::getFlags ( void )
public int SplFileObject::getMaxLineLen ( void )
public bool SplFileObject::hasChildren ( void )
public int SplFileObject::key ( void )
public void SplFileObject::next ( void )
public void SplFileObject::rewind ( void )
public void SplFileObject::seek ( int $line_pos )
public void SplFileObject::setCsvControl ([ string $delimiter = "," [, string $enclosure = "\"" [, string $escape = "\\" ]]] )
public void SplFileObject::setFlags ( int $flags )
public void SplFileObject::setMaxLineLen ( int $max_len )
public void SplFileObject::__toString ( void )
public bool SplFileObject::valid ( void )
}

Содержание

Коментарии

Автор:
Since a temporary file is not a real file, some inherited methods will not work. For example,

* SplFileInfo::isReadable() and SplFileInfo::isWritable() return false, not because it was unreadable or unwritable, but because the file does not exists.

* SplFileObject::flock() fails and returns false.

* SplFileInfo::getATime(), SplFileInfo::getCTime(), SplFileInfo::getMTime(), SplFileInfo::getOwner(), SplFileInfo::getGroup(), SplFileInfo::getInode(), SplFileInfo::getPerms(), and SplFileInfo::getSize() throw RuntimeException "stat failed for php://temp". However, SplFileObject::fstat() succeeds and returns atime = mtime = ctime = uid = gid = ino = 0 together with the correct size.

* SplFileInfo::getType throws RuntimeException "Lstat failed for php://temp".

* SplFileInfo::getLinkTarget throws RuntimeException "Unable to read link php://temp, error: No such file or directory".
2023-10-16 12:08:36
http://php5.kiev.ua/manual/ru/class.spltempfileobject.html

    Поддержать сайт на родительском проекте КГБ