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

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

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
Location:
branches/version-2_12-dev/html
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/html/admin/load_module_config.php

    r21420 r21441  
    3737$module_id = isset($_GET['module_id']) ? $_GET['module_id'] : null; 
    3838 
    39 if(!empty($module_id) && is_numeric($module_id)) { 
     39if (!empty($module_id) && is_numeric($module_id)) { 
    4040 
    4141    GC_Utils::gfPrintLog("loading module ====> module_id = " . $module_id); 
  • branches/version-2_12-dev/html/install/index.php

    r21420 r21441  
    3535require_once DATA_REALDIR . 'module/HTTP/Request.php'; 
    3636 
    37 if(!defined("ADMIN_DIR")){ 
     37if (!defined("ADMIN_DIR")) { 
    3838    define("ADMIN_DIR","admin/"); 
    3939} 
     
    5757$temp_dir = $ownDir . 'temp'; 
    5858 
    59 if(!is_writable($temp_dir)) { 
     59if (!is_writable($temp_dir)) { 
    6060    SC_Utils_Ex::sfErrorHeader($temp_dir . "にユーザ書込み権限(777, 707等)を付与して下さい。", true); 
    6161    exit; 
     
    7777$mode = isset($_POST['mode_overwrite']) ? $_POST['mode_overwrite'] : $_POST['mode']; 
    7878 
    79 switch($mode) { 
     79switch ($mode) { 
    8080// ようこそ 
    8181case 'welcome': 
     
    105105    //入力値のエラーチェック 
    106106    $objPage->arrErr = lfCheckWebError($objWebParam); 
    107     if(count($objPage->arrErr) == 0) { 
     107    if (count($objPage->arrErr) == 0) { 
    108108        $objPage = lfDispStep2($objPage); 
    109109    } else { 
     
    133133    $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name']; 
    134134 
    135     if(count($objPage->arrErr) == 0) { 
     135    if (count($objPage->arrErr) == 0) { 
    136136        // スキップする場合には次画面へ遷移 
    137137        $skip = $_POST["db_skip"]; 
     
    144144    // テーブルの作成 
    145145    $objPage->arrErr = lfExecuteSQL("./sql/create_table_".$arrRet['db_type'].".sql", $dsn); 
    146     if(count($objPage->arrErr) == 0) { 
     146    if (count($objPage->arrErr) == 0) { 
    147147        $objPage->tpl_message.="○:テーブルの作成に成功しました。<br />"; 
    148148    } else { 
     
    151151 
    152152    // 初期データの作成 
    153     if(count($objPage->arrErr) == 0) { 
     153    if (count($objPage->arrErr) == 0) { 
    154154        $objPage->arrErr = lfExecuteSQL("./sql/insert_data.sql", $dsn); 
    155         if(count($objPage->arrErr) == 0) { 
     155        if (count($objPage->arrErr) == 0) { 
    156156            $objPage->tpl_message.="○:初期データの作成に成功しました。<br />"; 
    157157        } else { 
     
    163163    if (count($objPage->arrErr) == 0) { 
    164164        $objPage->arrErr = lfCreateSequence(getSequences(), $dsn); 
    165         if(count($objPage->arrErr) == 0) { 
     165        if (count($objPage->arrErr) == 0) { 
    166166            $objPage->tpl_message.="○:シーケンスの作成に成功しました。<br />"; 
    167167        } else { 
     
    170170    } 
    171171 
    172     if(count($objPage->arrErr) == 0) { 
     172    if (count($objPage->arrErr) == 0) { 
    173173        $objPage = lfDispStep3($objPage); 
    174174        $objPage->tpl_mode = 'step4'; 
     
    191191 
    192192    // テーブルの削除 
    193     if(count($objPage->arrErr) == 0) { 
     193    if (count($objPage->arrErr) == 0) { 
    194194        $objPage->arrErr = lfExecuteSQL("./sql/drop_table.sql", $dsn, false); 
    195         if(count($objPage->arrErr) == 0) { 
     195        if (count($objPage->arrErr) == 0) { 
    196196            $objPage->tpl_message.="○:テーブルの削除に成功しました。<br />"; 
    197197        } else { 
     
    201201 
    202202    // シーケンスの削除 
    203     if(count($objPage->arrErr) == 0) { 
     203    if (count($objPage->arrErr) == 0) { 
    204204        $objPage->arrErr = lfDropSequence(getSequences(), $dsn); 
    205         if(count($objPage->arrErr) == 0) { 
     205        if (count($objPage->arrErr) == 0) { 
    206206            $objPage->tpl_message.="○:シーケンスの削除に成功しました。<br />"; 
    207207        } else { 
     
    218218    $objPage = lfDispComplete($objPage); 
    219219 
    220     if(isset($_POST['send_info']) && $_POST['send_info'] === 'true'){ 
     220    if (isset($_POST['send_info']) && $_POST['send_info'] === 'true') { 
    221221        // サイト情報を送信 
    222222        $req = new HTTP_Request("http://www.ec-cube.net/mall/use_site.php"); 
     
    224224 
    225225        $arrSendData = array(); 
    226         foreach($_POST as $key => $val){ 
    227             if (ereg("^senddata_*", $key)){ 
     226        foreach ($_POST as $key => $val) { 
     227            if (ereg("^senddata_*", $key)) { 
    228228                $arrSendDataTmp = array(str_replace("senddata_", "", $key) => $val); 
    229229                $arrSendData = array_merge($arrSendData, $arrSendDataTmp); 
     
    332332    $mess = ""; 
    333333    $hasErr = false; 
    334     foreach($arrWriteFile as $val) { 
     334    foreach ($arrWriteFile as $val) { 
    335335        // listdirsの保持データを初期化 
    336336        initdirs(); 
     
    342342 
    343343        foreach ($arrDirs as $path) { 
    344             if(file_exists($path)) { 
     344            if (file_exists($path)) { 
    345345                $filemode = lfGetFileMode($path); 
    346346                $real_path = realpath($path); 
    347347 
    348348                // ディレクトリの場合 
    349                 if(is_dir($path)) { 
    350                     if(!is_writable($path)) { 
     349                if (is_dir($path)) { 
     350                    if (!is_writable($path)) { 
    351351                        $mess.= ">> ×:$real_path($filemode) \nユーザ書込み権限(777, 707等)を付与して下さい。\n"; 
    352352                        $hasErr = true; 
     
    355355                    } 
    356356                } else { 
    357                     if(!is_writable($path)) { 
     357                    if (!is_writable($path)) { 
    358358                        $mess.= ">> ×:$real_path($filemode) \nユーザ書込み権限(666, 606等)を付与して下さい。\n"; 
    359359                        $hasErr = true; 
     
    388388        umask(0); 
    389389        $path = HTML_REALDIR . "upload/temp_template"; 
    390         if(!file_exists($path)) { 
     390        if (!file_exists($path)) { 
    391391            mkdir($path); 
    392392        } 
    393393        $path = HTML_REALDIR . "upload/save_image"; 
    394         if(!file_exists($path)) { 
     394        if (!file_exists($path)) { 
    395395            mkdir($path); 
    396396        } 
    397397        $path = HTML_REALDIR . "upload/temp_image"; 
    398         if(!file_exists($path)) { 
     398        if (!file_exists($path)) { 
    399399            mkdir($path); 
    400400        } 
    401401        $path = HTML_REALDIR . "upload/graph_image"; 
    402         if(!file_exists($path)) { 
     402        if (!file_exists($path)) { 
    403403            mkdir($path); 
    404404        } 
    405405        $path = HTML_REALDIR . "upload/mobile_image"; 
    406         if(!file_exists($path)) { 
     406        if (!file_exists($path)) { 
    407407            mkdir($path); 
    408408        } 
    409409        $path = DATA_REALDIR . "downloads/module"; 
    410         if(!file_exists($path)) { 
     410        if (!file_exists($path)) { 
    411411            mkdir($path); 
    412412        } 
    413413        $path = DATA_REALDIR . "downloads/update"; 
    414         if(!file_exists($path)) { 
     414        if (!file_exists($path)) { 
    415415            mkdir($path); 
    416416        } 
    417417        $path = DATA_REALDIR . "upload/csv"; 
    418         if(!file_exists($path)) { 
     418        if (!file_exists($path)) { 
    419419            mkdir($path); 
    420420        } 
     
    557557    $objQuery = new SC_Query($dsn); 
    558558    $cnt = $objQuery->count("dtb_baseinfo"); 
    559     if($cnt > 0) { 
     559    if ($cnt > 0) { 
    560560        $objQuery->update("dtb_baseinfo", $sqlval); 
    561561    } else { 
     
    610610    global $objDb; 
    611611 
    612     if(defined('HTTP_URL')) { 
     612    if (defined('HTTP_URL')) { 
    613613        $normal_url = HTTP_URL; 
    614614    } else { 
     
    617617    } 
    618618 
    619     if(defined('HTTPS_URL')) { 
     619    if (defined('HTTPS_URL')) { 
    620620        $secure_url = HTTPS_URL; 
    621621    } else { 
     
    625625 
    626626    // 店名、管理者メールアドレスを取得する。(再インストール時) 
    627     if(defined('DEFAULT_DSN')) { 
     627    if (defined('DEFAULT_DSN')) { 
    628628        $objQuery = new SC_Query(); 
    629629        $tables = $objQuery->listTables(); 
    630630 
    631         if(!PEAR::isError($tables) && in_array("dtb_baseinfo", $tables)) { 
     631        if (!PEAR::isError($tables) && in_array("dtb_baseinfo", $tables)) { 
    632632            $arrRet = $objQuery->select("shop_name, email01", "dtb_baseinfo"); 
    633633            $shop_name = $arrRet[0]['shop_name']; 
     
    673673function lfInitDBParam($objDBParam) { 
    674674 
    675     if(defined('DB_SERVER')) { 
     675    if (defined('DB_SERVER')) { 
    676676        $db_server = DB_SERVER; 
    677677    } else { 
     
    679679    } 
    680680 
    681     if(defined('DB_TYPE')) { 
     681    if (defined('DB_TYPE')) { 
    682682        $db_type = DB_TYPE; 
    683683    } else { 
     
    685685    } 
    686686 
    687     if(defined('DB_PORT')) { 
     687    if (defined('DB_PORT')) { 
    688688        $db_port = DB_PORT; 
    689689    } else { 
     
    691691    } 
    692692 
    693     if(defined('DB_NAME')) { 
     693    if (defined('DB_NAME')) { 
    694694        $db_name = DB_NAME; 
    695695    } else { 
     
    697697    } 
    698698 
    699     if(defined('DB_USER')) { 
     699    if (defined('DB_USER')) { 
    700700        $db_user = DB_USER; 
    701701    } else { 
     
    724724    $secure_dir = ereg_replace("^https?://[a-zA-Z0-9_~=&\?\.\-]+", "", $arrRet['secure_url']); 
    725725 
    726     if($normal_dir != $secure_dir) { 
     726    if ($normal_dir != $secure_dir) { 
    727727        $objErr->arrErr['normal_url'] = "※ URLに異なる階層を指定することはできません。"; 
    728728        $objErr->arrErr['secure_url'] = "※ URLに異なる階層を指定することはできません。"; 
     
    757757    $objErr->arrErr = $objFormParam->checkError(); 
    758758 
    759     if(count($objErr->arrErr) == 0) { 
     759    if (count($objErr->arrErr) == 0) { 
    760760        if (!defined("DB_TYPE")) { 
    761761            define("DB_TYPE", $arrRet['db_type']); 
     
    767767        $objDB = MDB2::connect($dsn, $options); 
    768768        // 接続成功 
    769         if(!PEAR::isError($objDB)) { 
     769        if (!PEAR::isError($objDB)) { 
    770770            $dbFactory = SC_DB_DBFactory_Ex::getInstance($arrRet['db_type']); 
    771771            // データベースバージョン情報の取得 
     
    786786    $arrErr = array(); 
    787787 
    788     if(!file_exists($filepath)) { 
     788    if (!file_exists($filepath)) { 
    789789        $arrErr['all'] = ">> スクリプトファイルが見つかりません"; 
    790790    } else { 
    791         if($fp = fopen($filepath,"r")) { 
     791        if ($fp = fopen($filepath,"r")) { 
    792792            $sql = fread($fp, filesize($filepath)); 
    793793            fclose($fp); 
     
    797797        $objDB = MDB2::connect($dsn, $options); 
    798798        // 接続エラー 
    799         if(!PEAR::isError($objDB)) { 
     799        if (!PEAR::isError($objDB)) { 
    800800            $objDB->setCharset("utf8"); 
    801801            $sql_split = split(";",$sql); 
    802             foreach($sql_split as $key => $val){ 
     802            foreach ($sql_split as $key => $val) { 
    803803                SC_Utils::sfFlush(true); 
    804804                if (trim($val) != "") { 
    805805                    $ret = $objDB->query($val); 
    806                     if(PEAR::isError($ret) && $disp_err) { 
     806                    if (PEAR::isError($ret) && $disp_err) { 
    807807                        $arrErr['all'] = ">> " . $ret->message . "<br />"; 
    808808                        // エラー文を取得する 
     
    930930 
    931931    //管理機能SSL制限 
    932     if($objWebParam->getValue('admin_force_ssl') == 1 and strpos($secure_url,"https://") !== FALSE){ 
     932    if ($objWebParam->getValue('admin_force_ssl') == 1 and strpos($secure_url,"https://") !== FALSE) { 
    933933        $force_ssl = "TRUE"; 
    934     }else{ 
     934    } else { 
    935935        $force_ssl = "FALSE"; 
    936936    } 
     
    938938    $allow_hosts = array(); 
    939939    $hosts = $objWebParam->getValue('admin_allow_hosts'); 
    940     if(!empty($hosts)){ 
     940    if (!empty($hosts)) { 
    941941        $hosts = str_replace("\r","",$hosts); 
    942         if(strpos($hosts,"\n") === false){ 
     942        if (strpos($hosts,"\n") === false) { 
    943943            $hosts .= "\n"; 
    944944        } 
    945945        $hosts = explode("\n",$hosts); 
    946         foreach($hosts as $key=>$host){ 
     946        foreach ($hosts as $key=>$host) { 
    947947            $host = trim($host); 
    948             if(strlen($host) >= 8) { 
     948            if (strlen($host) >= 8) { 
    949949                $allow_hosts[] = $host; 
    950950            } 
     
    953953    //パスワード暗号化方式決定 
    954954    $arrAlgos = hash_algos(); 
    955     if(array_search('sha256', $arrAlgos) !== FALSE) { 
     955    if (array_search('sha256', $arrAlgos) !== FALSE) { 
    956956        $algos = 'sha256'; 
    957957    }elseif(array_search('sha1', $arrAlgos) !== FALSE) { 
     
    959959    }elseif(array_search('md5', $arrAlgos) !== FALSE) { 
    960960        $algos = 'md5'; 
    961     }else{ 
     961    } else { 
    962962        $algos = ''; 
    963963    } 
  • branches/version-2_12-dev/html/test/upgrade/index.php

    r21420 r21441  
    5757); 
    5858 
    59 switch(getMode()) { 
     59switch (getMode()) { 
    6060 
    6161case 'products_list': 
  • branches/version-2_12-dev/html/user_data/packages/admin/js/ownersstore.js.php

    r20970 r21441  
    6767        //all others 
    6868        } else { 
    69             if(document.getElementById("TB_overlay") === null){ 
     69            if (document.getElementById("TB_overlay") === null) { 
    7070                $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>"); 
    7171                $("#TB_overlay").click(this.remove); 
     
    7373        } 
    7474 
    75         if(this.detectMacFF()){ 
     75        if (this.detectMacFF()) { 
    7676            //use png overlay so hide flash 
    7777            $("#TB_overlay").addClass("TB_overlayMacFFBGHack"); 
     
    101101        var ajaxContentH = TB_HEIGHT - 45; 
    102102 
    103         if ($("#TB_window").css("display") != "block"){ 
     103        if ($("#TB_window").css("display") != "block") { 
    104104            $("#TB_window").append( 
    105105                "<div id='TB_title'>" 
Note: See TracChangeset for help on using the changeset viewer.