CAdvBanner :: makeFileArrayFromPath: Bitrix method

      
<?php 
//  CAdvBanner :: makeFileArrayFromPath()
//  /dist/bitrix/modules/advertising/classes/general/advertising.php:1987

    
private static function makeFileArrayFromPath($file_path$description null$options = array())
    {
        
/** @global CMain $APPLICATION */
        
global $APPLICATION;
        
$result false;

        if (
preg_match("/^https?:\\/\\//"$file_path))
        {
            
$result CFile::MakeFileArray($file_path);
        }
        else
        {
            
$io CBXVirtualIo::GetInstance();
            
$normPath $io->CombinePath("/"$file_path);
            
$absPath $io->CombinePath($_SERVER["DOCUMENT_ROOT"], $normPath);
            if (
$io->ValidatePathString($absPath) && $io->FileExists($absPath))
            {
                
$perm $APPLICATION->GetFileAccessPermission($normPath);
                if (
$perm >= "W")
                    
$result CFile::MakeFileArray($io->GetPhysicalName($absPath));
            }
        }

        if (
is_array($result))
        {
            if (!
is_null($description))
                
$result["description"] = $description;
        }

        return 
$result;
    }