Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Storage_FS class

• Introduction

File system storage driver.

• Class synopsis

AMI_Storage_FS implements AMI_iStorage {
/* Properties */
// Mode
protected int $mode;
/* Methods */
// Copies file.
public copy ( string $from, string $to ) returns bool;
// Deletes a file.
public delete ( string $file ) returns bool;
// Checks whether a file or directory exists.
public exists ( string $file ) returns bool;
// Reads entire file into a string.
public load ( string $file, [ bool $warn = TRUE ] ) returns mixed;
// Makes directory.
public mkdir ( string $path ) returns bool;
// Renames a file.
public rename ( string $from, string $to ) returns bool;
// Removes directory.
public rmdir ( string $path, [ bool $silent = FALSE ] ) returns bool;
// Write a string to a file.
public save ( string $file, string $content, [ bool $asDefault = FALSE ] ) returns bool;
// Set mode.
public setMode ( int $mode ) returns void;
}
Tags:
resource storage/fs AMI::getResource('storage/fs')
since 6.0.2

• Class Properies

protected int $mode

Mode

• Class Methods

// Copies file.
public copy ( string $from, string $to ) returns bool;
  • string $from
    Path to the source file
  • string $to
    The destination path

Implementation of: AMI_iStorage::copy().

// Deletes a file.
public delete ( string $file ) returns bool;
  • string $file
    Path to the file

Implementation of: AMI_iStorage::delete().

// Checks whether a file or directory exists.
public exists ( string $file ) returns bool;
  • string $file
    Path to the file

Implementation of: AMI_iStorage::exists().

// Reads entire file into a string.
public load ( string $file, [ bool $warn = TRUE ] ) returns mixed;
  • string $file
    Name of the file to read
  • bool $warn
    Flag specifying to warn if cannot load

Implementation of: AMI_iStorage::load().

// Makes directory.
public mkdir ( string $path ) returns bool;
  • string $path
    The directory path

Implementation of: AMI_iStorage::mkdir().

// Renames a file.
public rename ( string $from, string $to ) returns bool;
  • string $from
    The old name
  • string $to
    The new name

Implementation of: AMI_iStorage::rename().

// Removes directory.
public rmdir ( string $path, [ bool $silent = FALSE ] ) returns bool;
  • string $path
    The directory path
  • bool $silent
    Skip warning if failed

Implementation of: AMI_iStorage::rmdir().

// Write a string to a file.
public save ( string $file, string $content, [ bool $asDefault = FALSE ] ) returns bool;
  • string $file
    Path to the file where to write the data
  • string $content
    The data to write
  • bool $asDefault
    Save as default content

Implementation of: AMI_iStorage::save().

// Set mode.
public setMode ( int $mode ) returns void;
  • int $mode
    Mode

Implementation of: AMI_iStorage::setMode().