Ignore:
Timestamp:
2011/05/20 13:12:25 (13 years ago)
Author:
Seasoft
Message:

#144 (郵便番号DB のアップデート)

  • URLのパラメータ化のプロトタイプ
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/SC_Initial.php

    r20901 r20947  
    5757        $this->defineErrorType(); 
    5858        $this->defineConstants(); 
     59        $this->complementConstants(); 
    5960        $this->phpconfigInit(); 
    6061        $this->createCacheDir(); 
     
    218219            die(CACHE_REALDIR . "../mtb_constants_init.php が存在しません"); 
    219220        } 
     221    } 
     222 
     223    /** 
     224     * パラメータの補完 
     225     * 
     226     * ソースのみ差し替えたバージョンアップを考慮したもの。 
     227     * 
     228     * @access protected 
     229     * @return void 
     230     */ 
     231    function complementConstants() { 
     232        // 2.11.1 → 2.11.2 
     233        /** 郵便番号CSVのZIPアーカイブファイルの取得元 */ 
     234        $this->defineIfNotDefined('ZIP_DOWNLOAD_URL', "http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip"); 
    220235    } 
    221236 
     
    357372        $_REQUEST = array_merge($_GET, $_POST); 
    358373    } 
     374 
     375    /** 
     376     * 指定された名前の定数が存在しない場合、指定された値で定義 
     377     * 
     378     * @param string $name 定数の名前。 
     379     * @param mixed $value 定数の値。 
     380     * @return boolean 成功した場合に TRUE を、失敗した場合に FALSE を返します。 
     381     */ 
     382    function defineIfNotDefined($name, $value = null) { 
     383        if (!defined($name)) { 
     384            define($name, $value); 
     385        } 
     386    } 
    359387} 
    360388?> 
Note: See TracChangeset for help on using the changeset viewer.