(Yaf >=2.1.4)
Yaf_Loader::setLibraryPath — Change the library path
$library_path, bool $is_global = false): Yaf_LoaderChange the library directory.
library_pathThe new library directory.
is_globalWhether to change the global library directory instead of the local one.
Returns the loader instance itself.
Example #1 Yaf_Loader::setLibraryPath() example
<?php
$app = new Yaf_Application(__DIR__ . "/conf/application.ini");
$loader = Yaf_Loader::getInstance();
/* change the local library directory */
$loader->setLibraryPath("/var/www/shop/application/library");
/* change the global library directory */
$loader->setLibraryPath("/usr/local/share/yaf/library", true);
echo $loader->getLibraryPath(), PHP_EOL;
echo $loader->getLibraryPath(true), PHP_EOL;
?>The above example will output something similar to:
/var/www/shop/application/library /usr/local/share/yaf/library