Warning: Can't use blame annotator:
svn blame failed on branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php: バイナリファイル 'file:///home/svn/open/branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php' に対しては blame で各行の最終変更者を計算できません 195004

source: branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php @ 21867

Revision 21867, 5.4 KB checked in by nakanishi, 12 years ago (diff)

#1831 Copyright Update

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
RevLine 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2012 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/**
25 * DBに依存した処理を抽象化するファクトリークラス.
26 *
27 * @package DB
28 * @author LOCKON CO.,LTD.
29 * @version $Id:SC_DB_DBFactory.php 15532 2007-08-31 14:39:46Z nanasess $
30 */
31class SC_DB_DBFactory {
32
33    /**
34     * DB_TYPE に応じた DBFactory インスタンスを生成する.
35     *
36     * @param string $db_type 任意のインスタンスを返したい場合は DB_TYPE 文字列を指定
37     * @return mixed DBFactory インスタンス
38     */
39    function getInstance($db_type = DB_TYPE) {
40        switch ($db_type) {
41            case 'mysql':
42                return new SC_DB_DBFactory_MYSQL();
43
44            case 'pgsql':
45                return new SC_DB_DBFactory_PGSQL();
46
47            default:
48                return new SC_DB_DBFactory();
49        }
50    }
51
52    /**
53     * データソース名を取得する.
54     *
55     * 引数 $dsn が空でデータソースが定義済みの場合はDB接続パラメータの連想配列を返す
56     * DEFAULT_DSN が未定義の場合は void となる.
57     * $dsn が空ではない場合は, $dsn の値を返す.
58     *
59     * @param mixed $dsn データソース名
60     * @return mixed データソース名またはDB接続パラメータの連想配列
61     */
62    function getDSN($dsn = '') {
63        if (empty($dsn)) {
64            if (defined('DEFAULT_DSN')) {
65                $dsn = array('phptype'  => DB_TYPE,
66                             'username' => DB_USER,
67                             'password' => DB_PASSWORD,
68                             'protocol' => 'tcp',
69                             'hostspec' => DB_SERVER,
70                             'port'     => DB_PORT,
71                             'database' => DB_NAME
72                             );
73            } else {
74                return '';
75            }
76        }
77        return $dsn;
78    }
79
80    /**
81     * DBのバージョンを取得する.
82     *
83     * @param string $dsn データソース名
84     * @return string データベースのバージョン
85     */
86    function sfGetDBVersion($dsn = '') { return null; }
87
88    /**
89     * MySQL 用の SQL 文に変更する.
90     *
91     * @param string $sql SQL 文
92     * @return string MySQL 用に置換した SQL 文
93     */
94    function sfChangeMySQL($sql) { return null; }
95
96    /**
97     * 昨日の売上高・売上件数を算出する SQL を返す.
98     *
99     * @param string $method SUM または COUNT
100     * @return string 昨日の売上高・売上件数を算出する SQL
101     */
102    function getOrderYesterdaySql($method) { return null; }
103
104    /**
105     * 当月の売上高・売上件数を算出する SQL を返す.
106     *
107     * @param string $method SUM または COUNT
108     * @return string 当月の売上高・売上件数を算出する SQL
109     */
110    function getOrderMonthSql($method) { return null; }
111
112    /**
113     * 昨日のレビュー書き込み件数を算出する SQL を返す.
114     *
115     * @return string 昨日のレビュー書き込み件数を算出する SQL
116     */
117    function getReviewYesterdaySql() { return null; }
118
119    /**
120     * メール送信履歴の start_date の検索条件の SQL を返す.
121     *
122     * @return string 検索条件の SQL
123     */
124    function getSendHistoryWhereStartdateSql() { return null; }
125
126    /**
127     * ダウンロード販売の検索条件の SQL を返す.
128     *
129     * @return string 検索条件の SQL
130     */
131    function getDownloadableDaysWhereSql() { return null; }
132
133    /**
134     * 文字列連結を行う.
135     *
136     * @param array $columns 連結を行うカラム名
137     * @return string 連結後の SQL 文
138     */
139    function concatColumn($columns) { return null; }
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    /**
153     * インデックス作成の追加定義を取得する
154     *
155     * 引数に部分一致するテーブル名を配列で返す.
156     *
157     * @param string $table 対象テーブル名
158     * @param string $name 対象カラム名
159     * @return array インデックス設定情報配列
160     */
161    function sfGetCreateIndexDefinition($table, $name, $definition) { return $definition; }
162
163    /**
164     * 各 DB に応じた SC_Query での初期化を行う
165     *
166     * @param SC_Query $objQuery SC_Query インスタンス
167     * @return void
168     */
169    function initObjQuery(SC_Query &$objQuery) {
170    }
171}
Note: See TracBrowser for help on using the repository browser.