本文整理汇总了PHP中COM::getAbsolutePathName方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::getAbsolutePathName方法的具体用法?PHP COM::getAbsolutePathName怎么用?PHP COM::getAbsolutePathName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COM
的用法示例。
在下文中一共展示了COM::getAbsolutePathName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fs
static function fs($path, $is_utf8 = true)
{
static $fs;
isset($fs) or $fs = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
$path = explode('://', $path, 2);
$path = $path[(int) isset($path[1])];
$path = strtr($path, '/', '\\');
$pre = '';
if (!isset($path[0]) || '/' !== $path[0] && '\\' !== $path[0] && false === strpos($path, ':')) {
$pre = getcwd() . '\\';
}
$pre = new \VARIANT($pre);
if ($is_utf8) {
$path = new \VARIANT($path, VT_BSTR, CP_UTF8);
} else {
$path = new \VARIANT($path);
}
return array($fs, $fs->getAbsolutePathName(variant_cat($pre, $path)));
}
示例2: fs
public static function fs($path, $is_utf8 = true)
{
static $fs;
if (!class_exists('COM', false)) {
throw new \RuntimeException('The `wfio` or `com_dotnet` extension is required to handle UTF-8 filesystem access on Windows');
}
isset($fs) or $fs = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
$path = explode('://', $path, 2);
$path = $path[(int) isset($path[1])];
$path = strtr($path, '/', '\\');
$pre = '';
if (!isset($path[0]) || '/' !== $path[0] && '\\' !== $path[0] && false === strpos($path, ':')) {
$pre = getcwd() . '\\';
}
$pre = new \VARIANT($pre);
if ($is_utf8) {
$path = new \VARIANT($path, VT_BSTR, CP_UTF8);
} else {
$path = new \VARIANT($path);
}
return array($fs, $fs->getAbsolutePathName(variant_cat($pre, $path)));
}