Detailed Description
Class provides virtual FS manipulation routine.
- Author
- Dodonov A.A.
Definition at line 26 of file cached_fs.php.
Member Function Documentation
Constructor.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 66 of file cached_fs.php.
{
try
{
$this->Cache =
get_package(
'cache' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
| file_exists |
( |
|
$OriginalFilePath | ) |
|
Function validates if the file exists.
- Parameters
-
| $OriginalFilePath | - Path to the requesting file. |
- Returns
- true if the file exists, otherwise false.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 172 of file cached_fs.php.
{
try
{
$OriginalFilePath = str_replace( '/./' , '/' , $OriginalFilePath );
$Data = $this->Cache->get_data( $OriginalFilePath );
if( $Data === false )
{
}
else
{
return( $Data == '_file_was_not_found' ? false : true );
}
}
catch( Exception $e )
{
}
}
| file_get_contents |
( |
|
$OriginalFilePath | ) |
|
Cached input from file.
- Parameters
-
| $OriginalFilePath | path to the requesting file. |
- Returns
- File's content.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 216 of file cached_fs.php.
{
try
{
$OriginalFilePath = str_replace( '/./' , '/' , $OriginalFilePath );
$Data = $this->Cache->get_data( $OriginalFilePath );
if( $Data !== false )
{
return( $Data );
}
else
{
if( $Data !== false )
{
$this->Cache->add_data( $OriginalFilePath , $Data );
return( $Data );
}
else
{
throw( new Exception( "File $OriginalFilePath was not found" ) );
}
}
}
catch( Exception $e )
{
}
}
| file_put_contents |
( |
|
$OriginalFilePath, |
|
|
|
$Data |
|
) |
| |
Cached input from file.
- Parameters
-
| $OriginalFilePath | path to the requesting file. |
| Data | - File's content to store. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 268 of file cached_fs.php.
{
try
{
$OriginalFilePath = str_replace( '/./' , '/' , $OriginalFilePath );
if( $this->Cache->data_exists( $OriginalFilePath ) )
{
$this->Cache->set_data( $OriginalFilePath , $Data );
}
else
{
$this->Cache->add_data( $OriginalFilePath , $Data );
}
}
catch( Exception $e )
{
}
}
Function flushes all data on disk.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 304 of file cached_fs.php.
{
try
{
$this->Cache->flush();
}
catch( Exception $e )
{
}
}
Function resets settings.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 92 of file cached_fs.php.
{
try
{
$this->Cache->reset();
}
catch( Exception $e )
{
}
}
| store_file_exists_info |
( |
|
$OriginalFilePath, |
|
|
|
$ExistsFlag |
|
) |
| |
Function stores info if the file exists.
- Parameters
-
| $OriginalFilePath | - Path to the requesting file. |
| $ExistsFlag | - Информация о существовании. |
- Returns
- true if the file exists, otherwise false.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 130 of file cached_fs.php.
{
try
{
if( $ExistsFlag !== false )
{
return( true );
}
else
{
$this->Cache->add_data( $OriginalFilePath , '_file_was_not_found' );
return( false );
}
}
catch( Exception $e )
{
}
}
Field Documentation
List of the mounted storages.
- Author
- Dodonov A.A.
Definition at line 38 of file cached_fs.php.
The documentation for this class was generated from the following file: