Mailing List Archive

Re: [Wikipedia-l] question about html templates
(cc'ing to wikitech-l)

Jonathan Walther wrote:
> Where are the templates stored that are used in generating the HTML
> pages? For instance, the templates for the header and footer for each
> article; the format of the recent changes page; that sort of thing. Is
> it hard coded into the source?

Yes. It's kind of ugly that way. ;)

Language-specific text is stored away in arrays in the Language**.php
files, but that contains relatively little markup.

See Skin.php and its fellows for most of the layout; also OutputPage.php
for some bits.

(And feel free to use the wikitech-l list for technical discussion of
the code; wikipedia-l is fairly high traffic as it is.)

Jonathan Walther wrote:
> Hi. Question about Wiki version control. Am I correct in believing
> that every revision of an article is stored in the database, in full?

Yes. Old revisions sit in the 'old' table, every blessed one. It's a big
table. (In theory this could be made more efficient in various ways;
compression, diffs, etc.)

> Also, looking through the php source, I'm seeing what look like a lot
> of MySQLisms that are hard to clean up, but if fixed could mean
> tremendous speedups with Postgres. Thats entirely apart from the
> benefit of running the VACUUM program every night so the database
> self-optimizes itself for the data access patterns that it sees.

Mmmm, please do!

> I would like to complement the coders on a really clean codebase. The
> code is a pleasure to read and tweak.

Send all compliments on the current codebase to Lee Daniel Crocker. He
da man!

> Not nice to do major changes on, but I doubt if that was ever
> intended for the code anyway. Postgres support isn't a major change,
> btw.

> There is one minor point; it's a very nice thing to have the sql stuff
> abstracted out into it's own .sql file. I refer to things like
> buildTables.php, and the like. Code and SQL don't mix too well; makes
> it harder to hunt down bugs or make modifications in either one. For
> instance, getting rid of MySQLisms...

Yes, it might not be a bad idea to break out the queries that way, so as
much as possible you can just drop in an alternate file or two and run
with a different database backend.

-- brion vibber (brion @ pobox.com)