@@ -134,7 +134,7 @@ |
||
134 | 134 | } |
135 | 135 | if(is_dir($source.'/'.$file)) { |
136 | 136 | $this->addRecursive($path.'/'.$file, $source.'/'.$file); |
137 | - }else{ |
|
137 | + } else{ |
|
138 | 138 | $this->addFile($path.'/'.$file, $source.'/'.$file); |
139 | 139 | } |
140 | 140 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param string $source either a local file or string data |
50 | 50 | * @return bool |
51 | 51 | */ |
52 | - public abstract function addFile($path, $source=''); |
|
52 | + public abstract function addFile($path, $source = ''); |
|
53 | 53 | /** |
54 | 54 | * rename a file or folder in the archive |
55 | 55 | * @param string $source |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function addRecursive($path, $source) { |
128 | 128 | $dh = opendir($source); |
129 | - if(is_resource($dh)) { |
|
129 | + if (is_resource($dh)) { |
|
130 | 130 | $this->addFolder($path); |
131 | 131 | while (($file = readdir($dh)) !== false) { |
132 | - if($file === '.' || $file === '..') { |
|
132 | + if ($file === '.' || $file === '..') { |
|
133 | 133 | continue; |
134 | 134 | } |
135 | - if(is_dir($source.'/'.$file)) { |
|
135 | + if (is_dir($source.'/'.$file)) { |
|
136 | 136 | $this->addRecursive($path.'/'.$file, $source.'/'.$file); |
137 | - }else{ |
|
137 | + } else { |
|
138 | 138 | $this->addFile($path.'/'.$file, $source.'/'.$file); |
139 | 139 | } |
140 | 140 | } |
@@ -31,110 +31,110 @@ |
||
31 | 31 | namespace OC\Archive; |
32 | 32 | |
33 | 33 | abstract class Archive { |
34 | - /** |
|
35 | - * @param $source |
|
36 | - */ |
|
37 | - public abstract function __construct($source); |
|
38 | - /** |
|
39 | - * add an empty folder to the archive |
|
40 | - * @param string $path |
|
41 | - * @return bool |
|
42 | - */ |
|
43 | - public abstract function addFolder($path); |
|
44 | - /** |
|
45 | - * add a file to the archive |
|
46 | - * @param string $path |
|
47 | - * @param string $source either a local file or string data |
|
48 | - * @return bool |
|
49 | - */ |
|
50 | - public abstract function addFile($path, $source=''); |
|
51 | - /** |
|
52 | - * rename a file or folder in the archive |
|
53 | - * @param string $source |
|
54 | - * @param string $dest |
|
55 | - * @return bool |
|
56 | - */ |
|
57 | - public abstract function rename($source, $dest); |
|
58 | - /** |
|
59 | - * get the uncompressed size of a file in the archive |
|
60 | - * @param string $path |
|
61 | - * @return int |
|
62 | - */ |
|
63 | - public abstract function filesize($path); |
|
64 | - /** |
|
65 | - * get the last modified time of a file in the archive |
|
66 | - * @param string $path |
|
67 | - * @return int |
|
68 | - */ |
|
69 | - public abstract function mtime($path); |
|
70 | - /** |
|
71 | - * get the files in a folder |
|
72 | - * @param string $path |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - public abstract function getFolder($path); |
|
76 | - /** |
|
77 | - * get all files in the archive |
|
78 | - * @return array |
|
79 | - */ |
|
80 | - public abstract function getFiles(); |
|
81 | - /** |
|
82 | - * get the content of a file |
|
83 | - * @param string $path |
|
84 | - * @return string |
|
85 | - */ |
|
86 | - public abstract function getFile($path); |
|
87 | - /** |
|
88 | - * extract a single file from the archive |
|
89 | - * @param string $path |
|
90 | - * @param string $dest |
|
91 | - * @return bool |
|
92 | - */ |
|
93 | - public abstract function extractFile($path, $dest); |
|
94 | - /** |
|
95 | - * extract the archive |
|
96 | - * @param string $dest |
|
97 | - * @return bool |
|
98 | - */ |
|
99 | - public abstract function extract($dest); |
|
100 | - /** |
|
101 | - * check if a file or folder exists in the archive |
|
102 | - * @param string $path |
|
103 | - * @return bool |
|
104 | - */ |
|
105 | - public abstract function fileExists($path); |
|
106 | - /** |
|
107 | - * remove a file or folder from the archive |
|
108 | - * @param string $path |
|
109 | - * @return bool |
|
110 | - */ |
|
111 | - public abstract function remove($path); |
|
112 | - /** |
|
113 | - * get a file handler |
|
114 | - * @param string $path |
|
115 | - * @param string $mode |
|
116 | - * @return resource |
|
117 | - */ |
|
118 | - public abstract function getStream($path, $mode); |
|
119 | - /** |
|
120 | - * add a folder and all its content |
|
121 | - * @param string $path |
|
122 | - * @param string $source |
|
123 | - */ |
|
124 | - public function addRecursive($path, $source) { |
|
125 | - $dh = opendir($source); |
|
126 | - if(is_resource($dh)) { |
|
127 | - $this->addFolder($path); |
|
128 | - while (($file = readdir($dh)) !== false) { |
|
129 | - if($file === '.' || $file === '..') { |
|
130 | - continue; |
|
131 | - } |
|
132 | - if(is_dir($source.'/'.$file)) { |
|
133 | - $this->addRecursive($path.'/'.$file, $source.'/'.$file); |
|
134 | - }else{ |
|
135 | - $this->addFile($path.'/'.$file, $source.'/'.$file); |
|
136 | - } |
|
137 | - } |
|
138 | - } |
|
139 | - } |
|
34 | + /** |
|
35 | + * @param $source |
|
36 | + */ |
|
37 | + public abstract function __construct($source); |
|
38 | + /** |
|
39 | + * add an empty folder to the archive |
|
40 | + * @param string $path |
|
41 | + * @return bool |
|
42 | + */ |
|
43 | + public abstract function addFolder($path); |
|
44 | + /** |
|
45 | + * add a file to the archive |
|
46 | + * @param string $path |
|
47 | + * @param string $source either a local file or string data |
|
48 | + * @return bool |
|
49 | + */ |
|
50 | + public abstract function addFile($path, $source=''); |
|
51 | + /** |
|
52 | + * rename a file or folder in the archive |
|
53 | + * @param string $source |
|
54 | + * @param string $dest |
|
55 | + * @return bool |
|
56 | + */ |
|
57 | + public abstract function rename($source, $dest); |
|
58 | + /** |
|
59 | + * get the uncompressed size of a file in the archive |
|
60 | + * @param string $path |
|
61 | + * @return int |
|
62 | + */ |
|
63 | + public abstract function filesize($path); |
|
64 | + /** |
|
65 | + * get the last modified time of a file in the archive |
|
66 | + * @param string $path |
|
67 | + * @return int |
|
68 | + */ |
|
69 | + public abstract function mtime($path); |
|
70 | + /** |
|
71 | + * get the files in a folder |
|
72 | + * @param string $path |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + public abstract function getFolder($path); |
|
76 | + /** |
|
77 | + * get all files in the archive |
|
78 | + * @return array |
|
79 | + */ |
|
80 | + public abstract function getFiles(); |
|
81 | + /** |
|
82 | + * get the content of a file |
|
83 | + * @param string $path |
|
84 | + * @return string |
|
85 | + */ |
|
86 | + public abstract function getFile($path); |
|
87 | + /** |
|
88 | + * extract a single file from the archive |
|
89 | + * @param string $path |
|
90 | + * @param string $dest |
|
91 | + * @return bool |
|
92 | + */ |
|
93 | + public abstract function extractFile($path, $dest); |
|
94 | + /** |
|
95 | + * extract the archive |
|
96 | + * @param string $dest |
|
97 | + * @return bool |
|
98 | + */ |
|
99 | + public abstract function extract($dest); |
|
100 | + /** |
|
101 | + * check if a file or folder exists in the archive |
|
102 | + * @param string $path |
|
103 | + * @return bool |
|
104 | + */ |
|
105 | + public abstract function fileExists($path); |
|
106 | + /** |
|
107 | + * remove a file or folder from the archive |
|
108 | + * @param string $path |
|
109 | + * @return bool |
|
110 | + */ |
|
111 | + public abstract function remove($path); |
|
112 | + /** |
|
113 | + * get a file handler |
|
114 | + * @param string $path |
|
115 | + * @param string $mode |
|
116 | + * @return resource |
|
117 | + */ |
|
118 | + public abstract function getStream($path, $mode); |
|
119 | + /** |
|
120 | + * add a folder and all its content |
|
121 | + * @param string $path |
|
122 | + * @param string $source |
|
123 | + */ |
|
124 | + public function addRecursive($path, $source) { |
|
125 | + $dh = opendir($source); |
|
126 | + if(is_resource($dh)) { |
|
127 | + $this->addFolder($path); |
|
128 | + while (($file = readdir($dh)) !== false) { |
|
129 | + if($file === '.' || $file === '..') { |
|
130 | + continue; |
|
131 | + } |
|
132 | + if(is_dir($source.'/'.$file)) { |
|
133 | + $this->addRecursive($path.'/'.$file, $source.'/'.$file); |
|
134 | + }else{ |
|
135 | + $this->addFile($path.'/'.$file, $source.'/'.$file); |
|
136 | + } |
|
137 | + } |
|
138 | + } |
|
139 | + } |
|
140 | 140 | } |
@@ -25,14 +25,14 @@ |
||
25 | 25 | namespace OC; |
26 | 26 | |
27 | 27 | class NaturalSort_DefaultCollator { |
28 | - public function compare($a, $b) { |
|
29 | - $result = strcasecmp($a, $b); |
|
30 | - if ($result === 0) { |
|
31 | - if ($a === $b) { |
|
32 | - return 0; |
|
33 | - } |
|
34 | - return ($a > $b) ? -1 : 1; |
|
35 | - } |
|
36 | - return ($result < 0) ? -1 : 1; |
|
37 | - } |
|
28 | + public function compare($a, $b) { |
|
29 | + $result = strcasecmp($a, $b); |
|
30 | + if ($result === 0) { |
|
31 | + if ($a === $b) { |
|
32 | + return 0; |
|
33 | + } |
|
34 | + return ($a > $b) ? -1 : 1; |
|
35 | + } |
|
36 | + return ($result < 0) ? -1 : 1; |
|
37 | + } |
|
38 | 38 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function execute($jobList, ILogger $logger = null) { |
59 | 59 | // add an interval of 15 mins |
60 | - $this->setInterval(15*60); |
|
60 | + $this->setInterval(15 * 60); |
|
61 | 61 | |
62 | 62 | $this->jobList = $jobList; |
63 | 63 | $this->logger = $logger; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | try { |
91 | 91 | $repair->addStep($step); |
92 | 92 | } catch (\Exception $ex) { |
93 | - $this->logger->logException($ex,[ |
|
93 | + $this->logger->logException($ex, [ |
|
94 | 94 | 'app' => 'migration' |
95 | 95 | ]); |
96 | 96 |
@@ -39,82 +39,82 @@ |
||
39 | 39 | */ |
40 | 40 | class BackgroundRepair extends TimedJob { |
41 | 41 | |
42 | - /** @var IJobList */ |
|
43 | - private $jobList; |
|
44 | - |
|
45 | - /** @var ILogger */ |
|
46 | - private $logger; |
|
47 | - |
|
48 | - /** @var EventDispatcherInterface */ |
|
49 | - private $dispatcher; |
|
50 | - |
|
51 | - public function __construct(EventDispatcherInterface $dispatcher) { |
|
52 | - $this->dispatcher = $dispatcher; |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * run the job, then remove it from the job list |
|
57 | - * |
|
58 | - * @param JobList $jobList |
|
59 | - * @param ILogger|null $logger |
|
60 | - */ |
|
61 | - public function execute($jobList, ILogger $logger = null) { |
|
62 | - // add an interval of 15 mins |
|
63 | - $this->setInterval(15*60); |
|
64 | - |
|
65 | - $this->jobList = $jobList; |
|
66 | - $this->logger = $logger; |
|
67 | - parent::execute($jobList, $logger); |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * @param array $argument |
|
72 | - * @throws \Exception |
|
73 | - * @throws \OC\NeedsUpdateException |
|
74 | - */ |
|
75 | - protected function run($argument) { |
|
76 | - if (!isset($argument['app']) || !isset($argument['step'])) { |
|
77 | - // remove the job - we can never execute it |
|
78 | - $this->jobList->remove($this, $this->argument); |
|
79 | - return; |
|
80 | - } |
|
81 | - $app = $argument['app']; |
|
82 | - |
|
83 | - try { |
|
84 | - $this->loadApp($app); |
|
85 | - } catch (NeedsUpdateException $ex) { |
|
86 | - // as long as the app is not yet done with it's offline migration |
|
87 | - // we better not start with the live migration |
|
88 | - return; |
|
89 | - } |
|
90 | - |
|
91 | - $step = $argument['step']; |
|
92 | - $repair = new Repair([], $this->dispatcher); |
|
93 | - try { |
|
94 | - $repair->addStep($step); |
|
95 | - } catch (\Exception $ex) { |
|
96 | - $this->logger->logException($ex,[ |
|
97 | - 'app' => 'migration' |
|
98 | - ]); |
|
99 | - |
|
100 | - // remove the job - we can never execute it |
|
101 | - $this->jobList->remove($this, $this->argument); |
|
102 | - return; |
|
103 | - } |
|
104 | - |
|
105 | - // execute the repair step |
|
106 | - $repair->run(); |
|
107 | - |
|
108 | - // remove the job once executed successfully |
|
109 | - $this->jobList->remove($this, $this->argument); |
|
110 | - } |
|
111 | - |
|
112 | - /** |
|
113 | - * @codeCoverageIgnore |
|
114 | - * @param $app |
|
115 | - * @throws NeedsUpdateException |
|
116 | - */ |
|
117 | - protected function loadApp($app) { |
|
118 | - OC_App::loadApp($app); |
|
119 | - } |
|
42 | + /** @var IJobList */ |
|
43 | + private $jobList; |
|
44 | + |
|
45 | + /** @var ILogger */ |
|
46 | + private $logger; |
|
47 | + |
|
48 | + /** @var EventDispatcherInterface */ |
|
49 | + private $dispatcher; |
|
50 | + |
|
51 | + public function __construct(EventDispatcherInterface $dispatcher) { |
|
52 | + $this->dispatcher = $dispatcher; |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * run the job, then remove it from the job list |
|
57 | + * |
|
58 | + * @param JobList $jobList |
|
59 | + * @param ILogger|null $logger |
|
60 | + */ |
|
61 | + public function execute($jobList, ILogger $logger = null) { |
|
62 | + // add an interval of 15 mins |
|
63 | + $this->setInterval(15*60); |
|
64 | + |
|
65 | + $this->jobList = $jobList; |
|
66 | + $this->logger = $logger; |
|
67 | + parent::execute($jobList, $logger); |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * @param array $argument |
|
72 | + * @throws \Exception |
|
73 | + * @throws \OC\NeedsUpdateException |
|
74 | + */ |
|
75 | + protected function run($argument) { |
|
76 | + if (!isset($argument['app']) || !isset($argument['step'])) { |
|
77 | + // remove the job - we can never execute it |
|
78 | + $this->jobList->remove($this, $this->argument); |
|
79 | + return; |
|
80 | + } |
|
81 | + $app = $argument['app']; |
|
82 | + |
|
83 | + try { |
|
84 | + $this->loadApp($app); |
|
85 | + } catch (NeedsUpdateException $ex) { |
|
86 | + // as long as the app is not yet done with it's offline migration |
|
87 | + // we better not start with the live migration |
|
88 | + return; |
|
89 | + } |
|
90 | + |
|
91 | + $step = $argument['step']; |
|
92 | + $repair = new Repair([], $this->dispatcher); |
|
93 | + try { |
|
94 | + $repair->addStep($step); |
|
95 | + } catch (\Exception $ex) { |
|
96 | + $this->logger->logException($ex,[ |
|
97 | + 'app' => 'migration' |
|
98 | + ]); |
|
99 | + |
|
100 | + // remove the job - we can never execute it |
|
101 | + $this->jobList->remove($this, $this->argument); |
|
102 | + return; |
|
103 | + } |
|
104 | + |
|
105 | + // execute the repair step |
|
106 | + $repair->run(); |
|
107 | + |
|
108 | + // remove the job once executed successfully |
|
109 | + $this->jobList->remove($this, $this->argument); |
|
110 | + } |
|
111 | + |
|
112 | + /** |
|
113 | + * @codeCoverageIgnore |
|
114 | + * @param $app |
|
115 | + * @throws NeedsUpdateException |
|
116 | + */ |
|
117 | + protected function loadApp($app) { |
|
118 | + OC_App::loadApp($app); |
|
119 | + } |
|
120 | 120 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | if ($command instanceof ICommand) { |
56 | 56 | // ensure the command can be serialized |
57 | 57 | $serialized = serialize($command); |
58 | - if(strlen($serialized) > 4000) { |
|
58 | + if (strlen($serialized) > 4000) { |
|
59 | 59 | throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)'); |
60 | 60 | } |
61 | 61 | $unserialized = unserialize($serialized); |
@@ -26,48 +26,48 @@ |
||
26 | 26 | use OCP\Command\ICommand; |
27 | 27 | |
28 | 28 | class QueueBus implements IBus { |
29 | - /** |
|
30 | - * @var ICommand[]|callable[] |
|
31 | - */ |
|
32 | - private $queue = []; |
|
29 | + /** |
|
30 | + * @var ICommand[]|callable[] |
|
31 | + */ |
|
32 | + private $queue = []; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Schedule a command to be fired |
|
36 | - * |
|
37 | - * @param \OCP\Command\ICommand | callable $command |
|
38 | - */ |
|
39 | - public function push($command) { |
|
40 | - $this->queue[] = $command; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Schedule a command to be fired |
|
36 | + * |
|
37 | + * @param \OCP\Command\ICommand | callable $command |
|
38 | + */ |
|
39 | + public function push($command) { |
|
40 | + $this->queue[] = $command; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * Require all commands using a trait to be run synchronous |
|
45 | - * |
|
46 | - * @param string $trait |
|
47 | - */ |
|
48 | - public function requireSync($trait) { |
|
49 | - } |
|
43 | + /** |
|
44 | + * Require all commands using a trait to be run synchronous |
|
45 | + * |
|
46 | + * @param string $trait |
|
47 | + */ |
|
48 | + public function requireSync($trait) { |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param \OCP\Command\ICommand | callable $command |
|
53 | - */ |
|
54 | - private function runCommand($command) { |
|
55 | - if ($command instanceof ICommand) { |
|
56 | - // ensure the command can be serialized |
|
57 | - $serialized = serialize($command); |
|
58 | - if(strlen($serialized) > 4000) { |
|
59 | - throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)'); |
|
60 | - } |
|
61 | - $unserialized = unserialize($serialized); |
|
62 | - $unserialized->handle(); |
|
63 | - } else { |
|
64 | - $command(); |
|
65 | - } |
|
66 | - } |
|
51 | + /** |
|
52 | + * @param \OCP\Command\ICommand | callable $command |
|
53 | + */ |
|
54 | + private function runCommand($command) { |
|
55 | + if ($command instanceof ICommand) { |
|
56 | + // ensure the command can be serialized |
|
57 | + $serialized = serialize($command); |
|
58 | + if(strlen($serialized) > 4000) { |
|
59 | + throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)'); |
|
60 | + } |
|
61 | + $unserialized = unserialize($serialized); |
|
62 | + $unserialized->handle(); |
|
63 | + } else { |
|
64 | + $command(); |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - public function run() { |
|
69 | - while ($command = array_shift($this->queue)) { |
|
70 | - $this->runCommand($command); |
|
71 | - } |
|
72 | - } |
|
68 | + public function run() { |
|
69 | + while ($command = array_shift($this->queue)) { |
|
70 | + $this->runCommand($command); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | } |
@@ -25,12 +25,12 @@ |
||
25 | 25 | use OC\BackgroundJob\QueuedJob; |
26 | 26 | |
27 | 27 | class CallableJob extends QueuedJob { |
28 | - protected function run($serializedCallable) { |
|
29 | - $callable = unserialize($serializedCallable); |
|
30 | - if (is_callable($callable)) { |
|
31 | - $callable(); |
|
32 | - } else { |
|
33 | - throw new \InvalidArgumentException('Invalid serialized callable'); |
|
34 | - } |
|
35 | - } |
|
28 | + protected function run($serializedCallable) { |
|
29 | + $callable = unserialize($serializedCallable); |
|
30 | + if (is_callable($callable)) { |
|
31 | + $callable(); |
|
32 | + } else { |
|
33 | + throw new \InvalidArgumentException('Invalid serialized callable'); |
|
34 | + } |
|
35 | + } |
|
36 | 36 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | use SuperClosure\Serializer; |
27 | 27 | |
28 | 28 | class ClosureJob extends QueuedJob { |
29 | - protected function run($serializedCallable) { |
|
30 | - $serializer = new Serializer(); |
|
31 | - $callable = $serializer->unserialize($serializedCallable); |
|
32 | - if (is_callable($callable)) { |
|
33 | - $callable(); |
|
34 | - } else { |
|
35 | - throw new \InvalidArgumentException('Invalid serialized callable'); |
|
36 | - } |
|
37 | - } |
|
29 | + protected function run($serializedCallable) { |
|
30 | + $serializer = new Serializer(); |
|
31 | + $callable = $serializer->unserialize($serializedCallable); |
|
32 | + if (is_callable($callable)) { |
|
33 | + $callable(); |
|
34 | + } else { |
|
35 | + throw new \InvalidArgumentException('Invalid serialized callable'); |
|
36 | + } |
|
37 | + } |
|
38 | 38 | } |
@@ -29,12 +29,12 @@ |
||
29 | 29 | * Wrap a command in the background job interface |
30 | 30 | */ |
31 | 31 | class CommandJob extends QueuedJob { |
32 | - protected function run($serializedCommand) { |
|
33 | - $command = unserialize($serializedCommand); |
|
34 | - if ($command instanceof ICommand) { |
|
35 | - $command->handle(); |
|
36 | - } else { |
|
37 | - throw new \InvalidArgumentException('Invalid serialized command'); |
|
38 | - } |
|
39 | - } |
|
32 | + protected function run($serializedCommand) { |
|
33 | + $command = unserialize($serializedCommand); |
|
34 | + if ($command instanceof ICommand) { |
|
35 | + $command->handle(); |
|
36 | + } else { |
|
37 | + throw new \InvalidArgumentException('Invalid serialized command'); |
|
38 | + } |
|
39 | + } |
|
40 | 40 | } |
@@ -24,23 +24,23 @@ |
||
24 | 24 | namespace OC\Template; |
25 | 25 | |
26 | 26 | class ResourceNotFoundException extends \LogicException { |
27 | - protected $resource; |
|
28 | - protected $webPath; |
|
27 | + protected $resource; |
|
28 | + protected $webPath; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param string $resource |
|
32 | - * @param string $webPath |
|
33 | - */ |
|
34 | - public function __construct($resource, $webPath) { |
|
35 | - parent::__construct('Resource not found'); |
|
36 | - $this->resource = $resource; |
|
37 | - $this->webPath = $webPath; |
|
38 | - } |
|
30 | + /** |
|
31 | + * @param string $resource |
|
32 | + * @param string $webPath |
|
33 | + */ |
|
34 | + public function __construct($resource, $webPath) { |
|
35 | + parent::__construct('Resource not found'); |
|
36 | + $this->resource = $resource; |
|
37 | + $this->webPath = $webPath; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function getResourcePath() { |
|
44 | - return $this->webPath . '/' . $this->resource; |
|
45 | - } |
|
40 | + /** |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function getResourcePath() { |
|
44 | + return $this->webPath . '/' . $this->resource; |
|
45 | + } |
|
46 | 46 | } |
@@ -41,6 +41,6 @@ |
||
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function getResourcePath() { |
44 | - return $this->webPath . '/' . $this->resource; |
|
44 | + return $this->webPath.'/'.$this->resource; |
|
45 | 45 | } |
46 | 46 | } |
@@ -26,14 +26,14 @@ |
||
26 | 26 | use OCP\AutoloadNotAllowedException; |
27 | 27 | |
28 | 28 | class RegularJob extends \OC\BackgroundJob\Job { |
29 | - public function run($argument) { |
|
30 | - try { |
|
31 | - if (is_callable($argument)) { |
|
32 | - call_user_func($argument); |
|
33 | - } |
|
34 | - } catch (AutoloadNotAllowedException $e) { |
|
35 | - // job is from a disabled app, ignore |
|
36 | - return null; |
|
37 | - } |
|
38 | - } |
|
29 | + public function run($argument) { |
|
30 | + try { |
|
31 | + if (is_callable($argument)) { |
|
32 | + call_user_func($argument); |
|
33 | + } |
|
34 | + } catch (AutoloadNotAllowedException $e) { |
|
35 | + // job is from a disabled app, ignore |
|
36 | + return null; |
|
37 | + } |
|
38 | + } |
|
39 | 39 | } |