Changeset 16506


Ignore:
Timestamp:
2007/10/19 16:27:45 (16 years ago)
Author:
nanasess
Message:

リファクタリング

Location:
branches/feature-module-update
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/db/SC_DB_DBFactory.php

    r15693 r16506  
    3535 
    3636        default: 
     37            return new SC_DB_DBFactory(); 
    3738        } 
    3839    } 
     
    5354                $dsn = DEFAULT_DSN; 
    5455            } else { 
    55                 return; 
     56                return ""; 
    5657            } 
    5758        } 
  • branches/feature-module-update/html/install/index.php

    r16313 r16506  
    3232 
    3333if(!is_writable($temp_dir)) { 
    34     SC_Utils_Ex::sfErrorHeader($temp_dir . "にユーザ書込み権限(777等)を付与して下さい。", true); 
     34    SC_Utils_Ex::sfErrorHeader($temp_dir . "にユーザ書込み権限(777, 707等)を付与して下さい。", true); 
    3535    exit; 
    3636} 
     
    374374        "../cp", 
    375375        "../upload", 
    376         ".." . HTML2DATA_DIR . "Smarty/templates_c", 
    377         ".." . HTML2DATA_DIR . "conf/cache", 
    378         ".." . HTML2DATA_DIR . "downloads", 
    379         ".." . HTML2DATA_DIR . "logs" 
     376        ".." . HTML2DATA_DIR . "cache/", 
     377        ".." . HTML2DATA_DIR . "class/", 
     378        ".." . HTML2DATA_DIR . "Smarty/", 
     379        ".." . HTML2DATA_DIR . "downloads/" 
    380380    ); 
    381381 
     
    383383    $err_file = false; 
    384384    foreach($arrWriteFile as $val) { 
    385         if(file_exists($val)) { 
    386             $mode = lfGetFileMode($val); 
    387             $real_path = realpath($val); 
    388  
    389             // ディレクトリの場合 
    390             if(is_dir($val)) { 
    391                 if(is_writable($val)) { 
    392                     $mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
     385 
     386        $arrDirs = listdirs($val); 
     387        foreach ($arrDirs as $path) { 
     388            if(file_exists($path)) { 
     389                $mode = lfGetFileMode($path); 
     390                $real_path = realpath($path); 
     391 
     392                // ディレクトリの場合 
     393                if(is_dir($path)) { 
     394                    if(is_writable($path)) { 
     395                        //$mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
     396                    } else { 
     397                        $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(777, 707等)を付与して下さい。<br>"; 
     398                        $err_file = true; 
     399                    } 
    393400                } else { 
    394                     $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(777等)を付与して下さい。<br>"; 
    395                     $err_file = true; 
     401                    if(is_writable($path)) { 
     402                        //$mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
     403                    } else { 
     404                        $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(666, 606等)を付与して下さい。<br>"; 
     405                        $err_file = true; 
     406                    } 
    396407                } 
    397408            } else { 
    398                 if(is_writable($val)) { 
    399                     $mess.= ">> ○:$real_path($mode) <br>アクセス権限は正常です。<br>"; 
    400                 } else { 
    401                     $mess.= ">> ×:$real_path($mode) <br>ユーザ書込み権限(666等)を付与して下さい。<br>"; 
    402                     $err_file = true; 
    403                 } 
     409                $mess.= ">> ×:$path が見つかりません。<br>"; 
     410                $err_file = true; 
    404411            } 
    405         } else { 
    406             $mess.= ">> ×:$val が見つかりません。<br>"; 
    407             $err_file = true; 
    408412        } 
    409413    } 
     
    451455            mkdir($path); 
    452456        } 
     457        $mess.= ">> ○:アクセス権限は正常です。<br>"; 
    453458    } 
    454459 
     
    10451050    $objDb->sfDataExists("dtb_csv", "csv_id = ? AND col = ?", array($csv_id, $col), $dsn, $sql, true); 
    10461051} 
     1052 
     1053/** 
     1054 * $dir を再帰的に辿ってパス名を配列で返す. 
     1055 * 
     1056 * @param string 任意のパス名 
     1057 * @return array $dir より下層に存在するパス名の配列 
     1058 * @see http://www.php.net/glob 
     1059 */ 
     1060function listdirs($dir) { 
     1061    static $alldirs = array(); 
     1062    $dirs = glob($dir . '/*'); 
     1063    if (count($dirs) > 0) { 
     1064        foreach ($dirs as $d) $alldirs[] = $d; 
     1065    } 
     1066    foreach ($dirs as $dir) listdirs($dir); 
     1067    return $alldirs; 
     1068} 
    10471069?> 
  • branches/feature-module-update/html/install/sql/insert_data.sql

    r16502 r16506  
    718718INSERT INTO mtb_constants VALUES ('USER_PATH','HTML_PATH . USER_DIR',4,'ユーザファイル保存先'); 
    719719INSERT INTO mtb_constants VALUES ('USER_INC_PATH','USER_PATH . "include/"',5,'ユーザインクルードファイル保存先'); 
     720INSERT INTO mtb_constants VALUES ('DB_ERROR_MAIL_TO','"error-ml@lockon.co.jp"',6,' 
     721DBエラーメール送信先'); 
     722INSERT INTO mtb_constants VALUES ('DB_ERROR_MAIL_SUBJECT','"OS_TEST_ERROR"',7,'DBエラーメール件名'); 
     723INSERT INTO mtb_constants VALUES ('ZIP_DSN','DEFAULT_DSN',8,'郵便番号専用DB'); 
     724INSERT INTO mtb_constants VALUES ('USER_URL','SITE_URL . USER_DIR',9,'ユーザー作成ページ等'); 
     725INSERT INTO mtb_constants VALUES ('AUTH_MAGIC','"31eafcbd7a81d7b401a7fdc12bba047c02d1fae6"',10,'認証用 magic'); 
    720726INSERT INTO mtb_constants VALUES ('USER_TEMPLATE_DIR','"templates/"',17,'テンプレートファイル保存先'); 
    721727INSERT INTO mtb_constants VALUES ('USER_TEMPLATE_PATH','USER_PATH . USER_TEMPLATE_DIR',18,'テンプレートファイル保存先'); 
  • branches/feature-module-update/html/mobile/require.php

    r16503 r16506  
    1919} 
    2020 
    21 require_once($include_dir . "/.." . HTML2DATA_DIR . "conf/conf.php"); 
    22 require_once($include_dir . "/.." . HTML2DATA_DIR . "conf/mobile_conf.php"); 
     21if (!defined("CACHE_PATH")) { 
     22    /** キャッシュ生成ディレクトリ */ 
     23    define("CACHE_PATH", $include_dir . "/.." . HTML2DATA_DIR . "cache/"); 
     24} 
     25require_once(CLASS_EX_PATH . "SC_Initial_Mobile_Ex.php"); 
     26// アプリケーション初期化処理 
     27new SC_Initial_Mobile_Ex(); 
     28 
     29//require_once($include_dir . "/.." . HTML2DATA_DIR . "conf/conf.php"); 
     30//require_once($include_dir . "/.." . HTML2DATA_DIR . "conf/mobile_conf.php"); 
    2331require_once($include_dir . "/.." . HTML2DATA_DIR . "include/module.inc"); 
    2432require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 
  • branches/feature-module-update/html/require.php

    r16503 r16506  
    1818} 
    1919 
    20 require_once($include_dir . HTML2DATA_DIR. "conf/conf.php"); 
     20if (!defined("CACHE_PATH")) { 
     21    /** キャッシュ生成ディレクトリ */ 
     22    define("CACHE_PATH", $include_dir . HTML2DATA_DIR . "cache/"); 
     23} 
     24require_once(CLASS_EX_PATH . "SC_Initial_Ex.php"); 
     25// アプリケーション初期化処理 
     26$objInit = new SC_Initial_Ex(); 
     27$objInit->init(); 
     28 
     29//require_once($include_dir . HTML2DATA_DIR. "conf/conf.php"); 
    2130require_once($include_dir . HTML2DATA_DIR . "include/module.inc"); 
    2231require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 
Note: See TracChangeset for help on using the changeset viewer.