00001 #!/usr/local/php512/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 CacheIndexes();
00033
00034
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 ?>