A class to manipulate flat-file databases
A useful class to manipulate flat-file databases. Supports multipule line endings for compactiblity with flat-file databases you made yourself with Windoze Notepad.
Located in /flatfiletools.lib.php (line 47)
Contains the list of configuration options This variable contains an array of configuration options, loaded by default from config.ini. The list is specified below:
Contains the current error code
This variable contains the current error code. The error codes are as specified in the list below:
Adds a row/line to the flatfile database
Adds a new row/line in an array of columns. You can call get_number_of_cols to get the number of columns. To get the number of columns starting with zero instead of one, use get_number_of_cols_zero instead. To add a raw line, use add_line_raw.
Adds a row/line to the flatfile database in raw format
Adds a new row/line in an array of columns. You can call get_number_of_cols to get the number of columns. To get the number of columns starting with zero instead of one, use get_number_of_cols_zero instead.
Applies all changes
Applies all the changes made with the set* family of functions. It calles the methods commit and write to apply all changes in the buffers and applies the changes to disk.
Commits the changes so write can process them
Commits the changes so the buffers to write can proccess them and make the changes you made using set_field and set_line. Always rembember to call this method before you write to your file.
Get the specified columns in the database
Gets the specified column in the database for all the rows.
Returns the current error code
Returns the current error code.
Gets a specified field from the database.
Gets a specified field from the database using the specified row and column
Retrieves the specified line/row
Retrieves the line/row specified in an array. To get the raw data for the line, call commit followed by get_line_raw.
Retrieves the specified row, in raw format
Retrieves the specified row from the buffers. Don't forget to call commit before running this method. See get_line for more details.
Gets the number of columns in the database
Gets the number of columns in the database using the column descriptor.
Gets the number of columns in the database starting from zero
Alias of get_number_of_cols
Gets the number of rows/lines in the database
Gets the number of rows/lines in the database. Newlines count as one fully row/line even though it isn't actually a row/line.
Match a row with a list of string indexes
Matches a row with a list of string indexes. Example:
Populate the data buffers
Populates the data buffers with the file specified in set_datafile with the configuration file in config.ini.
Sets the location/path to the flatfile database
Sets the location or the path to the flat-file database for access. May be relative or absloute as long as it is accessible. If file does not exist, error #1 will be thrown when you call the populate family of functions.
Sets the value of a specific field
Sets the value of the specified field in the flat-file database
Change an row/line's columns
Changes a existing row/lines columns. Use add_line to add a new row/line.
Writes the database in the buffers to the textfile
Writes the database in the buffers to the textfile. Make sure you have called commit after you've made any changes to the database using set_field and set_line to update the buffers.
Destroys the database from random variables (not to be used)
Hidden function to destroy the database. Can be disabled in config.ini, provided that you are not using a modified version of FlatfileTools that does not hounor the config.ini settings.
Documentation generated on Wed, 13 Aug 2008 16:56:54 -0400 by phpDocumentor 1.4.1