Hello,
I have problem with using save() with long text data. In my database json field is set as LONGTEXT. JSON with length 100.000 are saved correctly but save() is not working when json is nearly 1.000.000 Iong. have following code for saving json to database:
<?php
$json = json_decode(file_get_contents('php://input'),true);
$events = $data['events'];
foreach ($events as $event) {
if($event['type'] != 'aggregate') continue;
$query = new Backup();
$query->json = json_encode($event);
$this->logger("Starting Saving JSON");
if ($query->save()) {
$this->logger("JSON was saved.");
echo "Great, a new data: $query->id was saved successfully!", "\n";
return $query->id;
} else {
$this->logger("JSON was not saved.");
$messages = '';
foreach ($query->getMessages() as $message) {
$messages .= $message->getMessage();
}
echo "Umh, We can't store data right now. Reason: " . $messages;
}
}
?>
With JSON longer than 1.000.000 I don't get logs after:
<?php
$this->logger("Starting Saving JSON");
?>
What could be wrong there?