| 1 | <?php␊ |
| 2 | /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */␊ |
| 3 | /*␊ |
| 4 | # ***** BEGIN LICENSE BLOCK *****␊ |
| 5 | # This file is part of Plume Framework, a simple PHP Application Framework.␊ |
| 6 | # Copyright (C) 2001-2007 Loic d'Anterroches and contributors.␊ |
| 7 | #␊ |
| 8 | # Plume Framework is free software; you can redistribute it and/or modify␊ |
| 9 | # it under the terms of the GNU Lesser General Public License as published by␊ |
| 10 | # the Free Software Foundation; either version 2.1 of the License, or␊ |
| 11 | # (at your option) any later version.␊ |
| 12 | #␊ |
| 13 | # Plume Framework is distributed in the hope that it will be useful,␊ |
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of␊ |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the␊ |
| 16 | # GNU Lesser General Public License for more details.␊ |
| 17 | #␊ |
| 18 | # You should have received a copy of the GNU Lesser General Public License␊ |
| 19 | # along with this program; if not, write to the Free Software␊ |
| 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA␊ |
| 21 | #␊ |
| 22 | # ***** END LICENSE BLOCK ***** */␊ |
| 23 | ␊ |
| 24 | /**␊ |
| 25 | * Migration script.␊ |
| 26 | */␊ |
| 27 | set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__));␊ |
| 28 | require 'Pluf.php';␊ |
| 29 | ␊ |
| 30 | function usage()␊ |
| 31 | {␊ |
| 32 | echo 'Usage examples:'."\n"␊ |
| 33 | .' Extract all: extracttemplates.php path/to/config.php path/to/outpudir'."\n";␊ |
| 34 | ␊ |
| 35 | }␊ |
| 36 | function debug($what)␊ |
| 37 | {␊ |
| 38 | global $debug;␊ |
| 39 | if ($debug) {␊ |
| 40 | echo($what."\n");␊ |
| 41 | }␊ |
| 42 | }␊ |
| 43 | ␊ |
| 44 | if ($argc !== 3) {␊ |
| 45 | usage();␊ |
| 46 | die();␊ |
| 47 | }␊ |
| 48 | $conf = $argv[1];␊ |
| 49 | $outputdir = $argv[2];␊ |
| 50 | Pluf::start($conf);␊ |
| 51 | $generator = new Pluf_Translation_Generator();␊ |
| 52 | $generator->generate($outputdir);␊ |
| 53 | echo 'Done', "\n"; |