PHP 8.6.0 Beta 3 is available for testing

Yaf_Loader::setLibraryPath

(Yaf >=2.1.4)

Yaf_Loader::setLibraryPathChange the library path

Beschreibung

public function Yaf_Loader::setLibraryPath(string $library_path, bool $is_global = false): Yaf_Loader

Change the library directory.

Parameter-Liste

library_path

The new library directory.

is_global

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

Rückgabewerte

Returns the loader instance itself.

Beispiele

Beispiel #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;
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top