Commit graph

34 commits

Author SHA1 Message Date
Tim Starling
412eda0517 Correcting bugs due to double-prefixing table names. Removing obsolete Database member functions. Adding comments to Database.php 2004-10-24 07:10:33 +00:00
Antoine Musso
e349b6723c some comments 2004-09-17 22:50:50 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00
Domas Mituzas
3babd9d553 wfTimestampNow()->Database::timestamp() 2004-09-03 11:28:35 +00:00
Antoine Musso
90155b8a97 Changing comments layout preparing for generated documentation with Phpdocumentor 2004-09-02 23:28:24 +00:00
Domas Mituzas
36530b6e55 get rid of all INSERT IGNORE in includes/, change into Database::insertArray 2004-09-01 12:29:07 +00:00
Tim Starling
1b8462ac58 Table prefix bugs 2004-08-27 13:40:27 +00:00
Antoine Musso
3d60242fb5 massive double to single quotes conversion. I have not noticed any bug after a lot of testing 2004-08-22 17:24:50 +00:00
Tim Starling
af496e87c6 minor bug fix 2004-08-21 15:14:56 +00:00
Domas Mituzas
69251564fb database abstraction 2004-08-20 12:47:12 +00:00
Tim Starling
1773cd1e76 * Introducing bit field for database parameters
** Database constructor calling sequence, and Database::newFromParams()
** Including flags in the server initialisation structs
** Support for setting appropriate flags from legacy globals in Setup.php
** Moved some defines to Define.php so that they can be used in LocalSettings.php, most importantly the bit field constants

* Changes related to post-parse link colouring
** Turn the link cache back on when using it for updating the links table
** No longer need to call preFill() on page view

* Better synchronisation of slave servers
** Rearranged getConnection()
** System for beginning and committing transactions when multiple connections are open
** wfAbruptExit() commits transactions, wfErrorExit() does not. Various functions changed to use wfErrorAbort()

* Allowed reporting of database errors during deferred updates by moving them above output()
2004-07-24 07:24:04 +00:00
Tim Starling
ac549401d4 * Support for table name prefixes throughout the code. No support yet for converting static SQL, which also means no installation. But it has been tested by creating the tables in the ordinary way and then renaming them
* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE
* Converted to use SQL wrapper functions instead of direct SQL in various places
* Experimental method for preserving the chronological order of events when slave servers are used. Untested.
* Fixes to the new post-parse existence test feature
* Some.. other stuff
2004-07-18 08:48:43 +00:00
Tim Starling
b96b707efa OOP calling convention for database functions. DBMS abstraction implemented by means of functions instead of global variables, PostgreSQL object converted to a subclass instead of a drop-in replacement. Also the beginnings of a flexible table name feature. 2004-07-10 03:09:26 +00:00
Tim Starling
5318e9850c INSERT IGNORE for dumpUpdate() as well 2004-07-05 07:05:48 +00:00
Tim Starling
c31cc66f52 The link cache is constructed without FOR UPDATE, so collisions in these insert statements appear to be possible, and judging by the DB error log and reports of link table corruption, quite common. Ignoring errors prevents the wholesale failure of a link table update, although it's possible links which should have been removed may remain. Hence this is a temporary solution, a better solution may be to switch LinkCache to FOR UPDATE mode 2004-07-05 03:02:47 +00:00
Brion Vibber
ac9621badb Add categorylinks table to separately list category relationships. Actual
_page_ links to category pages like [[:category:Some cat]] will stay in
links/brokenlinks and not be listed in the category page list anymore.

A link can optionally specify a sort key like this: [[category:cat|Sort me]].
The page will then be sorted in category lists according to the given text
instead of the page name; thus categories may be sorted arbitrarily, by
last name or whatever.

There is also a timestamp field included on gwicke's request; this is not
used yet. Also it will currently be updated at every edit of the page,
this can be changed by implementing differential updating for the cat links.

TODO:
* Make sure that automatic sort keys are updated on page rename.
* Make sure cateory pages get cache-invalidated and purged
* Use proper text sorting instead of raw binary sort
* Allow specification of the display style on category pages: comma list
  or bullet list or number list; by sortkey or by timestamp; etc
