Skip to content

Instantly share code, notes, and snippets.

CODE:
<?php
$header = apache_request_headers();
$request_body = @file_get_contents(STDIN);
$f = fopen('/tmp/test-request' . date('Y-m-d-h:i:s'), 'a+');
fwrite($f, json_encode($header) . PHP_EOL);
$body = file_get_contents('php://input');
fwrite($f, $body . PHP_EOL);
fwrite($f, json_encode($_POST) . PHP_EOL);
fclose($f);
Array
(
[REDIRECT_INDEX_PAGE] => app_stage
[REDIRECT_STATUS] => 200
[INDEX_PAGE] => app_stage
[HTTP_HOST] => inguest-stage.revinate.com
[HTTP_ACCEPT] => */*
[CONTENT_LENGTH] => 1095
[HTTP_EXPECT] => 100-continue
[CONTENT_TYPE] => multipart/form-data; boundary=----------------------------e976ec0e14a7
Array
(
[REDIRECT_INDEX_PAGE] => app
[REDIRECT_STATUS] => 200
[INDEX_PAGE] => app
[HTTP_ACCEPT] => */*
[CONTENT_LENGTH] => 1095
[HTTP_EXPECT] => 100-continue
[CONTENT_TYPE] => multipart/form-data; boundary=----------------------------b83370ced482
199 $em = $this->getEntityManager();
200 try {
201 $em->getConnection()->beginTransaction(); //according http://stackoverflow.com/a/16271223, transaction automatically releases row-level write lock
202 $stays = $this->findMatchingGuestStayImports($property, $importedGuestStay, true /* lock records */);
203 /**
204 * @var GuestStay $firstStay
205 */
206 $firstStay = reset($stays);
207 if (count($stays) > 1) {
208 $em->getConnection()->commit();
{
"query": {
"constant_score": {
"filter": {
"or": [
{
"has_child": {
"query": {
"filtered": {
"query": {