Pluf Class Reference

List of all members.

Static Public Member Functions

static start ($config)
static loadConfig ($config_file)
static loadRelations ($usecache=true)
static f ($cfg, $default='')
static pf ($pfx, $strip=false)
static factory ($model, $params=null)
static loadClass ($class)
static loadFunction ($function)
static fileExists ($file)
static & db ($extra=null)


Detailed Description

The main class of the framework. From where all start.

The __autoload function is automatically set.


Member Function Documentation

static Pluf::start ( config  )  [static]

Start the Plume Framework.

Load the configuration files.

Parameters:
string Configuration file to use

static Pluf::loadConfig ( config_file  )  [static]

Load the given configuration file.

The configuration is saved in the $GLOBALS['_PX_config'] array. The relations between the models are loaded in $GLOBALS['_PX_models'].

Parameters:
string Configuration file to load.

static Pluf::loadRelations ( usecache = true  )  [static]

Get the model relations and signals.

If not in debug mode, it will automatically cache the information. This allows one include file when many applications and thus many includes are needed.

Signals and relations are cached in the same file as the way to go for signals is to put them in the relations.php file.

Parameters:
bool Use the cache (true)

static Pluf::f ( cfg,
default = '' 
) [static]

Access a configuration variable.

Parameters:
string Configuration variable
mixed Possible default value if value is not set ('')
Returns:
mixed Configuration variable or default value if not defined.

static Pluf::pf ( pfx,
strip = false 
) [static]

Access an array of configuration variables having a given prefix.

Parameters:
string Prefix.
bool Strip the prefix from the keys (false).
Returns:
array Configuration variables.

static Pluf::factory ( model,
params = null 
) [static]

Returns a given object.

Loads automatically the corresponding class file if needed. If impossible to get the class $model, exception is thrown.

Parameters:
string Model to load.
mixed Extra parameters for the constructor of the model.

static Pluf::loadClass ( class  )  [static]

Load a class depending on its name.

Throw an exception if not possible to load the class.

Parameters:
string Class to load.

static Pluf::loadFunction ( function  )  [static]

Load a function depending on its name.

The implementation file of the function MyApp_Youpla_Boum_Stuff() is MyApp/Youpla/Boum.php That way it is possible to group all the related function in one file.

Throw an exception if not possible to load the function.

Parameters:
string Function to load.

static Pluf::fileExists ( file  )  [static]

Hack for [[php file_exists()]] that checks the include_path.

Use this to see if a file exists anywhere in the include_path.

$file = 'path/to/file.php'; if (Pluf::fileExists('path/to/file.php')) { include $file; }

Paul M. Jones <pmjones@solarphp.net>

Parameters:
string $file Check for this file in the include_path.
Returns:
mixed Full path to the file if the file exists and is readable in the include_path, false if not.

static& Pluf::db ( extra = null  )  [static]

Helper to load the default database connection.

This method is just dispatching to the function define in the configuration by the 'db_get_connection' key or use the default 'Pluf_DB_getConnection'. If you want to use your own function, take a look at the Pluf_DB_getConnection function to use the same approach for your method.

The extra parameters can be used to selectively connect to a given database. When the ORM is getting a connection, it is passing the current model as parameter. That way you could get different databases for different models.

Parameters:
mixed Extra parameters.
Returns:
resource DB connection.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:51 2010 for Pluf by  doxygen