GD Star Rating
loading...
Es ist schon toll, nach kurzer stundenlanger Fehlersuche, weshalb eine von einem Plugin benötigte Funktion nicht vorhanden ist festzustellen, das der gesammte Funktionssatz in PHP5 kurzerhand in ein Objektbasierte Lösung gepackt wurde und somit nichts so funktioniert, wie man eigentlich angestrebt hat.
Aber gemäss meinem Motto: “Geht nicht, gibts nicht” fand sich auch hier schnell eine Lösung um das angestrebte Ziel dann letztenendes doch noch zu erreichen, wie man rechts in der Sidebar anhand der T4E News unschwer erkennen kann.
Hier die Lösung aus den PHP Kommentaren:
< ?php
if (PHP_VERSION >= 5) {
// Emulate the old xslt library functions
function xslt_create() {
return new XsltProcessor();
}
function xslt_process($xsltproc,
$xml_arg,
$xsl_arg,
$xslcontainer = null,
$args = null,
$params = null) {
// Start with preparing the arguments
$xml_arg = str_replace('arg:', '', $xml_arg);
$xsl_arg = str_replace('arg:', '', $xsl_arg);
// Create instances of the DomDocument class
$xml = new DomDocument;
$xsl = new DomDocument;
// Load the xml document and the xsl template
$xml->loadXML($args[$xml_arg]);
$xsl->loadXML($args[$xsl_arg]);
// Load the xsl template
$xsltproc->importStyleSheet($xsl);
// Set parameters when defined
if ($params) {
foreach ($params as $param => $value) {
$xsltproc->setParameter("", $param, $value);
}
}
// Start the transformation
$processed = $xsltproc->transformToXML($xml);
// Put the result in a file when specified
if ($xslcontainer) {
return @file_put_contents($xslcontainer, $processed);
} else {
return $processed;
}
}
function xslt_free($xsltproc) {
unset($xsltproc);
}
}
?>
Ich befürchte hoffe mit den zukünftigen Plugins werde ich mindestens genausoviel Spaß haben :-/