Extension:Wiki2LaTeX/Development/w2lUpdater.php

<?php // update and download the newest version of wiki2latex

$files = array('w2lParser', 'w2lExporter', 'w2lLaTeXUtil', 'w2lDefaultConfig');

$url = 'http://www.mediawiki.org/w/index.php?title=Extension:Wiki2LaTeX/Development/'; $action = '.php&action=raw';

foreach ($files as $file) { $content = file_get_contents($url.$file.$action); $content = trim($content); $content = str_replace(' ', '', $content); $content = trim($content); $file .= '.php'; $proc_file = fopen($file, 'w'); $state = fwrite($proc_file, $content); if ($state === false) { echo "Error with file: ".$file." "; } else { $state = $state/1024; $state = round($state, 2); echo "Success updating file: ".$file." (".$state." Kb written) "; } }