當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GetUrlFromPath函數代碼示例

本文整理匯總了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)) . '" />';
}
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:9,代碼來源:basexml.php

示例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>';
}
開發者ID:Moro3,項目名稱:duc,代碼行數:53,代碼來源:commands.php

示例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;
}
開發者ID:msabino,項目名稱:beth-maria,代碼行數:14,代碼來源:basexml.php


注:本文中的GetUrlFromPath函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。