Commit 4c3e62b6f04a20b55d88f87016fcd078c80fea9b
1 parent
70906a16
Move requires before a potential return statement.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3234 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
11 deletions
config/dmsDefaults.php
| ... | ... | @@ -130,6 +130,16 @@ class KTInit { |
| 130 | 130 | |
| 131 | 131 | require_once("DB.php"); |
| 132 | 132 | |
| 133 | + // DBCompat allows phplib API compatibility | |
| 134 | + require_once(KT_LIB_DIR . '/database/dbcompat.inc'); | |
| 135 | + $default->db = new DBCompat; | |
| 136 | + | |
| 137 | + // DBUtil is the preferred database abstraction | |
| 138 | + require_once(KT_LIB_DIR . '/database/dbutil.inc'); | |
| 139 | + | |
| 140 | + // KTEntity is the database-backed base class | |
| 141 | + require_once(KT_LIB_DIR . '/ktentity.inc'); | |
| 142 | + | |
| 133 | 143 | $dsn = array( |
| 134 | 144 | 'phptype' => $default->dbType, |
| 135 | 145 | 'username' => $default->dbUser, |
| ... | ... | @@ -148,20 +158,10 @@ class KTInit { |
| 148 | 158 | if (PEAR::isError($default->_db)) { |
| 149 | 159 | KTInit::handleInitError($default->_db); |
| 150 | 160 | // returns only in checkup |
| 151 | - return $res; | |
| 161 | + return $default->_db; | |
| 152 | 162 | } |
| 153 | 163 | $default->_db->setFetchMode(DB_FETCHMODE_ASSOC); |
| 154 | 164 | |
| 155 | - // DBCompat allows phplib API compatibility | |
| 156 | - require_once(KT_LIB_DIR . '/database/dbcompat.inc'); | |
| 157 | - $default->db = new DBCompat; | |
| 158 | - | |
| 159 | - // DBUtil is the preferred database abstraction | |
| 160 | - require_once(KT_LIB_DIR . '/database/dbutil.inc'); | |
| 161 | - | |
| 162 | - // KTEntity is the database-backed base class | |
| 163 | - require_once(KT_LIB_DIR . '/ktentity.inc'); | |
| 164 | - | |
| 165 | 165 | } |
| 166 | 166 | /// }}} |
| 167 | 167 | ... | ... |