00001 #!/usr/bin/php
00002 <?
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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 ?>