Commit Graph

55 Commits (c2e6cfabe91eb270c0bb58137078bd0413a7554f)

Author SHA1 Message Date
Steven Wittens ca9293b3ee #54981: calls to db_lock_table in bootstrap.inc do not use db_prefix 2006-04-27 20:38:49 +00:00
Gerhard Killesreiter c706d11a0d #16542, add db rewriting for menus, patch by chx
fixes 57406 too
2006-04-07 11:28:20 +00:00
Gerhard Killesreiter e01c325d4f #42000, misssing underscore, found by rump 2006-03-26 18:19:04 +00:00
Gerhard Killesreiter a6d62c1b62 #42000, docs update, by me 2006-03-26 14:46:51 +00:00
Gerhard Killesreiter 53d16d7da0 #42000, Watchdog can't log errors when using db_set_active(non-default), patch by Chris Johnson and myself 2006-03-26 14:11:38 +00:00
Dries Buytaert 7add598ee2 - Patch #51850 by chx, webchick et al: fixed various problems with db_rewrite_sql, made db_rewrite_sql slightly more robust. 2006-03-08 15:13:20 +00:00
Dries Buytaert 4ec8c0428e - Patch #41644 by chx: critical bug: db_rewrite_sql had a bad regex. 2006-01-08 12:51:37 +00:00
Dries Buytaert 764f1177ef - Patch #40631 by Chris Johnson: is_array() slower than isset() or empty(). 2005-12-14 20:10:45 +00:00
Dries Buytaert 7a341583be - Patch #39257 by merlinofchaos: node_access rewrite breaks with FROM_UNIXTIME. 2005-11-29 15:37:27 +00:00
Dries Buytaert 244945365d - Patch #10407 by Cvbge: fixed cache problems with PostgreSQL. 2005-11-27 11:52:08 +00:00
Dries Buytaert 87df276acb - Patch #29910 by m3avrck, nsk, Thomas et al: added a mysqli database backend for use with PHP5 and MySQL 4.1 and above.
NOTE: I don't have MySQL 4.1 setup at the moment so I could _not_ test this patch.  Luckily, various people reported that it works.
2005-09-12 20:13:04 +00:00
Dries Buytaert 013b73e6ec - Patch #30122 by m3verick: changed include_once()'s to include "./$file"
for performance's sake.
2005-09-08 19:19:01 +00:00
Dries Buytaert 7b8a409675 - Patch #29385 by chx: no ?> add end of files. 2005-08-25 21:14:17 +00:00
Steven Wittens d9d4b9bdab - #27231: Friendly DB error screens. 2005-07-27 01:58:43 +00:00
Dries Buytaert 5c8843704c - Patch #18213 by chx: boostrap system. Modified to work with HEAD, tidied
up the documentation a little.

  chx: can you double-check whether the global $conf variable is secure?
       (That is, make sure it can't be send using the URL or something.)
2005-06-22 20:19:58 +00:00
Dries Buytaert 47f1f7f90a - Patch #19609 by Daniel: fix problem with database prefixing 2005-04-08 14:24:03 +00:00
Steven Wittens bb08146c67 - Fixing broken search after sql rewrite patches
- Minor code style fixes.
2005-02-19 22:24:24 +00:00
Steven Wittens 7c6a787295 - #16111: bad quotes in db_rewrite_sql 2005-02-05 00:12:24 +00:00
Dries Buytaert 96c039680a - Patch #16111 by chx: fixed some bugs in the db_rewrite_sql() code. 2005-01-31 20:45:10 +00:00
Dries Buytaert b176382d23 - Patch #16111 by chx: PHPdoc/documentation improvements. 2005-01-30 17:48:52 +00:00
Dries Buytaert 993ea0c6c5 - Patch #16111 by chx: generalized node_rewrite_query to db_rewrite_query. 2005-01-29 22:02:37 +00:00
Dries Buytaert 828be2ad61 - Patch #13020 by chx: let Drupal handle multiple database layers.
- Removed the PEAR database backend.  It's no longer being used/maintained.
2004-12-30 13:13:22 +00:00
Dries Buytaert 29337ad8bb - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so you can pass the query arguments in. There is however an alternative syntax: instead of passing the query arguments as function arguments, you can also pass a single array with the query arguments in it. For example the following two statements are equivalent:
db_query($query, $a, $b, $c);
db_query($query, array($a, $b, $c));

This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.

However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.

This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.

I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.

Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);

