source: branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php @ 18790

Revision 18790, 4.5 KB checked in by nanasess, 14 years ago (diff)

#801 の改善に伴い MDB2 の関数に置き替えと, 未使用関数の削除

  • SC_Query
    • get_auto_increment() を削除
    • listSequences() を追加
    • listTables() を追加
    • listTableFields() を追加
    • listTableIndexes() を追加
  • SC_DB_DBFactory
    • getTableExistsSql() を削除
    • getTableIndex() を削除
    • createTableIndex() を削除
    • sfGetColumnList(), findTableNames() に @deprecated コメント追加
  • SC_Helper_DB
    • sfTabaleExists() を削除
    • sfIndexExists() を削除
    • 削除した関数の使用箇所を修正
  • SC_Helper_Session
    • sfTabaleExists() を使用していた箇所の修正
  • html/install/index.php
    • sfTabaleExists() を使用していた箇所の修正
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once(CLASS_PATH . "db/dbfactory/SC_DB_DBFactory_MYSQL.php");
26require_once(CLASS_PATH . "db/dbfactory/SC_DB_DBFactory_PGSQL.php");
27
28/**
29 * DBに依存した処理を抽象化するファクトリークラス.
30 *
31 * @package DB
32 * @author LOCKON CO.,LTD.
33 * @version $Id:SC_DB_DBFactory.php 15532 2007-08-31 14:39:46Z nanasess $
34 */
35class SC_DB_DBFactory {
36
37    /**
38     * DB_TYPE に応じた DBFactory インスタンスを生成する.
39     *
40     * @return mixed DBFactory インスタンス
41     */
42    function getInstance() {
43        switch (DB_TYPE) {
44        case "mysql":
45            return new SC_DB_DBFactory_MYSQL();
46            break;
47
48        case "pgsql":
49            return new SC_DB_DBFactory_PGSQL();
50            break;
51
52        default:
53            return new SC_DB_DBFactory();
54        }
55    }
56
57    /**
58     * データソース名を取得する.
59     *
60     * 引数 $dsn が空の場合は, DEFAULT_DSN の値を返す.
61     * DEFAULT_DSN が未定義の場合は void となる.
62     * $dsn が空ではない場合は, $dsn の値を返す.
63     *
64     * @param string $dsn データソース名
65     * @return void|string データソース名
66     */
67    function getDSN($dsn = "") {
68        if(empty($dsn)) {
69            if(defined('DEFAULT_DSN')) {
70                $dsn = DEFAULT_DSN;
71            } else {
72                return "";
73            }
74        }
75        return $dsn;
76    }
77
78    /**
79     * DBのバージョンを取得する.
80     *
81     * @param string $dsn データソース名
82     * @return string データベースのバージョン
83     */
84    function sfGetDBVersion($dsn = "") { return null; }
85
86    /**
87     * MySQL 用の SQL 文に変更する.
88     *
89     * @param string $sql SQL 文
90     * @return string MySQL 用に置換した SQL 文
91     */
92    function sfChangeMySQL($sql) { return null; }
93
94    /**
95     * 昨日の売上高・売上件数を算出する SQL を返す.
96     *
97     * @param string $method SUM または COUNT
98     * @return string 昨日の売上高・売上件数を算出する SQL
99     */
100    function getOrderYesterdaySql($method) { return null; }
101
102    /**
103     * 当月の売上高・売上件数を算出する SQL を返す.
104     *
105     * @param string $method SUM または COUNT
106     * @return string 当月の売上高・売上件数を算出する SQL
107     */
108    function getOrderMonthSql($method) { return null; }
109
110    /**
111     * 昨日のレビュー書き込み件数を算出する SQL を返す.
112     *
113     * @return string 昨日のレビュー書き込み件数を算出する SQL
114     */
115    function getReviewYesterdaySql() { return null; }
116
117    /**
118     * メール送信履歴の start_date の検索条件の SQL を返す.
119     *
120     * @return string 検索条件の SQL
121     */
122    function getSendHistoryWhereStartdateSql() { return null; }
123
124    /**
125     * 文字列連結を行う.
126     *
127     * @param array $columns 連結を行うカラム名
128     * @return string 連結後の SQL 文
129     */
130    function concatColumn($columns) { return null; }
131
132    /**
133     * テーブルのカラム一覧を取得する.
134     *
135     * @deprecated SC_Query::listTableFields() を使用してください
136     * @param string $table_name テーブル名
137     * @return array テーブルのカラム一覧の配列
138     */
139    function sfGetColumnList($table_name) { return array(); }
140
141    /**
142     * テーブルを検索する.
143     *
144     * 引数に部分一致するテーブル名を配列で返す.
145     *
146     * @deprecated SC_Query::listTables() を使用してください
147     * @param string $expression 検索文字列
148     * @return array テーブル名の配列
149     */
150    function findTableNames($expression = "") { return array(); }
151}
152?>
Note: See TracBrowser for help on using the repository browser.