$Storage - is system object, that provides abstraction for storages, instance can be obtained in such way:
<?php
$Storage = \cs\Storage::instance();
$Storage object has next public methods:
- storage()
- get_connections_list()
Also if there is only one configured storage it is possible to call methods of \cs\Storage\_Abstract class directly from this object:
<?php
$Storage = \cs\Storage::instance();
$content = $Storage->storage(0)->file_get_content('some_file');
Method returns instance of class for storage abstraction.
Is used for getting of active, successful and failed connections.
###[Up](#) \cs\Storage\\_Abstract classThis is abstract class is used as base for storage driver classes. It is described here because it shows major methods of storage abstraction.
This class has next public methods:
- connected()
- base_url()
- get_files_list()
- file()
- file_get_contents()
- file_put_contents()
- copy()
- unlink()
- file_exists()
- rename()
- mkdir()
- rmdir()
- is_file()
- is_dir()
- url_by_source()
- source_by_url()
Connection state
Base URL for files in this storage
All other methods works completely similar to system functions, but pay attention, paths to files should be relative (not absolute).