2015-02-17 15:49:14 +00:00
|
|
|
<?php
|
2024-05-23 07:26:56 +00:00
|
|
|
|
2015-02-17 15:49:14 +00:00
|
|
|
/**
|
2024-05-23 07:26:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-02-17 15:49:14 +00:00
|
|
|
*/
|
|
|
|
namespace OC\Command;
|
|
|
|
|
2024-02-08 10:52:40 +00:00
|
|
|
use OCP\BackgroundJob\QueuedJob;
|
2015-02-17 15:49:14 +00:00
|
|
|
|
|
|
|
class CallableJob extends QueuedJob {
|
|
|
|
protected function run($serializedCallable) {
|
|
|
|
$callable = unserialize($serializedCallable);
|
|
|
|
if (is_callable($callable)) {
|
|
|
|
$callable();
|
|
|
|
} else {
|
|
|
|
throw new \InvalidArgumentException('Invalid serialized callable');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|