import.php

Go to the documentation of this file.
00001 #!/usr/bin/php
00002 <?
00003 /***************************************************************************
00004  *   Copyright (C) 2005 by Ferenc Veres   *
00005  *   lion@netngine.hu   *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 if(empty($argc))
00023 {
00024         exit;
00025 }
00026 include_once('config.inc.php');
00027 include_once('import/TranslationImport.php');
00028 include_once('lib/Common.php');
00029 
00030 $DB = NewADOConnection(GetConfigVar('db_software'));
00031 $DB->Connect(GetConfigVar('db_host'), GetConfigVar('db_username') , GetConfigVar('db_password'), GetConfigVar('db_database'));
00032 $DB->Execute("SET NAMES utf8");
00033 CacheIndexes();
00034 
00035 // To import a translaiton
00036 
00037 if($argc != 3 || empty(TranslationProject::$LocaleIDCache[$argv[2]]))
00038 {
00039         echo "Usage: import.php projecttype localename\n";
00040         echo "Known project types:\n";
00041         echo " Xaraya\n";
00042         echo "Known locales:\n";
00043         foreach(TranslationProject::$LocaleIDCache as $name => $id)
00044         {
00045                 echo " $name\n";
00046         }
00047         exit;
00048 }
00049 
00050 $factory = new CreateImporter();
00051 $proc = $factory->NewImporter($argv[1]);
00052 $proc->Import($argv[2]);
00053 
00054 ?>

Generated on Tue Mar 20 00:42:40 2007 for XarayaTranslationMemory by  doxygen 1.4.7