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

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

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

Legend:

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

    r21430 r21441  
    5858        // 常時ONにするとメモリが解放されない。 
    5959        // 連続クエリ実行時に問題が生じる。 
    60         if(DEBUG_MODE) { 
     60        if (DEBUG_MODE) { 
    6161            $options['debug'] = PEAR_DB_DEBUG; 
    6262        } else { 
     
    112112     */ 
    113113    function isError() { 
    114         if(PEAR::isError($this->conn)) { 
     114        if (PEAR::isError($this->conn)) { 
    115115            return true; 
    116116        } 
     
    247247        } 
    248248 
    249         while($data = $affected->fetchRow($fetchmode)) { 
     249        while ($data = $affected->fetchRow($fetchmode)) { 
    250250            $result = call_user_func($cbFunc, $data); 
    251             if($result === false) { 
     251            if ($result === false) { 
    252252                break; 
    253253            } 
     
    342342     */ 
    343343    function setLimitOffset($limit, $offset = 0) { 
    344         if (is_numeric($limit) && is_numeric($offset)){ 
     344        if (is_numeric($limit) && is_numeric($offset)) { 
    345345 
    346346            $option = " LIMIT " . $limit; 
     
    377377     */ 
    378378    function andWhere($str) { 
    379         if($this->where != "") { 
     379        if ($this->where != "") { 
    380380            $this->where .= " AND " . $str; 
    381381        } else { 
     
    394394     */ 
    395395    function orWhere($str) { 
    396         if($this->where != "") { 
     396        if ($this->where != "") { 
    397397            $this->where .= " OR " . $str; 
    398398        } else { 
     
    443443     */ 
    444444    function setLimit($limit){ 
    445         if ( is_numeric($limit)){ 
     445        if (is_numeric($limit)) { 
    446446            $this->option = " LIMIT " .$limit; 
    447447        } 
     
    458458     */ 
    459459    function setOffset($offset) { 
    460         if ( is_numeric($offset)){ 
     460        if (is_numeric($offset)) { 
    461461            $this->offset = " OFFSET " .$offset; 
    462462        } 
     
    482482        foreach ($sqlval as $key => $val) { 
    483483            $strcol .= $key . ','; 
    484             if(strcasecmp("Now()", $val) === 0) { 
     484            if (strcasecmp("Now()", $val) === 0) { 
    485485                $strval .= 'Now(),'; 
    486             } else if(strcasecmp('CURRENT_TIMESTAMP', $val) === 0) { 
     486            } else if (strcasecmp('CURRENT_TIMESTAMP', $val) === 0) { 
    487487                $strval .= 'CURRENT_TIMESTAMP,'; 
    488488            } else { 
     
    493493        } 
    494494 
    495         foreach($arrSql as $key => $val) { 
     495        foreach ($arrSql as $key => $val) { 
    496496            $strcol .= $key . ','; 
    497497            $strval .= $val . ','; 
     
    500500        $arrVal = array_merge($arrVal, $arrSqlVal); 
    501501 
    502         if(!$find) { 
     502        if (!$find) { 
    503503            return false; 
    504504        } 
     
    532532            if (strcasecmp("Now()", $val) === 0) { 
    533533                $arrCol[] = $key . '= Now()'; 
    534             } else if(strcasecmp('CURRENT_TIMESTAMP', $val) === 0) { 
     534            } else if (strcasecmp('CURRENT_TIMESTAMP', $val) === 0) { 
    535535                $arrCol[] = $key . '= CURRENT_TIMESTAMP'; 
    536536            } else { 
     
    542542 
    543543        if ($arrRawSql != "") { 
    544             foreach($arrRawSql as $key => $val) { 
     544            foreach ($arrRawSql as $key => $val) { 
    545545                $arrCol[] = "$key = $val"; 
    546546            } 
     
    719719     */ 
    720720    function delete($table, $where = "", $arrval = array()) { 
    721         if(strlen($where) <= 0) { 
     721        if (strlen($where) <= 0) { 
    722722            $sqlde = "DELETE FROM $table"; 
    723723        } else { 
     
    939939 
    940940        // 一定以上時間かかったSQLの場合、ログ出力する。 
    941         if(defined('SQL_QUERY_LOG_MODE') && SQL_QUERY_LOG_MODE == true) { 
     941        if (defined('SQL_QUERY_LOG_MODE') && SQL_QUERY_LOG_MODE == true) { 
    942942            $timeEnd = SC_Utils_Ex::sfMicrotimeFloat();; 
    943943            $timeExecTime = $timeEnd - $timeStart; 
    944             if(defined('SQL_QUERY_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float)SQL_QUERY_LOG_MIN_EXEC_TIME) { 
     944            if (defined('SQL_QUERY_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float)SQL_QUERY_LOG_MIN_EXEC_TIME) { 
    945945                $logMsg = sprintf("SQL_LOG [%.2fsec]\n%s", $timeExecTime, $sth->query) . "\n"; 
    946946                error_log($logMsg, 3, LOG_REALFILE); 
Note: See TracChangeset for help on using the changeset viewer.