Download the PHP package aternos/io without Composer
On this page you can find all versions of the php package aternos/io. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package io
aternos/io
PHP library for IO operations.
The main goal of this library is to abstract IO operations to make different kind of IO elements, e.g. files and streams, interchangeable and allow writing code that doesn't depend on the filesystem, but feature interfaces that can be implemented for any kind of IO backend, e.g. network based storages.
Installation
Basic Usage
IO Elements
Name | Class | Description |
---|---|---|
File | Aternos\IO\System\File\File |
Regular filesystem file |
TempDiskFile | Aternos\IO\System\File\TempDiskFile |
Temporary disk file, created and deleted automatically |
TempMemoryFile | Aternos\IO\System\File\TempMemoryFile |
Temporary file in memory |
TempMemoryDiskFile | Aternos\IO\System\File\TempMemoryDiskFile |
Temporary file in memory, moved to disk when size exceeds a threshold |
Directory | Aternos\IO\System\Directory\Directory |
Regular filesystem directory |
TempDirectory | Aternos\IO\System\Directory\TempDirectory |
Temporary directory, created and deleted automatically |
FilteredDirectory | Aternos\IO\System\Directory\FilteredDirectory |
Directory that filters its children |
Link | Aternos\IO\System\Link\Link |
Generic filesystem link |
FileLink | Aternos\IO\System\Link\FileLink |
Filesystem link to a file, can be used like a file |
DirectoryLink | Aternos\IO\System\Link\DirectoryLink |
Filesystem link to a directory, can be used like a directory |
SocketStream | Aternos\IO\System\Socket\Stream\SocketStream |
Stream for reading from and writing to sockets |
SocketReadStream | Aternos\IO\System\Socket\Stream\SocketReadStream |
Stream for read only sockets |
SocketWriteStream | Aternos\IO\System\Socket\Stream\SocketWriteStream |
Stream for write only sockets |
You can get the correct IO element from a path using FilesystemElement::getIOElementFromPath()
.
Interfaces
You can and should use the provided interfaces when writing your code to make it more flexible and interchangeable.
The basic interface for all IO elements is Aternos\IO\Interfaces\IOElementInterface
.
Feature Interfaces
The feature interfaces define specific features that an IO element can have, e.g. reading or writing. You should limit the required type in your code to the specific features that you need.
All feature interfaces are listed here: src/Interfaces/Features
.
Example
Type Interfaces
For convenience, this library also provides type interfaces that combine multiple feature interfaces for common
IO elements. All type interfaces are listed here: src/Interfaces/Types
.