Ignore:
Timestamp:
2012/02/06 11:05:15 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

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

    r21420 r21441  
    4040        if (!defined('ECCUBE_INSTALL')) { 
    4141            $phpself = $_SERVER['PHP_SELF']; 
    42             if( strpos('/install/', $phpself) === false ) { 
     42            if (strpos('/install/', $phpself) === false ) { 
    4343                $path = substr($phpself, 0, strpos($phpself, basename($phpself))); 
    4444                $install_url = SC_Utils_Ex::searchInstallerPath($path); 
     
    4848        } 
    4949        $path = HTML_REALDIR . 'install/' . DIR_INDEX_FILE; 
    50         if(file_exists($path)) { 
     50        if (file_exists($path)) { 
    5151            SC_Utils_Ex::sfErrorHeader('>> /install/' . DIR_INDEX_FILE . ' は、インストール完了後にファイルを削除してください。'); 
    5252        } 
     
    187187    function sfIsSuccess($objSess, $disp_error = true) { 
    188188        $ret = $objSess->IsSuccess(); 
    189         if($ret != SUCCESS) { 
    190             if($disp_error) { 
     189        if ($ret != SUCCESS) { 
     190            if ($disp_error) { 
    191191                // エラーページの表示 
    192192                SC_Utils_Ex::sfDispError($ret); 
     
    197197        // 「リファラ無」 の場合はスルー 
    198198        // 「リファラ有」 かつ 「管理画面からの遷移でない」 場合にエラー画面を表示する 
    199         if ( empty($_SERVER['HTTP_REFERER']) ) { 
     199        if (empty($_SERVER['HTTP_REFERER']) ) { 
    200200            // TODO 警告表示させる? 
    201201            // sfErrorHeader('>> referrerが無効になっています。'); 
     
    222222    function sfPassLen($passlen){ 
    223223        $ret = ""; 
    224         for ($i=0;$i<$passlen;true){ 
     224        for ($i=0;$i<$passlen;true) { 
    225225            $ret.="*"; 
    226226            $i++; 
     
    253253        // 前画面からPOSTされるuniqidが正しいものかどうかをチェック 
    254254        $uniqid = $objSess->getUniqId(); 
    255         if ( !empty($_POST['uniqid']) && ($_POST['uniqid'] === $uniqid) ) { 
     255        if (!empty($_POST['uniqid']) && ($_POST['uniqid'] === $uniqid) ) { 
    256256            return true; 
    257257        } else { 
     
    262262    /* DB用日付文字列取得 */ 
    263263    function sfGetTimestamp($year, $month, $day, $last = false) { 
    264         if($year != "" && $month != "" && $day != "") { 
    265             if($last) { 
     264        if ($year != "" && $month != "" && $day != "") { 
     265            if ($last) { 
    266266                $time = "23:59:59"; 
    267267            } else { 
     
    304304 
    305305    function sfGetCSVData($data, $prefix = ""){ 
    306         if($prefix == "") { 
     306        if ($prefix == "") { 
    307307            $dir_name = SC_Utils_Ex::sfUpDirName(); 
    308308            $file_name = $dir_name . date('ymdHis') .".csv"; 
     
    311311        } 
    312312 
    313         if (mb_internal_encoding() == CHAR_CODE){ 
     313        if (mb_internal_encoding() == CHAR_CODE) { 
    314314            $data = mb_convert_encoding($data,'SJIS-Win',CHAR_CODE); 
    315315        } 
     
    334334        $conv = ""; 
    335335        $cnt = 1; 
    336         for($cnt = 1; $cnt <= $max; $cnt++) { 
     336        for ($cnt = 1; $cnt <= $max; $cnt++) { 
    337337            if ($_POST[$keyname . $cnt] == "1") { 
    338338                $conv.= "1"; 
     
    350350    function sfMergeCheckBoxes($array, $max) { 
    351351        $ret = ""; 
    352         if(is_array($array)) { 
    353             foreach($array as $val) { 
     352        if (is_array($array)) { 
     353            foreach ($array as $val) { 
    354354                $arrTmp[$val] = "1"; 
    355355            } 
    356356        } 
    357         for($i = 1; $i <= $max; $i++) { 
    358             if(isset($arrTmp[$i]) && $arrTmp[$i] == "1") { 
     357        for ($i = 1; $i <= $max; $i++) { 
     358            if (isset($arrTmp[$i]) && $arrTmp[$i] == "1") { 
    359359                $ret.= "1"; 
    360360            } else { 
     
    371371    function sfMergeParamCheckBoxes($array) { 
    372372        $ret = ''; 
    373         if(is_array($array)) { 
    374             foreach($array as $val) { 
    375                 if($ret != "") { 
     373        if (is_array($array)) { 
     374            foreach ($array as $val) { 
     375                if ($ret != "") { 
    376376                    $ret.= "-$val"; 
    377377                } else { 
     
    408408        $arrRet = array(); 
    409409        $len = strlen($val); 
    410         for($i = 0; $i < $len; $i++) { 
    411             if(substr($val, $i, 1) == "1") { 
     410        for ($i = 0; $i < $len; $i++) { 
     411            if (substr($val, $i, 1) == "1") { 
    412412                $arrRet[] = ($i + 1); 
    413413            } 
     
    423423        $conv = ""; 
    424424        $cnt = 1; 
    425         for($cnt = 1; $cnt <= $max; $cnt++) { 
     425        for ($cnt = 1; $cnt <= $max; $cnt++) { 
    426426            if ($_POST[$keyname . $cnt] == "1") { 
    427427                $conv.= "1"; 
     
    442442        $no = 1; 
    443443        for ($cnt = 0; $cnt < $len; $cnt++) { 
    444             if($keyname != "") { 
     444            if ($keyname != "") { 
    445445                $arr[$keyname . $no] = substr($val, $cnt, 1); 
    446446            } else { 
     
    457457        $max = count($arrList); 
    458458 
    459         if($len_max != "" && $max > $len_max) { 
     459        if ($len_max != "" && $max > $len_max) { 
    460460            $max = $len_max; 
    461461        } 
    462462 
    463         for($cnt = 0; $cnt < $max; $cnt++) { 
    464             if($keysize != "") { 
     463        for ($cnt = 0; $cnt < $max; $cnt++) { 
     464            if ($keysize != "") { 
    465465                $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 
    466466            } else { 
     
    469469            $val = $arrList[$cnt][$valname]; 
    470470 
    471             if(!isset($arrRet[$key])) { 
     471            if (!isset($arrRet[$key])) { 
    472472                $arrRet[$key] = $val; 
    473473            } 
     
    482482        $max = count($arrList); 
    483483 
    484         if($len_max != "" && $max > $len_max) { 
     484        if ($len_max != "" && $max > $len_max) { 
    485485            $max = $len_max; 
    486486        } 
    487487 
    488         for($cnt = 0; $cnt < $max; $cnt++) { 
    489             if($keysize != "") { 
     488        for ($cnt = 0; $cnt < $max; $cnt++) { 
     489            if ($keysize != "") { 
    490490                $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 
    491491            } else { 
     
    494494            $val = $arrList[$cnt][$valname]; 
    495495 
    496             if($connect != "") { 
     496            if ($connect != "") { 
    497497                $arrRet[$key].= "$val".$connect; 
    498498            } else { 
     
    507507        if (count($array) > 0) { 
    508508            $line = ""; 
    509             foreach($array as $val) { 
     509            foreach ($array as $val) { 
    510510                if (!in_array($val, $arrPop)) { 
    511511                    if ($space) { 
     
    532532        $line = ""; 
    533533        if (count($array) > 0) { 
    534             foreach($array as $key => $val) { 
     534            foreach ($array as $key => $val) { 
    535535                $val = mb_convert_encoding($val, CHAR_CODE, CHAR_CODE); 
    536536                $line .= "\"".$val."\","; 
    537537            } 
    538538            $line = ereg_replace(",$", "\r\n", $line); 
    539         }else{ 
     539        } else { 
    540540            return false; 
    541541        } 
     
    556556        // 期間指定 
    557557        $error = 0; 
    558         if ( $start_month || $start_day || $start_year){ 
     558        if ($start_month || $start_day || $start_year) { 
    559559            if ( ! checkdate($start_month, $start_day , $start_year) ) $error = 1; 
    560560        } else { 
    561561            $error = 1; 
    562562        } 
    563         if ( $end_month || $end_day || $end_year){ 
     563        if ($end_month || $end_day || $end_year) { 
    564564            if ( ! checkdate($end_month ,$end_day ,$end_year) ) $error = 2; 
    565565        } 
    566         if ( ! $error ){ 
     566        if (! $error ) { 
    567567            $date1 = $start_year ."/".sprintf("%02d",$start_month) ."/".sprintf("%02d",$start_day) ." 000000"; 
    568568            $date2 = $end_year   ."/".sprintf("%02d",$end_month)   ."/".sprintf("%02d",$end_day)   ." 235959"; 
     
    581581    // 一致した値のキー名を取得 
    582582    function sfSearchKey($array, $word, $default) { 
    583         foreach($array as $key => $val) { 
    584             if($val == $word) { 
     583        foreach ($array as $key => $val) { 
     584            if ($val == $word) { 
    585585                return $key; 
    586586            } 
     
    590590 
    591591    function sfGetErrorColor($val) { 
    592         if($val != "") { 
     592        if ($val != "") { 
    593593            return "background-color:" . ERR_COLOR; 
    594594        } 
     
    597597 
    598598    function sfGetEnabled($val) { 
    599         if( ! $val ) { 
     599        if (! $val ) { 
    600600            return " disabled=\"disabled\""; 
    601601        } 
     
    630630        $real_tax = $tax / 100; 
    631631        $ret = $price * $real_tax; 
    632         switch($tax_rule) { 
     632        switch ($tax_rule) { 
    633633        // 四捨五入 
    634634        case 1: 
     
    671671 
    672672        // 整数且つ0出なければ桁数指定を行う 
    673         if(SC_Utils_Ex::sfIsInt($adjust) and $pow > 1){ 
     673        if (SC_Utils_Ex::sfIsInt($adjust) and $pow > 1) { 
    674674            $ret = (round($value * $adjust)/$adjust); 
    675675        } 
     
    684684        $real_point = $point_rate / 100; 
    685685        $ret = $price * $real_point; 
    686         switch($rule) { 
     686        switch ($rule) { 
    687687        // 四捨五入 
    688688        case 1: 
     
    736736        list($y, $m, $d, $H, $M) = preg_split("/[- :]/", $dbdate); 
    737737 
    738         if(strlen($y) > 0 && strlen($m) > 0 && strlen($d) > 0) { 
     738        if (strlen($y) > 0 && strlen($m) > 0 && strlen($d) > 0) { 
    739739            if ($time) { 
    740740                $str = sprintf("%04d/%02d/%02d %02d:%02d", $y, $m, $d, $H, $M); 
     
    751751    function sfSwapArray($array, $isColumnName = true) { 
    752752        $arrRet = array(); 
    753         foreach($array as $key1 => $arr1) { 
     753        foreach ($array as $key1 => $arr1) { 
    754754            $index = 0; 
    755             foreach($arr1 as $key2 => $val) { 
     755            foreach ($arr1 as $key2 => $val) { 
    756756                if ($isColumnName) { 
    757757                    $arrRet[$key2][$key1] = $val; 
     
    809809        $add_point = $totalpoint - intval($use_point * ($point_rate / 100)); 
    810810 
    811         if($add_point < 0) { 
     811        if ($add_point < 0) { 
    812812            $add_point = '0'; 
    813813        } 
     
    831831        $ret = ""; 
    832832 
    833         while($str[$i] != "") { 
     833        while ($str[$i] != "") { 
    834834            $line[$cnt].=$str[$i]; 
    835835            $i++; 
    836             if(strlen($line[$cnt]) > $size) { 
     836            if (strlen($line[$cnt]) > $size) { 
    837837                $line[$cnt].="<br />"; 
    838838                $cnt++; 
     
    840840        } 
    841841 
    842         foreach($line as $val) { 
     842        foreach ($line as $val) { 
    843843            $ret.=$val; 
    844844        } 
     
    848848    // 二回以上繰り返されているスラッシュ[/]を一つに変換する。 
    849849    function sfRmDupSlash($istr){ 
    850         if(ereg("^http://", $istr)) { 
     850        if (ereg("^http://", $istr)) { 
    851851            $str = substr($istr, 7); 
    852852            $head = "http://"; 
    853         } else if(ereg("^https://", $istr)) { 
     853        } else if (ereg("^https://", $istr)) { 
    854854            $str = substr($istr, 8); 
    855855            $head = "https://"; 
     
    890890            $ofp = fopen($outpath, "w+"); 
    891891 
    892             while(!feof($ifp)) { 
     892            while (!feof($ifp)) { 
    893893                $line = fgets($ifp); 
    894894                $line = mb_convert_encoding($line, $enc_type, 'auto'); 
     
    908908 
    909909    function sfCutString($str, $len, $byte = true, $commadisp = true) { 
    910         if($byte) { 
    911             if(strlen($str) > ($len + 2)) { 
     910        if ($byte) { 
     911            if (strlen($str) > ($len + 2)) { 
    912912                $ret =substr($str, 0, $len); 
    913913                $cut = substr($str, $len); 
     
    917917            } 
    918918        } else { 
    919             if(mb_strlen($str) > ($len + 1)) { 
     919            if (mb_strlen($str) > ($len + 1)) { 
    920920                $ret = mb_substr($str, 0, $len); 
    921921                $cut = mb_substr($str, $len); 
     
    948948        } 
    949949 
    950         if($commadisp){ 
     950        if ($commadisp) { 
    951951            $ret = $ret . "..."; 
    952952        } 
     
    966966 
    967967        // 月の末日が締め日より少ない場合 
    968         if($end_last_day < $close_day) { 
     968        if ($end_last_day < $close_day) { 
    969969            // 締め日を月末日に合わせる 
    970970            $end_day = $end_last_day; 
     
    10011001    // 再帰的に多段配列を検索して一次元配列(Hidden引渡し用配列)に変換する。 
    10021002    function sfMakeHiddenArray($arrSrc, $arrDst = array(), $parent_key = "") { 
    1003         if(is_array($arrSrc)) { 
    1004             foreach($arrSrc as $key => $val) { 
    1005                 if($parent_key != "") { 
     1003        if (is_array($arrSrc)) { 
     1004            foreach ($arrSrc as $key => $val) { 
     1005                if ($parent_key != "") { 
    10061006                    $keyname = $parent_key . "[". $key . "]"; 
    10071007                } else { 
    10081008                    $keyname = $key; 
    10091009                } 
    1010                 if(is_array($val)) { 
     1010                if (is_array($val)) { 
    10111011                    $arrDst = SC_Utils_Ex::sfMakeHiddenArray($val, $arrDst, $keyname); 
    10121012                } else { 
     
    10401040        $max = max( count( $keys ), count( $vals ) ); 
    10411041        $combine_ary = array(); 
    1042         for($i=0; $i<$max; $i++) { 
     1042        for ($i=0; $i<$max; $i++) { 
    10431043            $combine_ary[$keys[$i]] = $vals[$i]; 
    10441044        } 
     
    10531053 
    10541054        $arrBrothers = array(); 
    1055         foreach($arrPID as $id) { 
     1055        foreach ($arrPID as $id) { 
    10561056            // 親IDを検索する 
    1057             for($i = 0; $i < $max; $i++) { 
    1058                 if($arrData[$i][$id_name] == $id) { 
     1057            for ($i = 0; $i < $max; $i++) { 
     1058                if ($arrData[$i][$id_name] == $id) { 
    10591059                    $parent = $arrData[$i][$pid_name]; 
    10601060                    break; 
     
    10621062            } 
    10631063            // 兄弟IDを検索する 
    1064             for($i = 0; $i < $max; $i++) { 
    1065                 if($arrData[$i][$pid_name] == $parent) { 
     1064            for ($i = 0; $i < $max; $i++) { 
     1065                if ($arrData[$i][$pid_name] == $parent) { 
    10661066                    $arrBrothers[] = $arrData[$i][$id_name]; 
    10671067                } 
     
    10771077        $arrChildren = array(); 
    10781078        // 子IDを検索する 
    1079         for($i = 0; $i < $max; $i++) { 
    1080             if($arrData[$i][$pid_name] == $parent) { 
     1079        for ($i = 0; $i < $max; $i++) { 
     1080            if ($arrData[$i][$pid_name] == $parent) { 
    10811081                $arrChildren[] = $arrData[$i][$id_name]; 
    10821082            } 
     
    11071107        $count++;  // 無限ループ回避 
    11081108        $dir = dirname($path); 
    1109         if(ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) { 
     1109        if (ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) { 
    11101110            // ルートディレクトリで終了 
    11111111            return; 
    11121112        } else { 
    1113             if(is_writable(dirname($dir))) { 
    1114                 if(!file_exists($dir)) { 
     1113            if (is_writable(dirname($dir))) { 
     1114                if (!file_exists($dir)) { 
    11151115                    mkdir($dir); 
    11161116                    GC_Utils_Ex::gfPrintLog("mkdir $dir"); 
     
    11181118            } else { 
    11191119                SC_Utils_Ex::sfMakeDir($dir); 
    1120                 if(is_writable(dirname($dir))) { 
    1121                     if(!file_exists($dir)) { 
     1120                if (is_writable(dirname($dir))) { 
     1121                    if (!file_exists($dir)) { 
    11221122                        mkdir($dir); 
    11231123                        GC_Utils_Ex::gfPrintLog("mkdir $dir"); 
     
    11311131    // ディレクトリ以下のファイルを再帰的にコピー 
    11321132    function sfCopyDir($src, $des, $mess = "", $override = false){ 
    1133         if(!is_dir($src)){ 
     1133        if (!is_dir($src)) { 
    11341134            return false; 
    11351135        } 
     
    11391139 
    11401140        // ディレクトリがなければ作成する 
    1141         if(!file_exists($des)) { 
    1142             if(!mkdir($des, $mod[2])) { 
     1141        if (!file_exists($des)) { 
     1142            if (!mkdir($des, $mod[2])) { 
    11431143                echo 'path:' . $des; 
    11441144            } 
     
    11471147        $fileArray=glob( $src."*" ); 
    11481148        if (is_array($fileArray)) { 
    1149             foreach( $fileArray as $key => $data_ ){ 
     1149            foreach ($fileArray as $key => $data_ ) { 
    11501150                // CVS管理ファイルはコピーしない 
    1151                 if(ereg("/CVS/Entries", $data_)) { 
     1151                if (ereg("/CVS/Entries", $data_)) { 
    11521152                    break; 
    11531153                } 
    1154                 if(ereg("/CVS/Repository", $data_)) { 
     1154                if (ereg("/CVS/Repository", $data_)) { 
    11551155                    break; 
    11561156                } 
    1157                 if(ereg("/CVS/Root", $data_)) { 
     1157                if (ereg("/CVS/Root", $data_)) { 
    11581158                    break; 
    11591159                } 
     
    11611161                mb_ereg("^(.*[\/])(.*)",$data_, $matches); 
    11621162                $data=$matches[2]; 
    1163                 if( is_dir( $data_ ) ){ 
     1163                if (is_dir( $data_ ) ) { 
    11641164                    $mess = SC_Utils_Ex::sfCopyDir( $data_.'/', $des.$data.'/', $mess); 
    1165                 }else{ 
    1166                     if(!$override && file_exists($des.$data)) { 
     1165                } else { 
     1166                    if (!$override && file_exists($des.$data)) { 
    11671167                        $mess.= $des.$data . ":ファイルが存在します\n"; 
    11681168                    } else { 
    1169                         if(@copy( $data_, $des.$data)) { 
     1169                        if (@copy( $data_, $des.$data)) { 
    11701170                            $mess.= $des.$data . ":コピー成功\n"; 
    11711171                        } else { 
     
    11831183    // 指定したフォルダ内のファイルを全て削除する 
    11841184    function sfDelFile($dir){ 
    1185         if(file_exists($dir)) { 
     1185        if (file_exists($dir)) { 
    11861186            $dh = opendir($dir); 
    11871187            // フォルダ内のファイルを削除 
    1188             while($file = readdir($dh)){ 
     1188            while ($file = readdir($dh)) { 
    11891189                if ($file == "." or $file == "..") continue; 
    11901190                $del_file = $dir . "/" . $file; 
    1191                 if(is_file($del_file)){ 
     1191                if (is_file($del_file)) { 
    11921192                    $ret = unlink($dir . "/" . $file); 
    1193                 }else if (is_dir($del_file)){ 
     1193                }else if (is_dir($del_file)) { 
    11941194                    $ret = SC_Utils_Ex::sfDelFile($del_file); 
    11951195                } 
    11961196 
    1197                 if(!$ret){ 
     1197                if (!$ret) { 
    11981198                    return $ret; 
    11991199                } 
     
    12321232        fclose ($file); 
    12331233        // 権限を指定 
    1234         if($permission != "") { 
     1234        if ($permission != "") { 
    12351235            chmod($path, $permission); 
    12361236        } 
     
    12681268    // @versionの記載があるファイルからバージョンを取得する。 
    12691269    function sfGetFileVersion($path) { 
    1270         if(file_exists($path)) { 
     1270        if (file_exists($path)) { 
    12711271            $src_fp = fopen($path, 'rb'); 
    1272             if($src_fp) { 
     1272            if ($src_fp) { 
    12731273                while (!feof($src_fp)) { 
    12741274                    $line = fgets($src_fp); 
    1275                     if(ereg("@version", $line)) { 
     1275                    if (ereg("@version", $line)) { 
    12761276                        $arrLine = explode(" ", $line); 
    12771277                        $version = $arrLine[5]; 
     
    12941294    function mbConvertKanaWithArray($array, $arrConvList) { 
    12951295        foreach ($arrConvList as $key => $val) { 
    1296             if(isset($array[$key])) { 
     1296            if (isset($array[$key])) { 
    12971297                $array[$key] = mb_convert_kana($array[$key] ,$val); 
    12981298            } 
     
    13631363                // アルファベットと数字でソート 
    13641364                natcasesort($arrDir); 
    1365                 foreach($arrDir as $file) { 
     1365                foreach ($arrDir as $file) { 
    13661366                    // ./ と ../を除くファイルのみを取得 
    1367                     if($file != "." && $file != "..") { 
     1367                    if ($file != "." && $file != "..") { 
    13681368 
    13691369                        $path = $dir."/".$file; 
     
    13741374 
    13751375                        // ディレクトリとファイルで格納配列を変える 
    1376                         if(is_dir($path)) { 
     1376                        if (is_dir($path)) { 
    13771377                            $arrDirList[$cnt]['file_name'] = $file; 
    13781378                            $arrDirList[$cnt]['file_path'] = $path; 
     
    14041404     */ 
    14051405    function sfGetDirSize($dir) { 
    1406         if(file_exists($dir)) { 
     1406        if (file_exists($dir)) { 
    14071407            // ディレクトリの場合下層ファイルの総量を取得 
    14081408            if (is_dir($dir)) { 
     
    14451445        $dir = ereg_replace("/$", "", $dir); 
    14461446        // 最上位層を格納(user_data/) 
    1447         if(sfDirChildExists($dir)) { 
     1447        if (sfDirChildExists($dir)) { 
    14481448            $arrTree[$cnt]['type'] = "_parent"; 
    14491449        } else { 
     
    14541454        $arrTree[$cnt]['count'] = $cnt; 
    14551455        // 初期表示はオープン 
    1456         if($_POST['mode'] != '') { 
     1456        if ($_POST['mode'] != '') { 
    14571457            $arrTree[$cnt]['open'] = lfIsFileOpen($dir, $tree_status); 
    14581458        } else { 
     
    14761476    function sfGetFileTreeSub($dir, $default_rank, &$cnt, &$arrTree, $tree_status) { 
    14771477 
    1478         if(file_exists($dir)) { 
     1478        if (file_exists($dir)) { 
    14791479            if ($handle = opendir("$dir")) { 
    14801480                while (false !== ($item = readdir($handle))) $arrDir[] = $item; 
    14811481                // アルファベットと数字でソート 
    14821482                natcasesort($arrDir); 
    1483                 foreach($arrDir as $item) { 
     1483                foreach ($arrDir as $item) { 
    14841484                    if ($item != "." && $item != "..") { 
    14851485                        // 文末の/を取り除く 
     
    14891489                        if (is_dir($path)) { 
    14901490                            $arrTree[$cnt]['path'] = $path; 
    1491                             if(sfDirChildExists($path)) { 
     1491                            if (sfDirChildExists($path)) { 
    14921492                                $arrTree[$cnt]['type'] = "_parent"; 
    14931493                            } else { 
     
    15191519     */ 
    15201520    function sfDirChildExists($dir) { 
    1521         if(file_exists($dir)) { 
     1521        if (file_exists($dir)) { 
    15221522            if (is_dir($dir)) { 
    15231523                $handle = opendir($dir); 
     
    15441544    function lfIsFileOpen($dir, $tree_status) { 
    15451545        $arrTreeStatus = explode('\|', $tree_status); 
    1546         if(in_array($dir, $arrTreeStatus)) { 
     1546        if (in_array($dir, $arrTreeStatus)) { 
    15471547            return true; 
    15481548        } 
     
    15731573    function sfCreateFile($file, $mode = "") { 
    15741574        // 行末の/を取り除く 
    1575         if($mode != "") { 
     1575        if ($mode != "") { 
    15761576            $ret = @mkdir($file, $mode); 
    15771577        } else { 
     
    15921592        $fp = @fopen($filename, 'rb' ); 
    15931593        //ファイル内容を全て変数に読み込む 
    1594         if($fp) { 
     1594        if ($fp) { 
    15951595            $str = @fread($fp, filesize($filename)+1); 
    15961596        } 
     
    16061606     */ 
    16071607    function getCSVData($array, $arrayIndex) { 
    1608         for ($i = 0; $i < count($array); $i++){ 
     1608        for ($i = 0; $i < count($array); $i++) { 
    16091609            // インデックスが設定されている場合 
    1610             if (is_array($arrayIndex) && 0 < count($arrayIndex)){ 
    1611                 for ($j = 0; $j < count($arrayIndex); $j++ ){ 
     1610            if (is_array($arrayIndex) && 0 < count($arrayIndex)) { 
     1611                for ($j = 0; $j < count($arrayIndex); $j++ ) { 
    16121612                    if ( $j > 0 ) $return .= ","; 
    16131613                    $return .= "\""; 
     
    16151615                } 
    16161616            } else { 
    1617                 for ($j = 0; $j < count($array[$i]); $j++ ){ 
     1617                for ($j = 0; $j < count($array[$i]); $j++ ) { 
    16181618                    if ( $j > 0 ) $return .= ","; 
    16191619                    $return .= "\""; 
     
    16341634        $html = "<table>"; 
    16351635        $html.= "<tr>"; 
    1636         foreach($array[0] as $key => $val) { 
     1636        foreach ($array[0] as $key => $val) { 
    16371637            $html.="<th>$key</th>"; 
    16381638        } 
     
    16411641        $cnt = count($array); 
    16421642 
    1643         for($i = 0; $i < $cnt; $i++) { 
     1643        for ($i = 0; $i < $cnt; $i++) { 
    16441644            $html.= "<tr>"; 
    1645             foreach($array[$i] as $val) { 
     1645            foreach ($array[$i] as $val) { 
    16461646                $html.="<td>$val</td>"; 
    16471647            } 
     
    19891989            $salt = AUTH_MAGIC; 
    19901990        } 
    1991         if ( AUTH_TYPE == 'PLAIN') { 
     1991        if (AUTH_TYPE == 'PLAIN') { 
    19921992            $res = $str; 
    19931993        } else { 
     
    20092009        if ($hashpass != '') { 
    20102010            if (AUTH_TYPE == 'PLAIN') { 
    2011                 if($pass === $hashpass) { 
     2011                if ($pass === $hashpass) { 
    20122012                    $res = true; 
    20132013                } 
     
    20192019                    $hash = SC_Utils_Ex::sfGetHashString($pass, $salt); 
    20202020                } 
    2021                 if($hash === $hashpass) { 
     2021                if ($hash === $hashpass) { 
    20222022                    $res = true; 
    20232023                } 
Note: See TracChangeset for help on using the changeset viewer.