Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb

pxdb

private class pxdb

 

Public Method Summary

object ADOConnection &dbh([ object [unknown] $new_dbh ])
Set or get the current db instance.
void print_debug(array $msg, string $type)
A function to print debug output -- if $debug var is set.
void trigger_error(string $error_msg, [ constant $error_type, string $error_src ])
Wrapper for PHP's trigger_error() allows for flexible error handling in the future.
array get_pxdb_tables()
Get all tables that are associated with Syntax.
array get_nonpxdb_tables()
Get the non-f1db tables in this instance.
boolean is_table_created(string $table)
Checks whether a table exists.
boolean create_pick_table( $table)
Create a table to be used by pick/pickid dbfield types.
array get_pxdb_reserved_fields()
Get all records columns that are reserved / required by Syntax.
boolean plugin_exists(string $type, string $plugin_data)
Checks to see whether specified plugin can be found.
string get_pxdb_www()
Get the relative URL to the pxdb_www directory.
boolean register_class(string $user_class, string $pxdb_class, [ integer $option ])
Registers user classes to use in place of PxDB standard classes.
string get_class(string $pxdb_class, [ mixed $option ])
Gets a user-defined class (if exists) for a corresponding PxDB class.
array parse_plugin(string $plugin_data)
Parses a plugin to extract any params and plugin script name.

Private Method Summary

void &tpl( $new_tpl)
Set or get the current Smarty template engine instance -- or instantiate if not.
array import([ array $source ])
Import data from global scope.
mixed import_var(string $varname)
Imports value from global scope.
string get_pick_orderby(string $table, [ string $default ])
Get the default order by column for a pick table.
mixed _class(string $action)
Handles reading / writing user-defined classes.

Included files Summary, Type: require_once

PEAR.php Core static utility class for storing system-wide methods.

Public Method Details

&dbh

public object ADOConnection &dbh([ object [unknown] $new_dbh ])

  DB object is stored as a static variable for this method, so you do not need to instantiate this class to call this method / get the current db being used by the site.

Parameter
object [unknown] $new_dbh = >>null<<
ADOConnection
Returns object ADOConnection

object


print_debug

public void print_debug(array $msg, string $type)

  This is a tool used by classes that extend this class.

Parameter
array $msg
, etc) to print.
string $type
Warning: documentation is missing.
Returns void


trigger_error

public void trigger_error(string $error_msg, [ constant $error_type, string $error_src ])

 

Parameter
string $error_msg
constant $error_type = >>E_USER_WARNING,<<
string $error_src = >>null<<
The method name or file name of error origination.
Returns void


get_pxdb_tables

public array get_pxdb_tables()

  This is a static lsit of tables that is set every time this function is called. To add additional "hidden" tables to your Syntax instance, add your tablename(s) as the value of to the pxdb_prefs table -- with pref_name = 'pxdb_table', pref_key = '', pref_value='yourtablname'.

Returns array

Tables that are Syntax tables.


get_nonpxdb_tables

public array get_nonpxdb_tables()

  Calculates the non-f1db tables by the difference between results from get_f1db_tables() and get_tables() methods.

Returns array

The non-f1db tables.


is_table_created

public boolean is_table_created(string $table)

 

Parameter
string $table
The name of the table we are looking for.
Returns boolean


create_pick_table

public boolean create_pick_table( $table)

 

Parameter
$table
Warning: documentation is missing.
Returns boolean

status


get_pxdb_reserved_fields

public array get_pxdb_reserved_fields()

  This is a static list of columns that is set every time this function is called. To add additional "hidden" columns to your Syntax instance, add your fieldname(s) as the value of to the pxdb_prefs table -- with pref_name = 'pxdb_field', pref_key = '', pref_value='yourtablname'.

Returns array

Tables that are Syntax tables.


plugin_exists

public boolean plugin_exists(string $type, string $plugin_data)

 

Parameter
string $type
The type of plugin (corresponds to filesystem directory)
string $plugin_data
The plugin name (function name) we are looking for.
Returns boolean


get_pxdb_www

public string get_pxdb_www()

  There could be more than one pxdb_www preference -- the first choice is to find one where the key is the current hostname. For example, we could have the following in the database: - pxdb_www [dbasis.syntax.forumone.com] = "/data/pxdb_www" - pxdb_www [mysite.com] = "/pxdb_live"

Returns string

The best match from preferences table.


register_class

public boolean register_class(string $user_class, string $pxdb_class, [ integer $option ])

  E.g. you may want to customize an authentication class or use a class that extends the records class. IMPORTANT: It is assumed that the class you are registering has the same constructor signature as PxDB equivalent class. ALSO: not all classes will respect user-registered classes -- e.g. for overhead reasons user-defined metadata data classes cannot be registered.

Parameter
string $user_class
The name of your class (e.g. Document)
string $pxdb_class
The name of the pxdb class you are replacing (e.g. pxdb_record)
integer $option = >>0<<
Any class specific indexing option (i.e. provides ability to register many pxdb_record classes indexed by datatype)
Returns boolean

Success or failure to register


get_class

public string get_class(string $pxdb_class, [ mixed $option ])

  If not user-specified class is found, then it will return the pxdb class name.

Parameter
string $pxdb_class
mixed $option = >>0<<
Returns string

Class name to use.


parse_plugin

public array parse_plugin(string $plugin_data)

 

Parameter
string $plugin_data
Returns array

Hash with 'script' and 'params' keys.


Private Method Details

&tpl

private void &tpl( $new_tpl)

  Template engine is stored as a static variable for this method.

Parameter
$new_tpl
Warning: documentation is missing.
Returns void


import

private array import([ array $source ])

 

Parameter
array $source = >>null<<
The source values to import.
Returns array

The imported values.


import_var

private mixed import_var(string $varname)

  This function takes a string representing a variable name and reads it in from global scope. This string could be an array: e.g. $_REQUEST[f1db][desc1].

Parameter
string $varname
The name of variable to look for.
Returns mixed

The value corresponding to ${$varname};


get_pick_orderby

private string get_pick_orderby(string $table, [ string $default ])

  Will be a weight column if present, if not, will be a pick column.

Parameter
string $table
Pick table name
string $default = >>'name'<<
The default column to use
Returns string

The column name to order by


_class

private mixed _class(string $action)

  This has to be located in one function because we are using static variables to store registered classes. This class takes a variable number of parameters. The first is the action.

Parameter
string $action
'get' or 'register'
Returns mixed

Depends on $action


Included Files, Type: require_once

PEAR.php

require_once( PEAR.php )

The original class design had all classes extending this basic top-level class. This class now exists to provide static methods for system-wide tasks: e.g. triggering an error, printing debug code, etc.

Version $Revision: 1.5 $


Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de