Hi,
I´ve got a serious problem(as always😉):
My script(shortend):
error_reporting(E_ALL);
include(xxx/otherfile.inc.php);
$classsomewhat=&new x;
otherfile.inc.php
class x
{
function ReadLanguageFile($STR_File=CONST_LANG)
{
$STR_ThisFile=@fopen($STR_File,"r");
while ($STR_Line=@fgets($STR_ThisFile,128))
{
if (eregi("^\[[^+$]*\]",$STR_Line))
{
$STR_Line=substr($STR_Line,0,strlen($STR_Line)-1);
$F_STR_tmp=fgets($STR_ThisFile,128);
$this->ARR_LanguageFileEntries[$STR_Line]=substr($F_STR_tmp,0,strlen($F_STR_tmp)-1);
}
else
$this->MSGSRV("Language-file corrupt",FALSE,1);
}
if (empty($this->ARR_LanguageFileEntries)==TRUE)
$this->MSGSRV("Missing Languagefile",FALSE,1);
fclose($STR_ThisFile);
}
function GetLanguageText($STR_Select,$F_APPEND=FALSE)
{
$STR_tmp=$this->ARR_LanguageFileEntries["[".$STR_Select."]"];
if (is_null($STR_tmp)==FALSE)
{
if ($F_APPEND!=FALSE)
return $STR_tmp.'<SPAN class="norm">'.$F_APPEND.'</SPAN>';
else
return $STR_tmp;
}
else
return "IS NULL";
//return FALSE;
}
}//classend
All constants are definied and the file $STR_File/CONST_LANG does exist as it works under windows, only windows. I have just checked it out under linux/unix and $STR_tmp in GetLanguageText("text") is always null. Is it my script or the os or the different php version?😃
the file CONST_LANG looks like this:
[SESS_START_GEN]
sess_start(): Failed to create sessions
[SESS_READ_ID]
sess_read(): Invalid SessionID
[SESS_READ_SQL]
...
[SESS_INVIP]
...
etc and more 300 lines...
so...does somebody know what´s going wrong here?
EDIT: of course I use echo to get the translation-strings like this
echo GetLanguageText("text"); which does return "IS NULL" under linux/unix, just wanted to clarify😉