>> YANA 4 PHP Framework >> Docs For Class DatFile

Class DatFile

Description

This class is an alternative to csv files.

Each line represents a row of data. Tags are used to mark up the fields.

The use of tag delimiters inside field values is not allowed. If a tag is found in a value it automatically gets removed.

The structure is not as strict as you might know from CSV files, which means the number and names of fields inside a row may vary from one row to another.

This provides you with more flexibility. For example: You may decide not to use a field for future entries or just add a new one and you don't have to change your previous entries inside the file.

This is also a good way around if you just don't know the structure of future entries yet.

  • access: public

Located in /includes/class_datfile.php

Object
   |
   --InputStream
      |
      --SecureInputStream
         |
         --SecureFileStream
            |
            --DatFile
Method Summary

Methods

retrieve a line of data from the file
array get (
int $line_nr
)
List of parameters:
Name Type Description
$line_nr int line to retrieve
Description:
  • access: public
  • uses: $datfile->get(0)

Redefinition of: SecureInputStream::get()

insert (append) an entry to the file
bool insert (
 $REF, array $new_entry
)
List of parameters:
Name Type Description
$new_entry array a ssociative array containing the new entry
$REF
Description:
  • access: public
  • uses: $datfile->insert($new_entry)

Redefinition of: SecureFileStream::insert()

return the number of rows in the file
int length ()
Description:
  • access: public
  • uses: $datfile->length()

Redefinition of: SecureFileStream::length()

remove an entry from the file
bool remove (
array $line_nr
)
List of parameters:
Name Type Description
$line_nr array line to retrieve
Description:
  • access: public
  • uses: $datfile->insert($new_entry)

Redefinition of: SecureFileStream::remove()

return file content as string (if available)
string toString ()
Description:
  • access: public
  • uses: $datfile->toString()

Redefinition of: SecureInputStream::toString()

inherited from base classes

Inherited From SecureFileStream

Inherited From SecureInputStream

Inherited From InputStream

Inherited From Object

Documentation generated on Sun, 11 Mar 2007 15:02:25 +0100 by phpDocumentor 1.3.1

yana author: Thomas MeyerHomepage: www.yanaframework.net