Permalink
Browse files

ci update

  • Loading branch information...
it-can committed Nov 14, 2012
2 parents 91bb051 + 878c4bd commit 2a7c3543f306c599bb763cb8706d521c61510ae5
@@ -122,7 +122,7 @@ public function read($sql)
$segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2);
$filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql);
- if (FALSE === ($cachedata = file_get_contents($filepath)))
+ if (FALSE === ($cachedata = @file_get_contents($filepath)))
{
return FALSE;
}
@@ -692,7 +692,7 @@ public function query($sql, $binds = FALSE, $return_object = NULL)
// resource ID won't be any good once we've cached the
// result object, so we'll have to compile the data
// and save it)
- $CR = new CI_DB_result();
+ $CR = new CI_DB_result($this);
$CR->result_object = $RES->result_object();
$CR->result_array = $RES->result_array();
$CR->num_rows = $RES->num_rows();
@@ -2534,7 +2534,7 @@ protected function _merge_cache()
*
* Determines if a string represents a literal value or a field name
*
- * @param string
+ * @param string $str
* @return bool
*/
protected function _is_literal($str)
@@ -353,6 +353,24 @@ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = N
return $this;
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Is literal
+ *
+ * Determines if a string represents a literal value or a field name
+ *
+ * @param string $str
+ * @return bool
+ */
+ protected function _is_literal($str)
+ {
+ $str = trim($str);
+
+ return (empty($str) OR ctype_digit($str) OR $str[0] === "'" OR in_array($str, array('TRUE', 'FALSE'), TRUE));
+ }
+
+
}
/* End of file pdo_pgsql_driver.php */
@@ -673,6 +673,23 @@ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = N
// --------------------------------------------------------------------
+ /**
+ * Is literal
+ *
+ * Determines if a string represents a literal value or a field name
+ *
+ * @param string $str
+ * @return bool
+ */
+ protected function _is_literal($str)
+ {
+ $str = trim($str);
+
+ return (empty($str) OR ctype_digit($str) OR $str[0] === "'" OR in_array($str, array('TRUE', 'FALSE'), TRUE));
+ }
+
+ // --------------------------------------------------------------------
+
/**
* Close DB Connection
*

0 comments on commit 2a7c354

Please sign in to comment.