Changeset 16678


Ignore:
Timestamp:
2007/11/04 22:05:25 (16 years ago)
Author:
naka
Message:

ディレクトリ再帰検索の改修

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/html/install/index.php

    r16635 r16678  
    4545// テンプレートコンパイルディレクトリの書込み権限チェック 
    4646$temp_dir = $INSTALL_DIR . '/temp'; 
    47 //$mode = lfGetFileMode($temp_dir); 
    4847 
    4948if(!is_writable($temp_dir)) { 
     
    401400    $err_file = false; 
    402401    foreach($arrWriteFile as $val) { 
    403  
     402        // listdirsの保持データを初期化 
     403        initdirs(); 
    404404        if (is_dir($val)) { 
    405             $arrDirs = listdirs($val); 
     405           $arrDirs = listdirs($val); 
    406406        } else { 
    407407            $arrDirs = array($val); 
    408408        } 
    409  
     409         
    410410        foreach ($arrDirs as $path) { 
    411411            if(file_exists($path)) { 
     
    415415                // ディレクトリの場合 
    416416                if(is_dir($path)) { 
    417                     if(is_writable($path)) { 
    418                         //$mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
    419                     } else { 
     417                    if(!is_writable($path)) { 
    420418                        $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(777, 707等)を付与して下さい。<br>"; 
    421419                        $err_file = true; 
    422420                    } 
    423421                } else { 
    424                     if(is_writable($path)) { 
    425                         //$mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
    426                     } else { 
     422                    if(!is_writable($path)) { 
    427423                        $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(666, 606等)を付与して下さい。<br>"; 
    428424                        $err_file = true; 
     
    10811077 * @see http://www.php.net/glob 
    10821078 */ 
     1079$alldirs = array(); 
    10831080function listdirs($dir) { 
    1084     static $alldirs = array(); 
     1081    global $alldirs; 
    10851082    $dirs = glob($dir . '/*'); 
    10861083    if (count($dirs) > 0) { 
     
    10901087    return $alldirs; 
    10911088} 
     1089 
     1090/** 
     1091 * 保持したスタティック変数をクリアする。 
     1092 */ 
     1093function initdirs() { 
     1094    global $alldirs; 
     1095    $alldirs = array(); 
     1096} 
     1097 
    10921098?> 
Note: See TracChangeset for help on using the changeset viewer.