and

- return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
+ return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);

I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.

This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query.  This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself.  With the new, documented syntax, there is no more excuse to put data directly in the query.
2004-11-29 13:13:29 +00:00
Dries Buytaert b84b6e42cf - Patch #10663 by JonBob: documentation improvements: fixed some typos and improved consistency to the use of Doxygen/api.module commands in the comments. 2004-09-09 05:51:08 +00:00
Dries Buytaert 7b716e8e77 - Patch #10622 by Adrian: fixes various PostgreSQL related problems.
1) Menu problems with Postgres (this is a highly critical 1 line fix)
  2) Archive module fails with Postgres
  3) Postgres setup problems - changes to database.pgsql (although i made these changes myself before finding this patch)
  4) Book module fails with Postgres
  5) Postgres problems following creation of a new type of user - which is actually about a taxonomy.module bug.
  6) Creating accregator_item_table in PostgreSQL
  7) Postgres - Polls not displayed on Poll Page
  8) Blog module has sql errors with postgres

  This should not affect MySQL users (hopefully).
2004-09-08 15:38:26 +00:00
Dries Buytaert 63a327db97 - Patch #9287 by JonBob: made the code style in the three database include files consistent with Drupal standards, and adds a wealth of Doxygen-style comments to aid developers in writing solid database access code using the API. 2004-07-14 19:15:25 +00:00
Dries Buytaert 99e9f86862 - Patch #7575 by ax: not in global scope, making updates fail. 2004-05-06 20:25:48 +00:00
Dries Buytaert e4d45aaef3 - Patch by Adrian: added support for multiple database connections. 2004-04-30 05:12:46 +00:00
Dries Buytaert fa2581edcf - Modifies path.module to get rid of pgsql reserved word. Patch by Adrian.
- Updates database.pgsql and database.mysql to work with current cvs. Patch
  by Adrian.

- Updates update.php to be able to update postgres from 4.2 to current.
  Patch by Adrian.

- Small fixes by me.
2003-10-01 05:18:03 +00:00
Dries Buytaert b77272279e - Committed Moshe's selective table rewriting patch. Makes it possible to
share some database tables but not others.
2003-08-26 06:44:37 +00:00
Dries Buytaert 337b3c9de9 - Committed a slightly modified version of Slavica's table prefix patch. 2003-07-10 17:46:44 +00:00
Dries Buytaert db47bac35e - node.module:
+ Changed node_form() to use good ol' tables instead of div/CSS-tags.

   + Revised the "revision API": I think we have both an easy and powerful
     API now that should make everyone happy.

   + Improved the usability of the rollback functionality a bit.

   + Removed the "view node" link from the "node overview" page in the
     admin section and added a "delete node" link instead.

   + Added a few missing translations; there might be missing more
     translations though.

- book.module:

   + Made the book module use the "revision API" instead of having it poke
     and use the innards and underlying details of the revision system.

- queue.module:

   + Made the queue module use the improved revision number.

- module.inc:
   + Applied Moshe's patch: added more arguments to module_invoke()

- mail-to-sql.pl:
   + Added support for more header fields and for folded fields

Notes:

- no database updates required
2001-11-05 22:59:11 +00:00
Dries Buytaert 7c181aba6d - Made some improvements/updates to the database abstraction layer. 2001-10-31 20:33:23 +00:00
Kjartan Mannes 864c18d4c3 - added the CVS keyword $Id$ to all files to make future version tracking
easier. Also changed the <? tag to <?php in some cases.
2001-10-20 18:57:09 +00:00
Dries Buytaert 27e4d1ab3e - Small improvement to db_query() to make debuging queries a bit more easy. 2001-10-14 11:29:29 +00:00
Dries Buytaert 959cae8222 - added sequence tables
- fixed bug in node_page()

