Commit Graph

140 Commits

Author SHA1 Message Date
Sergey Tsalkov
6487873c68 new hook-based system for inserting callbacks to run before and after a query
debugMode() now works through the new system
2021-06-22 06:01:28 +00:00
Sergey Tsalkov
ac626b0795 simplify parser a bit 2021-06-20 20:53:31 +00:00
Sergey Tsalkov
bac5503d5a PHP 8 complains when trying to access closed $mysqli object, not sure how to test this properly
I don't think we need this test very much, anyway
2021-06-20 03:13:11 +00:00
Sergey Tsalkov
42894b70ae re-design query parser, new model has cleaner code and allows for %% escaping of % characters 2021-06-20 03:12:15 +00:00
Sergey Tsalkov
20c7acd8a4 DB::parse() lets you generate queries without running them 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
c0f3a7f31d restore to working in PHP 5.3 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
1d2ad974f8 drop deprecated methods:
queryOneRow (alias of queryFirstRow)
queryOneList (alias of queryFirstList)
queryOneColumn
queryOneField
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
2ea4c4c539 __callStatic() should have proper exception thrown if invalid method is used 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
7c1f9bc226 DB::$usenull is removed, it makes no sense in a modern PHP context 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
dab71efacd DB::columnList() now returns details 2021-06-20 02:28:26 +00:00
Sergey Tsalkov
38545ddb3a remove more PHP 5.2 cruft, we now require PHP 5.3+ 2021-06-20 02:28:26 +00:00
Sergey Tsalkov
0fb0071314 use __callStatic() to clean up code a bit
next release will require PHP 5.3+ (up from 5.2)
2021-06-20 02:26:21 +00:00
Sergey Tsalkov
03ff51a997 fix composer.json
packagist demands lowercase package names now
2021-01-23 22:27:10 -06:00
Sergey Tsalkov
4ff57845e4 Update README.md
Remove old broken link.
2020-07-11 10:23:08 -05:00
Sergey Tsalkov
e8c19ca2f8 clean up update() and delete(), both will now be compatible with named and numbered arguments
resolves #54
v2.3.1
2020-07-10 01:13:31 +00:00
Sergey Tsalkov
fa46824df1 get_class_vars() is broken in PHP 7.4 with opcache enabled, so stop using it
looks like this fix actually works with PHP 5.2 after all, so not dropping backwards compatibility
resolves #64
2020-07-10 00:00:27 +00:00
Sergey Tsalkov
226a08611f small test fix to pass on PHP 7.3 2020-07-09 19:51:28 +00:00
wadih
031901f8b6 Add a warning to prevent accidents (#65) 2020-07-08 21:19:59 -05:00
Magnus Månsson
30c7343bae Pre sql handler (#59)
Add a pre_sql_handler
2020-02-06 22:32:29 -06:00
Magnus Månsson
b99ed41c94 Implemented param char ssb and sse (#58) 2020-02-06 22:20:53 -06:00
Sergey Tsalkov
18d9ab2337 make sure insertOrReplace() gets valid input, throw an error if it doesn't 2020-01-27 08:45:36 -08:00
Sergey Tsalkov
027681b350 bugfix: strtolower() doesn't work with certain locales, so work around that 2020-01-24 15:42:43 -08:00
Sergey Tsalkov
677d5659bb Update README.md 2019-01-26 11:46:13 -06:00
Sergey Tsalkov
621f2e7a86 Update README.md 2019-01-26 11:45:50 -06:00
Sergey Tsalkov
6e1c252702 Update README.md 2019-01-26 10:23:50 -06:00
Sergey Tsalkov
8e19d9d6c3 bugfix in WhereClause: negate didn't wrap multiple clauses in extra parens
Fixes #41
2017-10-15 19:10:35 +00:00
Sergey Tsalkov
22e49b280e clarify that project is LGPLv3 2017-10-15 18:20:37 +00:00
Sergey Tsalkov
b41887505d fix to last commit 2017-10-15 17:56:10 +00:00
Mike Damm
cb10e249b2 Add support for custom unix sockets (#49)
Add support for custom unix sockets
2017-10-08 21:04:22 -07:00
Sergey Tsalkov
aabc77b116 Update README.md 2016-11-21 17:01:59 -08:00
Sergey Tsalkov
8bef6d6618 fix bug with hhvm 2015-03-04 00:43:54 +00:00
Sergey Tsalkov
da46a1eacc DB::insert() and the like should use __toString() value for objects whenever possible 2014-11-27 01:30:42 +00:00
Sergey Tsalkov
076a7e2b9b oops 2014-10-27 02:02:32 +00:00
Sergey Tsalkov
67b24c916d additional test with %li0 2014-10-27 02:00:21 +00:00
Sergey Tsalkov
29c8e42a09 escape and sanitize could be occasionally useful as public functions 2014-10-27 02:00:21 +00:00
Sergey Tsalkov
6fdcffab24 few minor cleanups to last commit 2014-10-27 02:00:21 +00:00
Sergey Tsalkov
e0660a9368 %? no longer handles arrays and hashes for security purposes
those are moved into %l?, %ll?, %hc, %ha, %ho for different uses
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
0474a41a56 functions generally shouldn't keep going after a nonsql error 2014-10-27 02:00:21 +00:00
Sergey Tsalkov
1fe2fdea16 when an instance of MeekroDB is created, its default settings will be those of the static instance 2014-10-27 02:00:20 +00:00
Sergey Tsalkov
83256937b8 make some useful functions public 2014-08-25 20:20:39 -07:00
Sergey Tsalkov
eb36858f1a columnList() properly escapes table names v2.3 2014-06-16 22:40:22 +00:00
Sergey Tsalkov
1d797b306e bugfix: insert/update type functions don't break when using a param_char other than % 2014-06-14 02:41:06 +00:00
Sergey Tsalkov
7c819bfc24 the connect_options variable lets you set mysqli_options, like a connection timeout 2014-06-14 01:58:51 +00:00
Sergey Tsalkov
1d147e169a ssl support (still untested) 2014-06-14 01:31:32 +00:00
Sergey Tsalkov
391702700d clean up static class init syntax a bit 2014-06-14 01:06:05 +00:00
Sergey Tsalkov
37fd169be3 minor bugfix: don't assume that the query results for queryFirstRow() or queryFirstList() will be an array (can also be a bool) 2014-06-14 00:27:38 +00:00
Sergey Tsalkov
7c5c03c576 minor cleanups 2014-06-13 21:19:10 +00:00
Sergey Tsalkov
a0a2f702e2 bugfix: don't crash if nested transactions are enabled, and the first command issued is a start transaction 2014-03-31 01:50:10 -07:00
Sergey Tsalkov
2707bcba7d minor bugfix: don't drop identical query components in WhereClause (thanks Alexander!) 2013-12-06 11:17:54 -08:00
Sergey Tsalkov
7b0da839de add yet another test for this weird bug people are reporting
tests *still* all pass, I can't reproduce the bug
2013-11-08 14:14:46 -08:00