php8.5
Home/ Manual/ yaf / yaf_loader/ Yaf_Loader::getLibraryPath

Yaf_Loader::getLibraryPath

PHP function Edit on GitHub ✎

(Yaf >=2.1.4)

Retrieve the library path

Description

Yaf_Loader::getLibraryPath(bool $is_global = false): string

Retrieve the library directory.

Parameters

is_global

Whether to retrieve the global library directory instead of the local one.

Return Values

The library directory as a string, or an empty string when the global library directory is requested but not set.

Examples

Yaf_Loader::getLibraryPath example

php
<?php
$loader = Yaf_Loader::getInstance(
    "/var/www/shop/application/library",
    "/usr/local/share/yaf/library"
);

/* the local library directory */
echo $loader->getLibraryPath(), PHP_EOL;

/* the global library directory */
echo $loader->getLibraryPath(true), PHP_EOL;
?>

The above example will output something similar to:

output
/var/www/shop/application/library
/usr/local/share/yaf/library

See Also

  • Yaf_Loader::setLibraryPath

Source: reference/yaf/yaf_loader/getlibrarypath.xml · from the official PHP manual (php/doc-en)