当前位置: 首页>>代码示例>>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;未经允许,请勿转载。