> Ну как успехи с выгрузкой реестра запрещённых сайтов??Имеется скрипт на php все работает с 1 форматом выгрузки, кто подскажет где надо подредактировать ver num чтоб пошла выгрузка 2 версии, увы я нуб php незнаю((.
!/usr/bin/php
<?php
echo "##############################\n### Vigryzka!!!! ###\n##############################\n\n";
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl',0);
$date = date("Y-m-d");
$time = date("H:i:s");
$wsdl = "http://vigruzki.rkn.gov.ru/services/OperatorRequest/?wsdl&qu...
$ossl = "";
$fold = "/usr/zapretinfo/";
$fP12 = "{$fold}p12.pem";
$fZapros = "{$fold}zapros.xml";
$fSigned = "{$fold}zapros.sig";
$fZip = "{$fold}zapros.zip";
$xml = "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\n";
$xml .= "<request>\n";
$xml .= "\t<requestTime>{$date}T{$time}.000+04:00</requestTime>\n";
$xml .= "\t<operatorName>blablabla"</operatorName>\n";
$xml .= "\t<inn>blablabla</inn>\n";
$xml .= "\t<ogrn>blablabla</ogrn>\n";
$xml .= "\t<email>blablabla</email>\n";
$xml .= "</request>";
$xml = iconv("utf-8", "cp1251", $xml);
if(file_put_contents($fZapros, $xml)) {
echo "==> File request created...\n";
if(file_exists($fSigned)) {
$removeSign = shell_exec("rm {$fSigned}");
}
$cmd = shell_exec("/usr/local/openssl/bin/openssl smime -sign -in {$fZapros} -out {$fSigned} -binary -signer {$fP12} -outform DER -nodetach");
if($cmd == "") {
echo "==> Signing created...\n";
}else{
echo "==> Error: {$cmd}\n";
}
}else{
echo "==> File not created!\n";
}
if(file_exists($fZapros) && file_exists($fSigned)) {
// dump.xml
if($client = new SoapClient($wsdl, array('features' => SOAP_USE_XSI_ARRAY_TYPE))) {
$dataRequest = array(
'requestFile'=>file_get_contents($fZapros),
'signatureFile'=>base64_encode(file_get_contents($fSigned))
);
$request = $client -> sendRequest($dataRequest);
if($request->result) {
$codeResult = $request->code;
echo "==> Request accepted (code:{$codeResult})...\n==> Waiting..";
for($i=1;;$i++) {
$dump = $client -> getResult(array('code'=>$codeResult));
if($dump->result) {
file_put_contents($fZip, $dump->registerZipArchive);
shell_exec("unzip {$fZip} -d {$fold}");
shell_exec("rm {$fold}dump.xml.sig {$fZapros} {$fSigned} {$fZip}");
shell_exec("mv {$fold}dump.xml {$fold}dumps/{$date}_{$time}_dump.xml");
echo "\n==> Dump accepted...\n\n";
break;
}else{
echo ".";
sleep(120);
continue;
}
}
}else{
echo "==> ".$request->resultComment."\n";
echo "==> Request dont accepted!\n";
}
}else{
echo "==> Dont start client!\n";
}
}else{
echo "==> Files {$fZapros} and {$fSigned} not exists!\n";
}
if(file_exists('dump.xml')) {
//end XML
}
?>