Ignore:
Timestamp:
2013/11/18 15:20:47 (13 years ago)
Author:
m_uehara
Message:

#2465 r23269 - r23272, r23274 - r23275, r23277 - r23278 をマージ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/util/SC_Utils.php

    r23124 r23279  
    20922092        return array_reverse($arrTrail); 
    20932093    } 
     2094     
     2095    /** 
     2096     * Obtain the parts of path that are not the same and confirm if file exists 
     2097     * by reconstructing path with base path. 
     2098     * 
     2099     * @param  string  $file 
     2100     * @param  string  $base_path 
     2101     * @return bool true = exists / false does not exist 
     2102     */ 
     2103    public  function checkFileExistsWithInBasePath($file,$base_path)  
     2104    {   
     2105        $arrPath = explode('/', str_replace('\\', '/',$file)); 
     2106        $arrBasePath = explode('/', str_replace('\\', '/',$base_path)); 
     2107        $path_diff = implode("/",array_diff_assoc($arrPath, $arrBasePath)); 
     2108        return file_exists(realpath(str_replace('..','',$base_path . $path_diff))) ? true : false; 
     2109    } 
    20942110} 
Note: See TracChangeset for help on using the changeset viewer.