2004-05-15 00:29:39 +00:00
Brion Vibber
59c6e92429 Some changes to the link tables. They now all use a key on cur_id for the *_from column instead of strings, and have a unique index to force prevent any duplicate entries. There's not yet a clean step in the update script, so just clear out your links tables (patch-linktables.sql) and rebuild them with refreshLinks.php.
This saves trouble in a number of places where we can now do joins with the link tables to get other info (such as cur_is_redirect!) as well as the name, and fewer bits need to be juggled on page renaming, as outgoing links no longer have to be changed (cur_id remains the same when a page is renamed).

rebuildLinks.inc and some of the tools in the 'maintenance page' still need to be updated to work with the new setup. (Special:Maintenance needs a *lot* of cleanup in general. It's kind of a catch-all of vaguely defined features which suck performance like a hydroelectric dam.)

Also I've slipped in some extra debug code. And, I think 'indexes.sql' is a big waste of time and should all be moved into tables.sql. Building indexes separately doesn't help on InnoDB and won't do anything on MyISAM either if you're just going to replace the table after it's built with an imported one from a dump which creates it with indexes.
2004-03-11 09:06:13 +00:00
Brion Vibber
014093acc4 More globals and uninitialized variables fixes. Added WebRequest ($wgRequest)
object to encapsulate the handling of get/post variables:

The following grab something out of $_REQUEST. The first parameter is the
variable name and is required. The second is an optional default value:

  $wgRequest->getVal() - any type, returns NULL if no default given
  $wgRequest->getInt() - forced integer, 0 default
  $wgRequest->getText() - runs through $wgLang->recodeInput()
  $wgRequest->getBool() - return true/false
  $wgRequest->getCheck() - returns true if the var is set, even if to ""

$wgRequest strips slashes at initialization if necessary.

Also in this fine object:
  $wgRequest->wasPosted() - returns false if this wasn't a real form post,
    so we can protect against faked submissions in get urls.

There's still plenty of work to do, not everything uses the new functions
yet. To test the strict mode, do define('DEBUG_GLOBALS', 1);
2004-03-08 09:09:35 +00:00
Tim Starling
800cd47535 Return of the Dumb Update (for rebuilding link tables) 2004-02-23 07:51:29 +00:00
Brion Vibber
0332f4c598 Fix for compatibility with short_open_tag = Off 2004-02-18 02:15:00 +00:00
Erik Moeller
6df15daa34 $wgUseBetterLinksUpdate no longer needed, removed, doDumbUpdate removed 2004-01-03 02:46:35 +00:00
Brion Vibber
d1853438f5 Escape removal of brokenlinks 2003-11-26 08:28:27 +00:00
Brion Vibber
7d01e5bb97 Fix failed imagelinks updates 2003-11-26 00:12:29 +00:00
Mr. E23
35529387d8 Removed redundant PersistentLC query 2003-11-09 23:26:02 +00:00
Tim Starling
46787701ce Nov. branch merge. Various features backported from stable, various bug fixes. 2003-11-09 11:45:12 +00:00
Mr. E23
665c30813e Experimental code for caching page links 2003-11-08 15:12:34 +00:00
Tim Starling
d8cc830c4a block/unblock log; split off profiling into Profiling.php and broke it (turn it off for now) 2003-10-16 13:30:45 +00:00
Tim Starling
7057b4e609 wfQuery now takes three parameters -- one extra for DB replication purposes 2003-09-20 01:34:06 +00:00
Brion Vibber
76dd2a8880 Article object now is associated with an arbitrary title object instead of a global 2003-09-01 08:30:14 +00:00
Tim Starling
58f452c485 bug fixes, removed debug output 2003-07-07 13:43:03 +00:00
Erik Moeller
9014f6157c -stray debug message 2003-07-06 23:28:43 +00:00
Tim Starling
a81b621b5f Incremental link table updates 2003-07-06 11:42:42 +00:00
Brion Vibber
6dff569b09 Consolidate a bit of the link update code from movepage into linksupdate
(specifically, turning brokenlinks on a new page into live links), which
should also fix the old code not touching the cache timestamps for pages
linking to the 'new' title after a move.
2003-07-05 08:12:04 +00:00
Lee Daniel Crocker
d82c14fb4f Initial revision 2003-04-14 23:10:40 +00:00