mediawiki-extensions-Math/math/util.ml
Brion Vibber c4d9349786 Initial stab at breaking math/texvc out to Math extension.
* (bug 14202) $wgUseTeX has been superseded by the Math extension. To re-enable
  math conversion after upgrading, obtain the Math extension from SVN or from
  http://www.mediawiki.org/wiki/Extension:Math and add to LocalSettings.php:
  require_once "$IP/extensions/Math/Math.php";

This is an initial stab, and a few things remain to be cleaned up:
* messages need to be moved from core to extension
* MW_MATH_* constants should be moved to the extension from core
* old back-compat math names interfaces using those constants should be removed from message files
* classic edit toolbar's math button should be added from the extension (or else dropped) -- currently there's not a clean hook, but could do it by JS
* couple of things like the 'armourMath' function on Language & LanguageConverter may want to be redone just as an unconditional, if that's simpler.

Setting $wgUseTeX alone will no longer have any affect. The var's still there for the moment as a few bits still need to be fully moved out from core.
2011-04-09 00:39:40 +00:00

27 lines
707 B
OCaml

(* vim: set sw=8 ts=8 et: *)
(* TODO document *)
let mapjoin f l = (List.fold_left (fun a b -> a ^ (f b)) "" l)
(* TODO document *)
let mapjoine e f = function
[] -> ""
| h::t -> (List.fold_left (fun a b -> a ^ e ^ (f b)) (f h) t)
(* Exception used by open_out_unless_exists below *)
exception FileAlreadyExists
(* Wrapper which raise an exception when output path already exist *)
let open_out_unless_exists path =
if Sys.file_exists path
then raise FileAlreadyExists
else open_out path
(* *)
let run_in_other_directory tmppath cmd =
let prevdir = Sys.getcwd () in(
Sys.chdir tmppath;
let retval = Sys.command cmd in
(Sys.chdir prevdir; retval)
)