php - Sharing complex objects across controller methods Laravel 5.1 -
given following scenario:
controller@method_a
spawns process (symfony process object) asynchronously, controller@method_b
needs interact process
how implement sharing process object?
things i've went over:
- controller properties don't persist, each request controller gets reinstantiated
- session can't store complex objects, , serialization take soul of it
- database can't store complex objects either
edit:
to serialization issue:
$process = new process("dir"); $process->start(); $x = serialize($process); dd($x);
if remove $process->start()
, not fire serialization of 'closure' not allowed
. can't handle process that's not started.
i guess option here serialize object , persist somewhere (db, session, file). in next request, pull , unserialize.
Comments
Post a Comment