public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Cleaned up and restructured adodb.functions.php a bit - no functional 
changes

git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@3746 
3d254a34-79dc-0310-9e5f-be208747d8a0
dittmann (author)
Sun Jan 14 03:58:26 -0800 2007
commit  dbaab6f7767343e675f6ee827f74811ae61814b9
tree    49c3e419da43acc29cfd87c3c431bfc97549c09f
parent  87dfcfb1157986cf757deadb7cfef61c61bcc743
...
40
41
42
43
44
 
45
46
47
...
53
54
55
56
57
58
59
60
61
62
63
64
 
 
 
 
65
66
67
68
69
70
71
72
73
74
75
 
76
77
78
79
80
81
82
 
 
 
 
 
 
 
83
84
85
...
40
41
42
 
 
43
44
45
46
...
52
53
54
 
 
 
 
 
 
 
 
 
55
56
57
58
59
60
61
62
 
63
 
 
 
 
 
64
65
 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
0
@@ -40,8 +40,7 @@ function load_adodb() {
0
     else
0
     {
0
       # ADOdb cannot be found, show a message and stop the script execution
0
- echo "The ADOdb Lite database abstraction library cannot be found, CMS Made Simple cannot load.";
0
- die();
0
+ die('The ADOdb Lite database abstraction library cannot be found, CMS Made Simple cannot load.');
0
     }
0
   }
0
   
0
@@ -53,33 +52,29 @@ function & adodb_connect()
0
 {
0
   global $db, $config;
0
   
0
- $dbinstance = &ADONewConnection($config['dbms'], 'pear:date:extend:transaction');
0
- if (isset($config['persistent_db_conn']) && $config['persistent_db_conn'] == true)
0
- {
0
- $connect_result = $dbinstance->PConnect($config["db_hostname"],$config["db_username"],$config["db_password"],$config["db_name"]);
0
- }
0
- else
0
- {
0
- $connect_result = $dbinstance->Connect($config["db_hostname"],$config["db_username"],$config["db_password"],$config["db_name"]);
0
- }
0
+ $dbinstance =& ADONewConnection($config['dbms'], 'pear:date:extend:transaction');
0
+ $conn_func = (isset($config['persistent_db_conn']) && $config['persistent_db_conn'] == true) ? 'PConnect' : 'Connect';
0
+ $connect_result = $dbinstance->$conn_func($config['db_hostname'], $config['db_username'], $config['db_password'], $config['db_name']);
0
+
0
   if (FALSE == $connect_result)
0
   {
0
     die('Database Connection failed');
0
   }
0
- $dbinstance->SetFetchMode(ADODB_FETCH_ASSOC);
0
   
0
- if ($config['dbms'] == 'sqlite')
0
- {
0
- $dbinstance->Execute("PRAGMA short_column_names = 1;");
0
- sqlite_create_function($cmsdb->_connectionID,'now','time',0);
0
- }
0
+ $dbinstance->SetFetchMode(ADODB_FETCH_ASSOC);
0
   
0
- //$dbinstance->debug = true;
0
   if ($config['debug'] == true)
0
   {
0
     $dbinstance->debug = true;
0
     #$dbinstance->LogSQL();
0
   }
0
+
0
+ if ($config['dbms'] == 'sqlite')
0
+ {
0
+ $dbinstance->Execute('PRAGMA short_column_names = 1;');
0
+ sqlite_create_function($cmsdb->_connectionID, 'now', 'time', 0);
0
+ }
0
+
0
   $db =& $dbinstance;
0
   return $db;
0
 }

Comments

    No one has commented yet.