|
Tv2 documentation | |||||
PREV NEXT | FRAMES NO FRAME | |||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Tv2 X database (tv2Xdb) -- a simple but powerful flat-file XML database
Field Summary | |
string | $dir Directory in which xdb document files are stored |
private array | $fat Array with document properties |
private string | $fat_table Db table name for fat |
private object | $fh tv2FileHelper object |
private array | $fident Array (ident => id) |
string | $file_dir Directory in which files from document fields are stored |
private array | $ver Experimental. |
private array | $ver_filter Experimental. |
private array | $ver_index Experimental. |
private string | $ver_table Experimental. |
Constructor Summary | |
void | tv2Xdb() Constructor |
Method Summary | |
private boolean | cDir(string $path) Recursively creates directories |
boolean | changeDocPermissions(object& $doc) Updates document permissions |
boolean | changeDocType(object& $doc, [string $type]) Changes document type |
string | checkNfix([boolean $fix]) Checks FAT,version info and indices for errors and fixes them if needed |
void | connect() Fills fat and ver_info arrays |
private mixed | decodeCdata(string $string) Decode string from CDATA |
boolean | documentExists(mixed $id) Checks if a document exists |
private string | encodeCdata(string $string) Encode string as CDATA (removes < > &) |
private boolean | error(string $msg) Error reporting |
array | getAllDocs([string $mode]) Returns FAT array for all documents in Xdb |
array | getFat([mixed $ids], [array $o]) Get FAT entries for a specified list of document IDs |
array | getList(string $path) Get FAT entries for documents in some path |
private boolean | isPermitted(integer $doc_id, string $access) Permission checking |
private void | loadFileHelper() Loads tv2FileHelper into $this->fh. |
private boolean | loadXIndex() Loads ctlIndexer object into parameter $xi |
private boolean | loadXQuery() Loads tv2XQuery object into parameter $xq |
boolean | moveDocument(object& $doc, string $ident, [boolean $overwrite]) Moves document from one path to another |
array | query(string $q, [array $o], [integer $s], [integer $l]) Queries Xdb using SQL-like synthax |
object& | readDocument(mixed $id, [mixed $vinfo]) Creates tv2Document object reference |
boolean | removeDocument(object& $doc, [mixed $vinfo]) Removes document |
void | setVersionFilter(array $filter) Experimental. |
void | setVersionPreference(array $filter) Experimental. |
boolean | updateIndex(object& $doc) Updates indexes for the specified document |
boolean | writeDocument(object& $doc) Writes tv2 document information into database and disk. |
Field Detail |
string $dir
Directory in which xdb document files are stored
private array $fat
Array with document properties
private string $fat_table
Db table name for fat
private object $fh
tv2FileHelper object
private array $fident
Array (ident => id)
string $file_dir
Directory in which files from document fields are stored
private array $ver
Experimental. Default version (serves as versioning indicator)
private array $ver_filter
Experimental. Run-time version filter
private array $ver_index
Experimental. Srray with document version info
private string $ver_table
Experimental. Version information db table
Constructor Detail |
void tv2Xdb()
Constructor
Method Detail |
private boolean cDir(string $path)
Recursively creates directories
path
- - path to a documentboolean changeDocPermissions(object& $doc)
Updates document permissions
doc
- - tv2Document objectboolean changeDocType(object& $doc, [string $type])
Changes document type
doc
- - tv2Document referencetype
- - type to change tostring checkNfix([boolean $fix])
Checks FAT,version info and indices for errors and fixes them if needed
fix
- (default TRUE) tells if the function should fix errorsvoid connect()
Fills fat and ver_info arrays
private mixed decodeCdata(string $string)
Decode string from CDATA
string
- - string to be decodedboolean documentExists(mixed $id)
Checks if a document exists
id
- - document ID or identprivate string encodeCdata(string $string)
Encode string as CDATA (removes < > &)
string
- - string to be encodedprivate boolean error(string $msg)
Error reporting
msg
- - error messagearray getAllDocs([string $mode])
Returns FAT array for all documents in Xdb
mode
- index by id ('id') or ident('ident').array getFat([mixed $ids], [array $o])
Get FAT entries for a specified list of document IDs
ids
- ID array or single ID/idento
- Order: array('field', 'ASC'/'DESC')array getList(string $path)
Get FAT entries for documents in some path
path
- - pathprivate boolean isPermitted(integer $doc_id, string $access)
Permission checking
doc_id
- - tv2 Xdb document idaccess
- - access type (one of: r/w/x/o/d)private void loadFileHelper()
Loads tv2FileHelper into $this->fh. ATTENTION: method copied from tv2Client::loadFileHelper.
private boolean loadXIndex()
Loads ctlIndexer object into parameter $xi
private boolean loadXQuery()
Loads tv2XQuery object into parameter $xq
boolean moveDocument(object& $doc, string $ident, [boolean $overwrite])
Moves document from one path to another
doc
- - tv2Document objectident
- - new document identoverwrite
- - overwrite confirmation flag (default FALSE)array query(string $q, [array $o], [integer $s], [integer $l])
Queries Xdb using SQL-like synthax
q
- SQL like queryo
- order by: array('field', 'ASC'/'DESC')s
- start from (default 0)l
- limit result number toobject& readDocument(mixed $id, [mixed $vinfo])
Creates tv2Document object reference
id
- - document ID or identvinfo
- Experimental. Specifies with version of the document to open.boolean removeDocument(object& $doc, [mixed $vinfo])
Removes document
doc
- - tv2Document objectvinfo
- Experimental. If specified only the version of the document will be removedvoid setVersionFilter(array $filter)
Experimental. Sets strict version filter (Xdb will see only documents with this version)
filter
- array of version arraysvoid setVersionPreference(array $filter)
Experimental. Set a version preference: Xdb will try opening specified versions over default version
filter
- array of version arraysboolean updateIndex(object& $doc)
Updates indexes for the specified document
doc
- - tv2Document objectboolean writeDocument(object& $doc)
Writes tv2 document information into database and disk. Used both for updating and creating new documents
doc
- - tv2Document object
|
Tv2 documentation | |||||
PREV NEXT | FRAMES NO FRAME | |||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)