Ignore:
Timestamp:
2012/02/27 17:39:02 (14 years ago)
Author:
h_yoshimoto
Message:

#1603 #1632 プラグイン仕様変更に伴う修正

File:
1 edited

Legend:

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

    r21552 r21555  
    21892189        SC_Utils_Ex::deleteFile(MOBILE_COMPILE_REALDIR, false); 
    21902190    } 
     2191     
     2192    /** 
     2193     * 指定されたパスの配下を再帰的にコピーします. 
     2194     * @param string $imageDir コピー元ディレクトリのパス  
     2195     * @param string $destDir コピー先ディレクトリのパス  
     2196     */ 
     2197    function copyDirectory($source_path, $dest_path) { 
     2198         
     2199        $handle=opendir($source_path);   
     2200        while($filename = readdir($handle)) { 
     2201            if($filename === '.' || $filename === '..') continue; 
     2202            $cur_path = $source_path . $filename; 
     2203            $dest_file_path = $dest_path . $filename; 
     2204            if(is_dir($cur_path)) { 
     2205                // ディレクトリの場合 
     2206                // コピー先に無いディレクトリの場合、ディレクトリ作成. 
     2207                if(!empty($filename) && !file_exists($dest_file_path)) mkdir($dest_file_path); 
     2208                SC_Utils_EX::copyDirectory($cur_path . '/', $dest_file_path . '/'); 
     2209            } else { 
     2210                if(file_exists($dest_file_path)) unlink($dest_file_path); 
     2211                copy($cur_path, $dest_file_path); 
     2212            } 
     2213        } 
     2214    } 
     2215 
    21912216} 
Note: See TracChangeset for help on using the changeset viewer.