本文整理汇总了PHP中GetUrlFromPath函数的典型用法代码示例。如果您正苦于以下问题:PHP GetUrlFromPath函数的具体用法?PHP GetUrlFromPath怎么用?PHP GetUrlFromPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetUrlFromPath函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateXmlHeader
function CreateXmlHeader($command, $resourceType, $currentFolder)
{
// Create the XML document header.
echo '<?xml version="1.0" encoding="utf-8" ?>';
// Create the main "Connector" node.
echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
// Add the current folder node.
echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType, $currentFolder)) . '" />';
}
示例2: GetFoldersAndFiles
function GetFoldersAndFiles($resourceType, $currentFolder)
{
global $Config;
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
$sCurrentPath = GetUrlFromPath($resourceType, $currentFolder, 'GetFoldersAndFiles');
// Arrays that will hold the folders and files names.
$aFolders = array();
$aFiles = array();
$oCurrentFolder = opendir($sServerDir);
while ($sFile = readdir($oCurrentFolder)) {
if ($sFile != '.' && $sFile != '..') {
if (is_dir($sServerDir . $sFile)) {
$aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" size="' . filemanager_dirsize($sServerDir . $sFile) . '"/>';
} else {
$iFileSize = @filesize($sServerDir . $sFile);
if (!$iFileSize) {
$iFileSize = 0;
}
if ($iFileSize > 0) {
$iFileSize = filemanager_size($iFileSize);
}
if ($resourceType == 'Image' && $Config['ThumbList']) {
$new = filemanager_getthumbname($currentFolder . $sFile);
if (file_exists(CombinePaths($_SERVER['DOCUMENT_ROOT'] . GetResourceTypePath('ImageThumb', 'GetFoldersAndFiles'), $new))) {
$t = CombinePaths(GetResourceTypePath('ImageThumb', 'GetFoldersAndFiles'), $new);
} else {
$t = 'X';
}
list($w, $h) = getimagesize($sServerDir . $sFile);
$add = 'thumb="' . ConvertToXmlAttribute($t) . '" width="' . $w . '" height="' . $h . '"';
} else {
$add = '';
}
$aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" ' . $add . '/>';
}
}
}
// Send the folders
natcasesort($aFolders);
echo '<Folders>';
foreach ($aFolders as $sFolder) {
echo $sFolder;
}
echo '</Folders>';
// Send the files
natcasesort($aFiles);
echo '<Files>';
foreach ($aFiles as $sFiles) {
echo $sFiles;
}
echo '</Files>';
}
示例3: CreateXmlHeader
function CreateXmlHeader($command, $resourceType, $currentFolder)
{
global $Config;
SetXmlHeaders();
// Create the XML document header.
echo '<?xml version="1.0" encoding="utf-8" ?>';
// Create the main "Connector" node.
echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
// Add the current folder node.
$url = GetUrlFromPath($resourceType, $currentFolder, $command);
$absurl = $Config['k_append_url'] . $url;
echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute($url) . '" absurl="' . ConvertToXmlAttribute($absurl) . '" />';
$GLOBALS['HeaderSent'] = true;
}