Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

import.php

Go to the documentation of this file.
00001 #!/usr/local/php512/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 CacheIndexes();
00033 
00034 // To import a translaiton
00035 
00036 if($argc != 3 || empty(TranslationProject::$LocaleIDCache[$argv[2]]))
00037 {
00038         echo "Usage: import.php projecttype localename\n";
00039         echo "Known project types:\n";
00040         echo " Xaraya\n";
00041         echo "Known locales:\n";
00042         foreach(TranslationProject::$LocaleIDCache as $name => $id)
00043         {
00044                 echo " $name\n";
00045         }
00046         exit;
00047 }
00048 
00049 $factory = new CreateImporter();
00050 $proc = $factory->NewImporter($argv[1]);
00051 $proc->Import($argv[2]);
00052 
00053 ?>

Generated on Sat Apr 22 16:49:53 2006 for XarayaTranslationMemory by  doxygen 1.4.4