X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fcocanwiki.ml;h=e6fb225b91cffd71e4e48af8c65080d132f7923b;hb=9ef45f7514ad67944e67e943451f80ac4e416d77;hp=61351d3903e4f4cbe7b22c6814e7b4d94eecb539;hpb=6b0b6830a2e784eee99dcd1b1a3cb8b44e27c765;p=cocanwiki.git diff --git a/scripts/cocanwiki.ml b/scripts/cocanwiki.ml index 61351d3..e6fb225 100644 --- a/scripts/cocanwiki.ml +++ b/scripts/cocanwiki.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: cocanwiki.ml,v 1.11 2004/09/23 11:56:47 rich Exp $ + * $Id: cocanwiki.ml,v 1.12 2004/09/23 15:16:21 rich Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,41 +34,6 @@ module Pool = DbiPool (Dbi_postgres) *) let _get_dbh r = Pool.get r "cocanwiki" -(* Server-wide settings. - * - * These are stored in a single row in the database in the table - * 'server_settings'. You must restart the server if you change - * this row. - * - * It's not possible to read these at server start-up time because the - * Apache server is still running as 'root' and will not normally be - * allowed to access the database. We thus read them at the earliest - * opportunity, in a request context, and cache the results. - *) -let server_settings_version = - let settings = ref None in - let get_settings (dbh : Dbi.connection) = - let sth = dbh#prepare "select version from server_settings" in - sth#execute []; - let s = - match sth#fetch1 () with - | [ `Int version ] -> version - | _ -> assert false in - sth#finish (); - settings := Some s; - s - in - - let server_settings_version dbh = - let (version) = - match !settings with - None -> get_settings dbh - | Some settings -> settings in - version - in - - server_settings_version - (* The [CgiExit] exception should be folded back into the base * mod_caml code at some point. It just causes the 'run' function to * return at that point safely. (XXX)