2 changed files with 134 additions and 80 deletions
@ -1,67 +1,37 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
// $english = mysql_escape_string($_REQUEST['translate']);
|
|
||||
// Der Service ist zur Zeit leider deaktiviert....
|
|
||||
// $trans = new SoapClient(
|
|
||||
// "http://www.xmethods.net/sd/2001/BabelFishService.wsdl");
|
|
||||
|
|
||||
/* |
|
||||
try |
|
||||
{ |
|
||||
$german = $trans->BabelFish("en_de",$english); |
|
||||
$french = $trans->BabelFish("en_fr",$english); |
|
||||
} |
|
||||
catch(SoapFault $e) |
|
||||
{ |
|
||||
$english = "not found"; |
|
||||
$german = "not found"; |
|
||||
$french = "not found"; |
|
||||
} |
|
||||
*/ |
|
||||
class dummy |
|
||||
{ |
|
||||
// nur public member werden via json verschickt.
|
|
||||
public $german; |
|
||||
public $english; |
|
||||
public $french; |
|
||||
|
|
||||
function __construct ($english, $german, $french) |
|
||||
{ |
|
||||
$this->german = $german; |
|
||||
$this->english = $english; |
|
||||
$this->french["val1"] = $french; |
|
||||
$this->french["val2"] = "jokus"; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$encoding = FALSE; |
|
||||
if (isset ($_SERVER['HTTP_ACCEPT_ENCODING']) && |
|
||||
strpos ($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) |
|
||||
$encoding = "x-gzip"; |
|
||||
if (isset ($_SERVER['HTTP_ACCEPT_ENCODING']) && |
|
||||
strpos ($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) |
|
||||
$encoding = "gzip"; |
|
||||
|
|
||||
header ('Content-type: text/plain'); |
|
||||
|
|
||||
$result = FALSE; |
|
||||
if ($encoding !== FALSE) |
|
||||
$result = gzcompress (json_encode (new dummy ( |
|
||||
'doing gzip', 'gezipedte Daten', 'la zippo'))); |
|
||||
|
|
||||
if ($result !== FALSE) |
|
||||
{ |
|
||||
header ('Content-Encoding: ' . $encoding); |
|
||||
|
|
||||
print ("\x1f\x8b\x08\x00\x00\x00\x00\x00"); |
|
||||
print ($result); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
$result = json_encode (new dummy ( |
|
||||
'doing no gzip', 'nicht gezipedte Daten', 'no la zippo')); |
|
||||
|
|
||||
print ($result); |
|
||||
} |
|
||||
|
require_once dirname(__FILE__) . '/../config.php'; |
||||
|
require_once LIBDIR . 'c_personAdmin.php'; |
||||
|
require_once LIBDIR . 'c_xmlify.php'; |
||||
|
|
||||
|
$personAdmin = new c_personAdmin (); |
||||
|
$persons = xmlify ($personAdmin->getPersons ()); |
||||
|
$p = deXmlify ($persons); |
||||
|
|
||||
|
exit (1); |
||||
|
|
||||
|
$encoding = FALSE; |
||||
|
if (isset ($_SERVER['HTTP_ACCEPT_ENCODING']) && |
||||
|
strpos ($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) |
||||
|
$encoding = "x-gzip"; |
||||
|
if (isset ($_SERVER['HTTP_ACCEPT_ENCODING']) && |
||||
|
strpos ($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) |
||||
|
$encoding = "gzip"; |
||||
|
|
||||
|
header ('Content-type: text/xml'); |
||||
|
|
||||
|
$result = FALSE; |
||||
|
if ($encoding !== FALSE) |
||||
|
$result = gzcompress ($persons); |
||||
|
|
||||
|
if ($result !== FALSE) |
||||
|
{ |
||||
|
header ('Content-Encoding: ' . $encoding); |
||||
|
|
||||
|
print ("\x1f\x8b\x08\x00\x00\x00\x00\x00"); |
||||
|
print ($result); |
||||
|
} |
||||
|
else |
||||
|
print ($persons); |
||||
|
|
||||
?>
|
?>
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue