PHP - Manual: Yaf_Loader::getNamespacePath
2024-12-22
(Yaf >=3.2.0)
Yaf_Loader::getNamespacePath — Retieve path of a registered namespace
$namespaces
): stringretrieve path of a registered namespace
namespace
a string of namespace.
string path, if the namespace is not registered, then null
default library will be returned
示例 #1 Yaf_Loader::registerNamespace()example
<?php
$loader = Yaf_Loader::getInstance("/var/application/lib");
$loader->registerNamespace("\Vendor\PHP", "/var/lib/php");
$loader->getNamespacePath("\Vendor\PHP"); // '/var/lib/php'
$loader->getNamespacePath("\Vendor\JSP"); // '/var/application/lib'
?>
官方地址:https://www.php.net/manual/en/yaf-loader.getnamespacepath.php