Common.php

Go to the documentation of this file.
00001 <?
00002 /***************************************************************************
00003  *   Copyright (C) 2005 by Ferenc Veres   *
00004  *   lion@kempelen.szodliget.tvnet.hu   *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  *   This program is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU General Public License for more details.                          *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this program; if not, write to the                         *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00020  ***************************************************************************/
00021 include_once('/usr/share/php-adodb/adodb-exceptions.inc.php');
00022 include_once('/usr/share/php-adodb/adodb.inc.php');
00023 
00024 include_once('TranslationProject.php');
00025 include_once('TranslationString.php');
00026 include_once('TranslationWordList.php');
00027 include_once('TranslationWord.php');
00028 include_once('ProjectIterator.php');
00029 include_once('StringIterator.php');
00030 
00038 function fixstr($text)
00039 {
00040         return str_replace("'", "''", $text);
00041 }
00042 
00051 function FixQuot($text)
00052 {
00053         $s = str_replace("&", "&amp;", $text);
00054         $s = str_replace("\"", "&quot;", $s);
00055         $s = str_replace("<", "&lt;", $s);
00056         $s = str_replace(">", "&gt;", $s);
00057         return $s;
00058 }
00063 function &GetDbConn()
00064 {
00065         global $DB;
00066         return $DB;
00067 }
00068 
00073 function &GetTables()
00074 {
00075         $tables["WordIndex"] = "WordIndex";
00076         $tables["SentenceIndex"] = "SentenceIndex";
00077         $tables["Strings"] = "Strings";
00078         $tables["Projects"] = "Projects";
00079         $tables["Locales"] = "Locales";
00080         return $tables;
00081 }
00082 
00086 function GetConfigVar($varName)
00087 {
00088         global $CONFIG;
00089         return $CONFIG[$varName];
00090 }
00091 
00096 function CacheIndexes()
00097 {
00098         TranslationString::InitSentenceLengthCache();
00099         //TranslationString::InitWordSentencesCache();
00100         TranslationWordList::InitWordsCache();
00101         TranslationProject::InitLocaleIDCache();
00102 }
00103 ?>

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