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

The AMI_iStorage interface

• Introduction

Storage interface.

• Interface synopsis

AMI_iStorage {
/* Constants */
const AMI_iStorage::MODE_MAKE_FOLDER_ON_COPY =  0x01;
/* 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:
since 6.0.2

• Interface Constants

MODE_MAKE_FOLDER_ON_COPY

• Interface Methods

// Copies file.
public copy ( string $from, string $to ) returns bool;
  • string $from
    Path to the source file
  • string $to
    The destination path
// Deletes a file.
public delete ( string $file ) returns bool;
  • string $file
    Path to the file
// Checks whether a file or directory exists.
public exists ( string $file ) returns bool;
  • string $file
    Path to the file
// 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
// Makes directory.
public mkdir ( string $path ) returns bool;
  • string $path
    The directory path
// Renames a file.
public rename ( string $from, string $to ) returns bool;
  • string $from
    The old name
  • string $to
    The new name
// Removes directory.
public rmdir ( string $path, [ bool $silent = FALSE ] ) returns bool;
  • string $path
    The directory path
  • bool $silent
    Skip warning if failed
// 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
// Set mode.
public setMode ( int $mode ) returns void;
  • int $mode
    Mode