23 Commits

Author SHA1 Message Date
shadlaws
48bd19808c #1956 - Escape LIKE queries (for _ and %).
In MySQL queries, _ and % characters are treated as wildcards (similar to ? and *, respectively).
- Added escape_for_like function to MY_Database.php
- Added unit test to Database_Test
- Corrected the five unescaped instances in the code using this function.
2013-01-25 08:47:29 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Joe7
17700b805f Coding style fixes: identation on line 48+removed trailing whitespaces, added spaces around =s 2010-12-28 23:14:04 -08:00
Joe7
66fd8c7518 Using ON DUPLICATE KEY UPDATE instead of SELECT+UPDATE/INSERT style method (that does 2 trips to Database server and is less optimal).
exists() method is not needed anymore thus got removed
2010-12-28 23:14:04 -08:00
Joe7
fda9250796 Added limit on select as for the outcome it doesn't matter if there are 20 rows or just 1. Is sufficient to return straight after reading 1 row. 2010-12-28 23:14:04 -08:00
Bharat Mediratta
fad1f05203 The Kohana folks removed the cache cleanup code back in
http://dev.kohanaframework.org/projects/kohana2/repository/revisions/4605

So now our cache entries don't expire.  For now, do cache expiration
whenever we render Admin > Maintenance, since that's the type of place
that users will go when they want their cache to expire anyway.
2010-09-18 17:46:28 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Andy Staudacher
1d8862d957 Fix for ticket #1034: Fix db cache driver delete() call which was missed in a recent refactoring / fix. 2010-02-24 01:28:38 -08:00
Andy Staudacher
6591ea2577 Fix delete() function of DB based Cache driver. It expected a scalar key / tag value, but it was always an array of keys / tags.
(compare to system/libraries/Cache.php and the File.php driver)
2010-02-21 23:48:23 -08:00
Bharat Mediratta
5df1dc135b Fix some bugs in the cache database driver, and update the tests for K24. 2009-12-21 12:13:25 -08:00
Bharat Mediratta
87bc32345f Use select() instead of select("*") 2009-12-02 10:42:49 -08:00
Bharat Mediratta
d2cb217e20 Convert more database calls over to the new format
- admin/maintenance page loads, the rebuild thumbs/resizes task works
- Fixed up some conversion bugs in the Cache driver
2009-12-02 00:34:34 -08:00
Bharat Mediratta
1fd0e14359 Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta
7c9bd9e8e8 Call execute() after upate() and insert(). 2009-11-25 13:59:01 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Tim Almdal
2e4d29e7dd If an empty array is passed into set method, then make sure the tag value being stored in the database is null, not "Array" 2009-11-16 14:23:29 -08:00
Bharat Mediratta
77a78b4990 Revert to serializing and deserializing data. The cache table can't
accept PHP constructs like arrays (the tests were choking on this).

Update tests to reflect the new `key` column.
2009-06-29 20:53:55 -07:00
Bharat Mediratta
fcc57a4182 Modify the cache table to make id the primary key for consistency with
other gallery 3 tables.  Update the driver to match, add more upgrader
code, update the installer block and change the gallery module version
to 6.
2009-06-28 16:48:29 -07:00
Tim Almdal
7a3310e91b Change the cache column of the caches table to a large blob. This fixes ticket #485 and gives us the extra adavantage of not having to serialize the data (as the database driver handles that for us) 2009-06-28 13:14:47 -07:00
Tim Almdal
a0c07d4b54 Clean up code (i.e. preamble, tabs) from the caching implementation so the unit tests pass 2009-06-28 07:49:35 -07:00
Tim Almdal
2d38370ec4 The rest of the caching driver implementation that i somehow forgot. 2009-06-27 23:34:07 -07:00