Класс SplTempFileObject
(PHP 5 >= 5.1.2, PHP 7)
Введение
Класс SplTempFileObject предлагает объектно-ориентированный интерфейс для работы с временными файлами.
Обзор классов
/* Методы */
/* Наследуемые методы */
public SplFileObject::__construct
( string
$filename
[, string $open_mode
= "r"
[, bool $use_include_path
= false
[, resource $context
]]] )
public array SplFileObject::fgetcsv
([ string
$delimiter
= ","
[, string $enclosure
= "\""
[, string $escape
= "\\"
]]] )
public int SplFileObject::fputcsv
( array
$fields
[, string $delimiter
= ","
[, string $enclosure
= '"'
]] )
public void SplFileObject::setCsvControl
([ string
}$delimiter
= ","
[, string $enclosure
= "\""
[, string $escape
= "\\"
]]] )Содержание
- SplTempFileObject::__construct — Создает новый объект, представляющий временный файл
Коментарии
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".