- fixed bug in db_result()

- fixed rss glitch
2001-10-11 12:25:25 +00:00
Dries Buytaert f1932821be - PEAR-ification of Drupal by claw: you can now host Drupal on a wide
range of databases including MySQL, PostgreSQL, MSSQL, and others.

  For additional information and an 'how to upgrade', check the mails
  sent to the mailing list.
2001-10-09 21:01:47 +00:00
Dries Buytaert 4ba91a779a - Improved db_fetch_array() to return an associative array only:
passing around arrays should be less expensive.
2001-06-06 18:57:41 +00:00
Dries Buytaert 20397ad3d9 CHANGES
- Redid settings.module and even renamed it to conf.module.
    * Settings are now grouped in basic categories like "system
      settings", "module settings" and "filters".
  * Added new settings to make Drupal easier to configure and
  to make some aspects like the watchdog scale better.

- Renamed includes/settings.php to includes/conf.php.

- Added filter support to conf.module and introduced filter hooks so
  modules can implement and export new filters.  Example filters are
  an HTML filter (implemented), a profanity filter, an url converter,
  ASCII smileys to images filter and so on ...

- Reworked the check_* functions: user contributed content/input is
  only verified and filtered once in its lifespan.

NOTES

- Altough this is a large commit, no database changes are required.
2001-05-20 13:51:40 +00:00
Dries Buytaert d32216f8b6 - added new variable: theme_footer which can be used to provide a
footer message like a copyright notice. Themes should use this!
- small improvement to example theme
- added theme_footer to theme marvin
- small improvement to database.inc
2001-04-14 19:29:27 +00:00
Dries Buytaert b87d482b38 Last nights updates (under construction):
- added _type() hook so each module can return the content types he/she
    implements
2001-04-13 08:27:32 +00:00
Dries Buytaert dae5c2208c - improved rating module: it now shows some basic statistics :-)
- updated database files
- removed affialiate-site and drupal-site module: maintain them
  by hand through a box for now will you.
2001-04-07 20:00:21 +00:00
Kjartan Mannes 6bb49b4bb8 Made a few cosmetic changes. Mostly just checking out how much work it
would be to support more databases :-)
2001-03-27 14:59:49 +00:00
Dries Buytaert accd5f0c31 - applied David Norman's patch to turn all <?'s into fully qualified
<?php's.
2001-03-10 11:07:52 +00:00
Steven Wittens 167594dc09 Added "db_insert_id()", a wrapper for mysql_insert_id(); 2001-03-03 22:59:11 +00:00
Dries Buytaert 728249cbc4 - fixed small translation glitch in format_interval
- added a couple of missing t() functions
- improved the comments module, fixed the score problem Jeroen
  reported earlier -> it's slicker but I hope it won't break anything
2001-03-01 21:34:09 +00:00
Dries Buytaert d386c110f4 - removed redundant spaces 2001-01-26 13:38:46 +00:00
Dries Buytaert 8511d9fb45 A batch of patches:
- configuration:
    + renamed $db_name to $db_user
    + renamed $db_base to $db_name
  - fixed small diary glitch
  - fixed initial-comment-score problem
  - fixed comment rating bug: improved the API and updated the
    themes
  - removed some tabs from Steven ;)
  - fixed backend warnings and improved robustness
    I'm not happy yet with the headline grabber - it generates
    too many SQL errors.
  - some small cosmetic changes in comment.module
  - fixed minor glitch in format_interval()
2001-01-06 11:39:43 +00:00
Dries Buytaert a5b8640b00 - fixed bug in database.inc 2001-01-02 06:35:23 +00:00
Dries Buytaert 44c4800434 - here a bunch of changes to make "drupal" (for now) work with PHP 4.0.4
- tidied up some of the code and mainly working on the documentation
2000-12-30 11:58:14 +00:00