class ClosureJob extends QueuedJob {
protected function run($serializedCallable) {
- $callable = \Opis\Closure\unserialize($serializedCallable);
+ $callable = unserialize($serializedCallable)->getClosure();
if (is_callable($callable)) {
$callable();
} else {
*/
class CommandJob extends QueuedJob {
protected function run($serializedCommand) {
- $command = \Opis\Closure\unserialize($serializedCommand);
+ $command = unserialize($serializedCommand);
if ($command instanceof ICommand) {
$command->handle();
} else {
namespace OC\Command;
use OCP\Command\ICommand;
+use Laravel\SerializableClosure\SerializableClosure;
class CronBus extends AsyncBus {
/**
*/
private function serializeCommand($command) {
if ($command instanceof \Closure) {
- return \Opis\Closure\serialize($command);
+ return serialize(new SerializableClosure($command));
} elseif (is_callable($command) or $command instanceof ICommand) {
- return \Opis\Closure\serialize($command);
+ return serialize($command);
} else {
throw new \InvalidArgumentException('Invalid command');
}