public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
* Fixed the installer. [#204 state:resolved]
* Added docs for QueryBuilder::build_conditions().
* Fixed SQL->replace() not working like SQL->insert() does with 
build_conditions().
vito (author)
Wed Sep 03 17:46:48 -0700 2008
commit  c71daaba73c6538dc94d64108eadc3f47c6f7b5f
tree    8b8fec67f457899ed39365e4695a8a3d2130d612
parent  ac351f808073f35406d98143b38a981a54c83d69
...
27
28
29
30
 
31
32
33
...
189
190
191
 
 
 
 
 
 
 
 
 
192
193
194
...
27
28
29
 
30
31
32
33
...
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
0
@@ -27,7 +27,7 @@
0
      * Function: build_replace
0
      * Creates a full replace query.
0
      */
0
-    public static function build_replace($table, $data) {
0
+    public static function build_replace($table, $data, &$params = array()) {
0
       $conditions = self::build_conditions($data, $params);
0
       $data = array();
0
 
0
@@ -189,6 +189,15 @@
0
       return implode(", ", $order);
0
     }
0
 
0
+    /**
0
+     * Function: build_conditions
0
+     * Builds an associative array of SQL values into PDO-esque paramized query strings.
0
+     *
0
+     * Parameters:
0
+     *     $conds - Conditions.
0
+     *     $params - Parameters array to fill.
0
+     *     $tables - If specified, conditions will be tablefied with these tables.
0
+     */
0
     public static function build_conditions($conds, &$params, $tables = null) {
0
       foreach ($conds as $key => $val) {
0
         if (is_int($key)) # Full expression
...
243
244
245
246
 
247
248
249
...
243
244
245
 
246
247
248
249
0
@@ -243,7 +243,7 @@
0
      *     $throw_exceptions - Should exceptions be thrown on error?
0
      */
0
     public function replace($table, $data, $params = array(), $throw_exceptions = false) {
0
-      return $this->query(QueryBuilder::build_replace($table, $data), $params, $throw_exceptions);
0
+      return $this->query(QueryBuilder::build_replace($table, $data, $params), $params, $throw_exceptions);
0
     }
0
 
0
     /**
...
10
11
12
 
13
14
15
...
10
11
12
13
14
15
16
0
@@ -10,6 +10,7 @@
0
   define('XML_RPC', false);
0
   define('UPGRADING', false);
0
   define('INSTALLING', true);
0
+  define('TESTER', true);
0
 
0
   ini_set('error_reporting', E_ALL);
0
   ini_set('display_errors', true);

Comments