(Yaf >=1.0.0)
Yaf_Loader::getInstance — Retrieve the Yaf_Loader instance
$local_library_path = null, string $global_library_path = null): Yaf_Loader|falseRetrieve the singleton Yaf_Loader instance.
If the library paths are given, they are applied to the existing instance.
local_library_pathThe local library directory, usually the same as the application.library.directory ini setting.
global_library_pathThe global library directory. If not given, the local one is used.
The Yaf_Loader instance, or false if the loader has not been initialized (which is normally done by Yaf_Application).
Example #1 Yaf_Loader::getInstance() example
<?php
$app = new Yaf_Application(__DIR__ . "/conf/application.ini");
/* Yaf_Application has initialized the loader, so the
* singleton instance is available now */
$loader = Yaf_Loader::getInstance();
$loader->registerNamespace("Vendor", APPLICATION_PATH . "/library/Vendor");
?>Example #2 Yaf_Loader::getInstance() before initialization
<?php
/* no Yaf_Application has been created yet */
var_dump(Yaf_Loader::getInstance());
?>The above example will output something similar to:
bool(false)