The AMI_iStorage interface
• Introduction
Storage interface.
• Interface synopsis
AMI_iStorage
{
// 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;
}
• 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;
// 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;
// Set mode.
public
setMode ( int $mode ) returns void;
|