File tree Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change 88 */
99class odbcsupp
1010{
11- private $ last_errorcode = '' ;
12- private $ last_errormsg = '' ;
11+ private $ last_errorcode ;
12+ private $ last_errormsg ;
13+ private $ database ;
14+ private $ user ;
15+ private $ password ;
16+ private $ options ;
1317
1418 /**
15- *
16- * @todo should perhaps handle this method differently if $options are not passed
17- *
1819 * @param $database
1920 * @param $user
2021 * @param $password
2122 * @param null $options
23+ */
24+ public function __construct ($ database , $ user , $ password , $ options = null )
25+ {
26+ $ this ->database = $ database ;
27+ $ this ->user = $ user ;
28+ $ this ->password = $ password ;
29+ $ this ->options = $ options ;
30+ }
31+
32+ /**
33+ *
34+ * @todo should perhaps handle this method differently if $options are not passed
35+ *
2236 * @return bool|resource
2337 */
24- public function connect ($ database , $ user , $ password , $ options = null )
38+ public function connect ()
2539 {
26- if ($ options ) {
27- if ((isset ($ options ['persistent ' ])) && $ options ['persistent ' ]) {
28- $ conn = odbc_pconnect ($ database , $ user , $ password );
40+ if ($ this -> options ) {
41+ if ((isset ($ this -> options ['persistent ' ])) && $ this -> options ['persistent ' ]) {
42+ $ conn = odbc_pconnect ($ this -> database , $ this -> user , $ this -> password );
2943 } else {
30- $ conn = odbc_connect ($ database , $ user , $ password );
44+ $ conn = odbc_connect ($ this -> database , $ this -> user , $ this -> password );
3145 }
3246
3347 if (is_resource ($ conn )) {
You can’t perform that action at this time.
0 commit comments