Ejemplo n.º 1
0
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * 初期設定
 */
require_once dirname(__FILE__) . '/zippyzip.conf';
require_once dirname(__FILE__) . '/zippyzip-ime.conf';
require_once dirname(__FILE__) . '/zippyzip-common.php';
log_info(__FILE__);
log_info("Start.");
mkdirs(array(PATH_TMP_IME));
mkdirs(array(PATH_IME));
update_x0402();
/*
 * 郵便番号辞書(住所)を出力する。
 */
$s = fopen(PATH_CSV . "/" . AREA_OUT, "rb");
$t = fopen(PATH_TMP_IME_AREA, "ab");
while ($cols = fgetcsv($s, 1024, ",")) {
    fwrite($t, mb_convert_encoding(mb_convert_kana(substr($cols[0], 0, 3) . "-" . substr($cols[0], 3, 7) . "\t" . $x0401[substr($cols[1], 0, 2)] . $x0402[$cols[1]] . $cols[2] . $cols[3] . $cols[4] . "\t地名その他\r\n", "A", "UTF-8"), "Windows-31J", "UTF-8"));
}
fclose($t);
fclose($s);
/*
 * 郵便番号辞書(事業所)を出力する。
 */
$s = fopen(PATH_CSV . "/" . FIRM_OUT, "rb");
$t = fopen(PATH_TMP_IME_FIRM, "ab");
 */
/*
 * 初期設定
 */
require_once dirname(__FILE__) . '/zippyzip.conf';
require_once dirname(__FILE__) . '/zippyzip-fragment.conf';
require_once dirname(__FILE__) . '/zippyzip-common.php';
log_info(__FILE__);
log_info("Start.");
mkdirs(array(PATH_TMP));
$updated = false;
/*
 * CSV データと JSON データの処理
 */
if (GENERATE_CSV_FRAGMENTS || GENERATE_JSON) {
    if (!update_x0402()) {
        exit(1);
    }
    if (!generate_work()) {
        exit(1);
    }
    if (GENERATE_CSV_FRAGMENTS) {
        if (!update_csv()) {
            exit(1);
        }
    }
    if (GENERATE_JSON) {
        if (!update_json()) {
            exit(1);
        }
    }