Linux cli で Amazon MWS php API を使用している場合、コードは大量の bebug 情報を返します - 出力は次で始まります:-
About to connect() to mws.amazonservices.co.uk port 443 (#0)
Trying 178.236.4.102... connected
Connected to mws.amazonservices.co.uk (178.236.4.102) port 443 (#0)
Initializing NSS with cer....
実際の PHP コードは次のとおりです。
include_once ('MarketplaceWebService/.config.inc.php');
function SubmitFeed(MarketplaceWebService_Interface $service, $request)
{
try {
$response = $service->submitFeed($request);
if ($response->isSetSubmitFeedResult()) {
$submitFeedResult = $response->getSubmitFeedResult();
if ($submitFeedResult->isSetFeedSubmissionInfo()) {
$feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
if ($feedSubmissionInfo->isSetFeedSubmissionId())
{
return $feedSubmissionInfo->getFeedSubmissionId();
}
}
}
} catch (MarketplaceWebService_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "\n"); echo("Response Status Code: " . $ex->getStatusCode() . "\n");
echo("Error Code: " . $ex->getErrorCode() . "\n"); echo("Error Type: " . $ex->getErrorType() . "\n");
echo("Request ID: " . $ex->getRequestId() . "\n"); echo("XML: " . $ex->getXML() . "\n");
echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
}
}
$xml = '<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>xxxxxxxxxx</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Inventory>
<SKU>VWDTA29E</SKU>
<Quantity>41</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>';
$xmlHandle = @fopen('php://temp', 'rw+');
fwrite($xmlHandle, $xml);
rewind($xmlHandle);
$md5 = base64_encode(md5(stream_get_contents($xmlHandle), true));
$parameters = array (
'Merchant' => MERCHANT_ID,
'FeedType' => '_POST_INVENTORY_AVAILABILITY_DATA_',
'FeedContent' => $xmlHandle,
'PurgeAndReplace' => false,
'ContentMd5' => $md5,
);
$request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
echo $feedsubmissionid = SubmitFeed($service, $request);
これは本番環境ではなくテストでのみ役立つため、この情報が表示されないようにするにはどうすればよいですか?
乾杯