yana

Description
  Class trees
  Index of elements
  Todo List
core
  Classes
    FormCreator
    Index
    Language
    Object
    Plugin
    PluginManager
    Singleton
    SmartTemplate
    SmartView
    Utility
    Yana
database
  Classes
    DbBlob
    DbCreator
    DbDesigner4
    DbExtractor
    DbQuery
    DbQueryParser
    DbServer
    DbStream
    DbStructure
    FileDb
error_reporting
  Classes
    Alert
    Error
    ErrorUtility
    Log
    Message
    Report
    Warning
file_system
  Classes
    DatFile
    Dir
    Executeable
    File
    FileReadonly
    FileSystemResource
    SML
javascript
  Classes
    AjaxRequest
  Functions
    preview
    yanaAddEventListener
    yanaAddIcon
    yanaCheckEmbTags
    yanaCloseAll
    yanaGetCookie
    yanaGetElementsByClassName
    yanaMaxLength
    yanaMenu
    yanaMenuCookie
    yanaSetCookie
mail
  Classes
    FormMailer
    Mailer
plugins
  Classes
    plugin_blog
    plugin_check
    plugin_db_admin
    plugin_db_tools
    plugin_default_library
    plugin_diagnostics
    plugin_guestbook
    plugin_guestbook_admin
    plugin_ipblock
    plugin_ipblock_admin
    plugin_rss
    plugin_rss_admin
    plugin_sdk
    plugin_search
    plugin_search_admin
    plugin_user
    plugin_user_admin
utilities
  Classes
    Brush
    Counter
    Hashtable
    Image
    Microsummary
    RSS
    RSSitem
    String
  Functions
    checkArgumentList
    cloneArray
    dirlist
    qSearchArray
    untaintInput
    XMLencode
vdrive
  Classes
    Registry
    VDrive
zip
  Classes
    PclZip

phpDocumentor v 1.4.0

YANA Framework for PHPDocs For Class FileReadonly

### Class FileReadonly

#### Description

checked reading of file sources
This class adds functionality to compute the checksum of a resource and failsafe reading of resources.
Note: This class does not implement methods for writing on files.

- access: public

    Object
       |
       --FileSystemResource
          |
          --FileReadonly

##### Method Summary

- bool failSafeRead ()
- string get ()
- int getCrc32 ([string $filename = ""])
- string getFileContent ()
- string getMd5 ([string $filename = ""])
- bool isEmpty ()
- bool read ()
- void reset ()
- string toString ()

#### Direct descendents

Class | Description
--- | ---
DbBlob | read binary large objects (blobs) from database
File | checked reading and writing of file sources
VDrive | virtual Drive

#### Methods

##### read file contents

bool failSafeRead ()

###### Description:

Automatically restarts reading if the file-resource is temporarily not available after waiting for 0.5 seconds.
The process is aborted if it fails 3 times.

- access: public

##### get file contents

string get ()

###### Description:

- access: public

Redefinition of: FileSystemResource::get()

Redefined in descendants as:

- DatFile::get() : retrieve a line of data from the file
- SML::get() : get a value from the file
- VDrive::get() : get a mountpoint

##### return crc32 checksum for this file

int getCrc32 (
[string $filename = ""]
)

###### List of parameters:

Name | Type | Description
--- | --- | ---
$filename | string |

###### Description:

The filename parameter became available in version 2.8.5
This function has two synopsis. You may decide either to call it statically or based on a current instance.

- $md5 = FileReadonly::getMd5(string $filename)
- $md5 = $file->getMd5();

Both will return a MD5 hash. The first one for the file with the name you provided, the second for the file currently represented by the object $file (where $file is an instance of FileReadonly or a derived sub-class).
Note: This function has been renamed in version 2.9 RC3 from "FileReadonly::checksum", to better comply with the framework's naming convention
If you prefer a hash value over a checksum, you may want to have a look at FileReadonly::getMd5() instead.

- see: FileReadonly::getMd5()
- access: public
- name: FileReadonly::getCrc32()

##### return file contents as string

string getFileContent ()

###### Description:

- access: public

Redefined in descendants as:

- SML::getFileContent() : return file contents as string

##### return md5 hash for this file

string getMd5 (
[string $filename = ""]
)

###### List of parameters:

Name | Type | Description
--- | --- | ---
$filename | string | name of file (using current file if left blank)

###### Description:

This function calculates and returns the MD5 hash-string for a file.
Usefull to check whether or not a file has been changed since last access.
This function has two synopsis. You may decide either to call it statically or based on a current instance.

- $md5 = FileReadonly::getMd5(string $filename)
- $md5 = $file->getMd5();

Both will return a MD5 hash. The first one for the file with the name you provided, the second for the file currently represented by the object $file (where $file is an instance of FileReadonly or a derived sub-class).
Note: results are cached for the current file.
Note: This function has been renamed in version 2.9 RC3 from "FileReadonly::md5Checksum", as the MD5 algorithm does not really return a checksum, but a hash value.
If you prefer a checksum over a hash value, you may want to have a look at FileReadonly::getCrc32() instead.

- see: FileReadonly::getCrc32()
- since: 2.8.5
- access: public
- name: FileReadonly::getMd5()

##### returns bool(true) if the source is empty or not loaded

bool isEmpty ()

###### Description:

- access: public

##### read file contents

bool read ()

###### Description:

Returns bool(true) on success and bool(false) on error.

- access: public

Redefinition of: FileSystemResource::read()

Redefined in descendants as:

- DbBlob::read() : read file contents
- SML::read() : initialize file contents
- DbStructure::read() : read and initialize the file
- VDrive::read() : read the virtual drive

##### reload file contents

void reset ()

###### Description:

You accidently did something wrong with the file? Calling this will reload the file from disk while reseting its current state.

- access: public

Redefined in descendants as:

- SML::reset() : reset the file

##### alias of get()

string toString ()

###### Description:

- access: public

Redefinition of: Object::toString()

Redefined in descendants as:

- DatFile::toString() : return file content as string (if available)
- SML::toString() : get a string representation
- VDrive::toString() : get string represenation of a virtual drive

##### inherited from base classes

Inherited From FileSystemResource

- FileSystemResource::FileSystemResource()
- FileSystemResource::equals()
- FileSystemResource::exists()
- FileSystemResource::get()
- FileSystemResource::getLastModified()
- FileSystemResource::getPath()
- FileSystemResource::read()

Inherited From Object

- Object::cloneObject()
- Object::equals()
- Object::getClass()
- Object::serialize()
- Object::toString()

Documentation generated on Sun, 04 Jan 2009 03:48:59 +0100 by phpDocumentor 1.4.0

yana author: Thomas Meyerwww.yanaframework.net