本文整理汇总了PHP中fs::get_full_path方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::get_full_path方法的具体用法?PHP fs::get_full_path怎么用?PHP fs::get_full_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::get_full_path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_system_lib
/**
* Load system lib
* Used @see core::$system_libs
*/
private static function load_system_lib($name)
{
if (!array_key_exists($name, self::$system_libs) || self::$libs->is_registered($name)) {
return false;
}
$filename = '';
$config = self::$system_libs[$name];
$cl_name = $name;
$params = null;
if (is_array(self::$system_libs[$name])) {
if (isset($config['file'])) {
$filename = $config['file'];
}
if (isset($config['class'])) {
$cl_name = $config['class'];
}
$params = @$config['params'];
} else {
$filename = $config;
}
// autoload
if (!class_exists($cl_name)) {
if (!$filename) {
throw new core_exception('Error load system lib ' . $name . ' / ' . $cl_name);
}
try {
fs::req(fs::get_full_path($filename . loader::DOT_PHP), true);
} catch (fs_exception $fs_e) {
throw new core_exception('Error load system lib ' . $name . '. ' . $fs_e->getMessage());
}
}
// try with prefix
if (!class_exists($cl_name, 0)) {
$cl_name = loader::CLASS_PREFIX . $cl_name;
}
if (!class_exists($cl_name, 0)) {
throw new core_exception('Class doesnt exists ' . $cl_name);
}
$plib = new $cl_name($params);
return self::register_lib($name, $plib);
}
示例2: load_system_lib
/**
* Load system lib
* Used @see core::$system_libs
*/
private static function load_system_lib($name)
{
if (!array_key_exists($name, self::$system_libs) || self::$libs->is_registered($name)) {
return false;
}
try {
fs::req(fs::get_full_path(self::$system_libs[$name] . loader::DOT_PHP), true);
} catch (fs_exception $fs_e) {
throw new core_exception('Error load system lib ' . $name . '. ' . $fs_e->getMessage());
}
$cl_name = $name;
// try with prefix
if (!class_exists($cl_name)) {
$cl_name = loader::CLASS_PREFIX . $cl_name;
}
if (!class_exists($cl_name)) {
throw new core_exception('Class doesnt exists ' . $cl_name);
}
self::register_lib($name, new $cl_name());
}