Recently I ran into a problem – my current method of transferring language strings across multiple sites used up too much memory. Basically I simply created an array of data on one server and echoed it out with json.
E.g. –
$data = array(1, 2, 3);
echo json_encode($data);
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2302769209 bytes) in [..]
The main idea is to transfer language strings from a language editor to my site as soon as my client clicks update.
The thing is, this x-fer is going on quite frequently (as soon as my client clicks the update button on the site) and it’d be hard to do always do it by hand.
So my question is:
How do you transfer such a large array of data across multiple sites?
Obviously, my solution wasn’t good enough.
I had some experience with such questions. Simple way to fix your problem is to split that array for some requests.