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) |
The __autoload function is automatically set.
| static Pluf::start | ( | $ | config | ) | [static] |
Start the Plume Framework.
Load the configuration files.
| 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'].
| 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.
| bool | Use the cache (true) |
| static Pluf::f | ( | $ | cfg, | |
| $ | default = '' | |||
| ) | [static] |
Access a configuration variable.
| string | Configuration variable | |
| mixed | Possible default value if value is not set ('') |
| static Pluf::pf | ( | $ | pfx, | |
| $ | strip = false | |||
| ) | [static] |
Access an array of configuration variables having a given prefix.
| string | Prefix. | |
| bool | Strip the prefix from the keys (false). |
| 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.
| 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.
| 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.
| 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>
| string | $file Check for this file in the include_path. |
| 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.
| mixed | Extra parameters. |