Zdrav?m,
najde se tu n?kdo, kdo by m?l ?as a p?epsal n??e uveden? k?d do podoby pro PHP5? Jedn? se o Webovou Slu?bu pro vyu??v?n? TEXY, vyu??v? knihovnu nuSOAP (v PHP 5 u? je SOAP vol?n? podporov?no, proto by bylo dobr? se z?vislosti na nuSOAP zbavit). Pum??ete mi?
<?php
/* Texy Web Service
* ================
*
* Provides SOAP interface for Texy! syntax convertor.
* Author: Ale? Roub??ek -rarous- (rarous@seznam.cz)
*
*/
require_once("texy-compact.php"); // knihovna Texy!
require_once("nusoap.php"); // knihovna nuSOAP
$ns = "http://texy.info"; // prostor n?zv? slu?by
$server = new soap_server();
$server->configureWSDL('TexyConverter', $ns); // n?zev webov? slu?by
$server->wsdl->schemaTargetNamespace = $ns;
// zve?ejn?n? metody s jej?mi parametry
$server->register(
'PrevedDoXhtml',
array('text' => 'xsd:string'),
array('return' => 'xsd:string'),
$ns
);
$server->register(
'PrevedDoXhtmlR',
array('text' => 'xsd:string',
'utf' => 'xsd:boolean',
'trust' => 'xsd:boolean',
'headingLevel' => 'xsd:integer'
),
array('return' => 'xsd:string'),
$ns
);
// funkce pro z?kladn? form?tov?n? s natvrdo nastaven?mi vlastnostmi
// input string text ? text v Texy! syntaxu
// return string html ? vrac? XHTML k?d
function PrevedDoXhtml($text) {
$texy = &new Texy();
$texy->utf = true;
$texy->trustMode();
$texy->headingModule->top = 3;
$html = $texy->process($text);
return $html;
}
// funkce pro z?kladn? form?tov?n? s voliteln?mi vlastnostmi
// input string text ? text v Texy! syntaxi
// input boolean utf ? m? Texy! pracovat s UTF?
// input boolean trust ? m? Texy! pracovat v d?v?ryhodn?m re?imu nebo v bezpe?n?m
// input integer headingLevel ? nejvy??? ?rove? nadpisu
// return string html ? vrac? XHTML k?d
function PrevedDoXhtmlR($text, $utf, $trust, $headingLevel) {
$texy = &new Texy();
$texy->utf = $utf;
if($trust) $texy->trustMode();
else $texy->safeMode();
$texy->headingModule->top = $headingLevel;
$html = $texy->process($text);
return $html;
}
$server->service($HTTP_RAW_POST_DATA);
?>
D?ky moc za pomoc.