Ho spostato un'applicazione da un server Ubuntu 11.04 (Natty Narwhal) a un server Red Hat Enterprise Linux (RHEL) durante il fine settimana. Il mio registro errori è pieno di errori PHP nella riga dell'oggetto fanno riferimento alla seguente funzione:T_PAAMAYIM_NEKUDOTAYIM inatteso, in attesa di T_NS_Separator
function wfTalkHereArticleFromTitle(&$title, &$article) {
global $wgRequest, $wgTalkHereNamespaces;
if (isset($title->noTalkHere))
return true; //Stop recursion
$action = $wgRequest->getVal('action' );
$oldid = $wgRequest->getVal('oldid' );
$diff = $wgRequest->getVal('diff' );
if ($action == 'purge')
$action = NULL; //"purge" is not considered an action in this context
if ($action || $oldid || $diff)
return true;
$ns = $title->getNamespace();
if (!Namespace::isTalk($ns) && Namespace::canTalk($ns) && $title->exists()
&& (!$wgTalkHereNamespaces || in_array($ns, $wgTalkHereNamespaces))) {
$tns = Namespace::getTalk($ns);
$talk = Title::makeTitle($tns, $title->getDBKey());
if ($talk && $talk->userCan('read')) {
$t = clone $title;
$t->noTalkHere = true; //Stop recursion
$a = MediaWiki::articleFromTitle($t);
$article = new TalkHereArticle($a, $talk);
}
}
return true;
}
L'errore è gettato nella dichiarazione
If (!Namespace::isTalk($ns)
. Questo errore è nuovo per me. Come potrei risolverlo?
ho cambiato il codice incriminato per:
if (!Ns::isTalk($ns) && Ns::canTalk($ns) && $title->exists()
&& (!$wgTalkHereNamespaces || in_array($ns, $wgTalkHereNamespaces))) {
$tns = Ns::getTalk($ns);
$talk = Title::makeTitle($tns, $title->getDBKey());
if ($talk && $talk->userCan('read')) {
$t = clone $title;
$t->noTalkHere = true; //Stop recursion
$a = MediaWiki::articleFromTitle($t);
$article = new TalkHereArticle($a, $talk);
}
}
return true;
Vorrei che sufficiente per correggere l'errore, almeno in questo file?
@Charles hehe l'errore non sia stato digitato correttamente :-P – Neal
Tra l'altro, l'errore è in realtà scritto "PAAMAYIM NEKUDOTAYIM" (utile per quando su Google). Come Neal menziona, "PAAMAYIM NEKUDOTAYIM" è in ebraico per doppio colon (gli autori originali di PHP erano israeliani). –
Pfft, sono un tag facist, non un nazionalista. – Charles