start()
start( $config)
Start the framework
Parameters
$config |
The main class of the framework.
From where all start.
The __autoload function is automatically set.
loadRelations( $usecache = true)
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.
$usecache |
loadFunction( $function)
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.
$function |
fileExists(string $file) : mixed
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;
}
string | $file | Check for this file in the include_path. |
Full path to the file if the file exists and is readable in the include_path, false if not.
db( $extra = null) : resource
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.
$extra |
DB connection.