Passed
Push — master ( 76d448...3ef509 )
by Robin
17:04 queued 13s
created
lib/private/Files/ObjectStore/S3ObjectTrait.php 2 patches
Indentation   +159 added lines, -159 removed lines patch added patch discarded remove patch
@@ -35,163 +35,163 @@
 block discarded – undo
35 35
 use Psr\Http\Message\StreamInterface;
36 36
 
37 37
 trait S3ObjectTrait {
38
-	/**
39
-	 * Returns the connection
40
-	 *
41
-	 * @return S3Client connected client
42
-	 * @throws \Exception if connection could not be made
43
-	 */
44
-	abstract protected function getConnection();
45
-
46
-	abstract protected function getCertificateBundlePath(): ?string;
47
-	abstract protected function getSSECParameters(bool $copy = false): array;
48
-
49
-	/**
50
-	 * @param string $urn the unified resource name used to identify the object
51
-	 *
52
-	 * @return resource stream with the read data
53
-	 * @throws \Exception when something goes wrong, message will be logged
54
-	 * @since 7.0.0
55
-	 */
56
-	public function readObject($urn) {
57
-		$fh = SeekableHttpStream::open(function ($range) use ($urn) {
58
-			$command = $this->getConnection()->getCommand('GetObject', [
59
-				'Bucket' => $this->bucket,
60
-				'Key' => $urn,
61
-				'Range' => 'bytes=' . $range,
62
-			] + $this->getSSECParameters());
63
-			$request = \Aws\serialize($command);
64
-			$headers = [];
65
-			foreach ($request->getHeaders() as $key => $values) {
66
-				foreach ($values as $value) {
67
-					$headers[] = "$key: $value";
68
-				}
69
-			}
70
-			$opts = [
71
-				'http' => [
72
-					'protocol_version' => $request->getProtocolVersion(),
73
-					'header' => $headers,
74
-				]
75
-			];
76
-			$bundle = $this->getCertificateBundlePath();
77
-			if ($bundle) {
78
-				$opts['ssl'] = [
79
-					'cafile' => $bundle
80
-				];
81
-			}
82
-
83
-			if ($this->getProxy()) {
84
-				$opts['http']['proxy'] = $this->getProxy();
85
-				$opts['http']['request_fulluri'] = true;
86
-			}
87
-
88
-			$context = stream_context_create($opts);
89
-			return fopen($request->getUri(), 'r', false, $context);
90
-		});
91
-		if (!$fh) {
92
-			throw new \Exception("Failed to read object $urn");
93
-		}
94
-		return $fh;
95
-	}
96
-
97
-
98
-	/**
99
-	 * Single object put helper
100
-	 *
101
-	 * @param string $urn the unified resource name used to identify the object
102
-	 * @param StreamInterface $stream stream with the data to write
103
-	 * @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
104
-	 * @throws \Exception when something goes wrong, message will be logged
105
-	 */
106
-	protected function writeSingle(string $urn, StreamInterface $stream, string $mimetype = null): void {
107
-		$this->getConnection()->putObject([
108
-			'Bucket' => $this->bucket,
109
-			'Key' => $urn,
110
-			'Body' => $stream,
111
-			'ACL' => 'private',
112
-			'ContentType' => $mimetype,
113
-			'StorageClass' => $this->storageClass,
114
-		] + $this->getSSECParameters());
115
-	}
116
-
117
-
118
-	/**
119
-	 * Multipart upload helper that tries to avoid orphaned fragments in S3
120
-	 *
121
-	 * @param string $urn the unified resource name used to identify the object
122
-	 * @param StreamInterface $stream stream with the data to write
123
-	 * @param string|null $mimetype the mimetype to set for the remove object
124
-	 * @throws \Exception when something goes wrong, message will be logged
125
-	 */
126
-	protected function writeMultiPart(string $urn, StreamInterface $stream, string $mimetype = null): void {
127
-		$uploader = new MultipartUploader($this->getConnection(), $stream, [
128
-			'bucket' => $this->bucket,
129
-			'key' => $urn,
130
-			'part_size' => $this->uploadPartSize,
131
-			'params' => [
132
-				'ContentType' => $mimetype,
133
-				'StorageClass' => $this->storageClass,
134
-			] + $this->getSSECParameters(),
135
-		]);
136
-
137
-		try {
138
-			$uploader->upload();
139
-		} catch (S3MultipartUploadException $e) {
140
-			// if anything goes wrong with multipart, make sure that you don´t poison and
141
-			// slow down s3 bucket with orphaned fragments
142
-			$uploadInfo = $e->getState()->getId();
143
-			if ($e->getState()->isInitiated() && (array_key_exists('UploadId', $uploadInfo))) {
144
-				$this->getConnection()->abortMultipartUpload($uploadInfo);
145
-			}
146
-			throw new \OCA\DAV\Connector\Sabre\Exception\BadGateway("Error while uploading to S3 bucket", 0, $e);
147
-		}
148
-	}
149
-
150
-
151
-	/**
152
-	 * @param string $urn the unified resource name used to identify the object
153
-	 * @param resource $stream stream with the data to write
154
-	 * @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
155
-	 * @throws \Exception when something goes wrong, message will be logged
156
-	 * @since 7.0.0
157
-	 */
158
-	public function writeObject($urn, $stream, string $mimetype = null) {
159
-		$psrStream = Utils::streamFor($stream);
160
-
161
-		// ($psrStream->isSeekable() && $psrStream->getSize() !== null) evaluates to true for a On-Seekable stream
162
-		// so the optimisation does not apply
163
-		$buffer = new Psr7\Stream(fopen("php://memory", 'rwb+'));
164
-		Utils::copyToStream($psrStream, $buffer, $this->putSizeLimit);
165
-		$buffer->seek(0);
166
-		if ($buffer->getSize() < $this->putSizeLimit) {
167
-			// buffer is fully seekable, so use it directly for the small upload
168
-			$this->writeSingle($urn, $buffer, $mimetype);
169
-		} else {
170
-			$loadStream = new Psr7\AppendStream([$buffer, $psrStream]);
171
-			$this->writeMultiPart($urn, $loadStream, $mimetype);
172
-		}
173
-	}
174
-
175
-	/**
176
-	 * @param string $urn the unified resource name used to identify the object
177
-	 * @return void
178
-	 * @throws \Exception when something goes wrong, message will be logged
179
-	 * @since 7.0.0
180
-	 */
181
-	public function deleteObject($urn) {
182
-		$this->getConnection()->deleteObject([
183
-			'Bucket' => $this->bucket,
184
-			'Key' => $urn,
185
-		]);
186
-	}
187
-
188
-	public function objectExists($urn) {
189
-		return $this->getConnection()->doesObjectExist($this->bucket, $urn, $this->getSSECParameters());
190
-	}
191
-
192
-	public function copyObject($from, $to) {
193
-		$this->getConnection()->copy($this->getBucket(), $from, $this->getBucket(), $to, 'private', [
194
-			'params' => $this->getSSECParameters() + $this->getSSECParameters(true)
195
-		]);
196
-	}
38
+    /**
39
+     * Returns the connection
40
+     *
41
+     * @return S3Client connected client
42
+     * @throws \Exception if connection could not be made
43
+     */
44
+    abstract protected function getConnection();
45
+
46
+    abstract protected function getCertificateBundlePath(): ?string;
47
+    abstract protected function getSSECParameters(bool $copy = false): array;
48
+
49
+    /**
50
+     * @param string $urn the unified resource name used to identify the object
51
+     *
52
+     * @return resource stream with the read data
53
+     * @throws \Exception when something goes wrong, message will be logged
54
+     * @since 7.0.0
55
+     */
56
+    public function readObject($urn) {
57
+        $fh = SeekableHttpStream::open(function ($range) use ($urn) {
58
+            $command = $this->getConnection()->getCommand('GetObject', [
59
+                'Bucket' => $this->bucket,
60
+                'Key' => $urn,
61
+                'Range' => 'bytes=' . $range,
62
+            ] + $this->getSSECParameters());
63
+            $request = \Aws\serialize($command);
64
+            $headers = [];
65
+            foreach ($request->getHeaders() as $key => $values) {
66
+                foreach ($values as $value) {
67
+                    $headers[] = "$key: $value";
68
+                }
69
+            }
70
+            $opts = [
71
+                'http' => [
72
+                    'protocol_version' => $request->getProtocolVersion(),
73
+                    'header' => $headers,
74
+                ]
75
+            ];
76
+            $bundle = $this->getCertificateBundlePath();
77
+            if ($bundle) {
78
+                $opts['ssl'] = [
79
+                    'cafile' => $bundle
80
+                ];
81
+            }
82
+
83
+            if ($this->getProxy()) {
84
+                $opts['http']['proxy'] = $this->getProxy();
85
+                $opts['http']['request_fulluri'] = true;
86
+            }
87
+
88
+            $context = stream_context_create($opts);
89
+            return fopen($request->getUri(), 'r', false, $context);
90
+        });
91
+        if (!$fh) {
92
+            throw new \Exception("Failed to read object $urn");
93
+        }
94
+        return $fh;
95
+    }
96
+
97
+
98
+    /**
99
+     * Single object put helper
100
+     *
101
+     * @param string $urn the unified resource name used to identify the object
102
+     * @param StreamInterface $stream stream with the data to write
103
+     * @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
104
+     * @throws \Exception when something goes wrong, message will be logged
105
+     */
106
+    protected function writeSingle(string $urn, StreamInterface $stream, string $mimetype = null): void {
107
+        $this->getConnection()->putObject([
108
+            'Bucket' => $this->bucket,
109
+            'Key' => $urn,
110
+            'Body' => $stream,
111
+            'ACL' => 'private',
112
+            'ContentType' => $mimetype,
113
+            'StorageClass' => $this->storageClass,
114
+        ] + $this->getSSECParameters());
115
+    }
116
+
117
+
118
+    /**
119
+     * Multipart upload helper that tries to avoid orphaned fragments in S3
120
+     *
121
+     * @param string $urn the unified resource name used to identify the object
122
+     * @param StreamInterface $stream stream with the data to write
123
+     * @param string|null $mimetype the mimetype to set for the remove object
124
+     * @throws \Exception when something goes wrong, message will be logged
125
+     */
126
+    protected function writeMultiPart(string $urn, StreamInterface $stream, string $mimetype = null): void {
127
+        $uploader = new MultipartUploader($this->getConnection(), $stream, [
128
+            'bucket' => $this->bucket,
129
+            'key' => $urn,
130
+            'part_size' => $this->uploadPartSize,
131
+            'params' => [
132
+                'ContentType' => $mimetype,
133
+                'StorageClass' => $this->storageClass,
134
+            ] + $this->getSSECParameters(),
135
+        ]);
136
+
137
+        try {
138
+            $uploader->upload();
139
+        } catch (S3MultipartUploadException $e) {
140
+            // if anything goes wrong with multipart, make sure that you don´t poison and
141
+            // slow down s3 bucket with orphaned fragments
142
+            $uploadInfo = $e->getState()->getId();
143
+            if ($e->getState()->isInitiated() && (array_key_exists('UploadId', $uploadInfo))) {
144
+                $this->getConnection()->abortMultipartUpload($uploadInfo);
145
+            }
146
+            throw new \OCA\DAV\Connector\Sabre\Exception\BadGateway("Error while uploading to S3 bucket", 0, $e);
147
+        }
148
+    }
149
+
150
+
151
+    /**
152
+     * @param string $urn the unified resource name used to identify the object
153
+     * @param resource $stream stream with the data to write
154
+     * @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
155
+     * @throws \Exception when something goes wrong, message will be logged
156
+     * @since 7.0.0
157
+     */
158
+    public function writeObject($urn, $stream, string $mimetype = null) {
159
+        $psrStream = Utils::streamFor($stream);
160
+
161
+        // ($psrStream->isSeekable() && $psrStream->getSize() !== null) evaluates to true for a On-Seekable stream
162
+        // so the optimisation does not apply
163
+        $buffer = new Psr7\Stream(fopen("php://memory", 'rwb+'));
164
+        Utils::copyToStream($psrStream, $buffer, $this->putSizeLimit);
165
+        $buffer->seek(0);
166
+        if ($buffer->getSize() < $this->putSizeLimit) {
167
+            // buffer is fully seekable, so use it directly for the small upload
168
+            $this->writeSingle($urn, $buffer, $mimetype);
169
+        } else {
170
+            $loadStream = new Psr7\AppendStream([$buffer, $psrStream]);
171
+            $this->writeMultiPart($urn, $loadStream, $mimetype);
172
+        }
173
+    }
174
+
175
+    /**
176
+     * @param string $urn the unified resource name used to identify the object
177
+     * @return void
178
+     * @throws \Exception when something goes wrong, message will be logged
179
+     * @since 7.0.0
180
+     */
181
+    public function deleteObject($urn) {
182
+        $this->getConnection()->deleteObject([
183
+            'Bucket' => $this->bucket,
184
+            'Key' => $urn,
185
+        ]);
186
+    }
187
+
188
+    public function objectExists($urn) {
189
+        return $this->getConnection()->doesObjectExist($this->bucket, $urn, $this->getSSECParameters());
190
+    }
191
+
192
+    public function copyObject($from, $to) {
193
+        $this->getConnection()->copy($this->getBucket(), $from, $this->getBucket(), $to, 'private', [
194
+            'params' => $this->getSSECParameters() + $this->getSSECParameters(true)
195
+        ]);
196
+    }
197 197
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@
 block discarded – undo
54 54
 	 * @since 7.0.0
55 55
 	 */
56 56
 	public function readObject($urn) {
57
-		$fh = SeekableHttpStream::open(function ($range) use ($urn) {
57
+		$fh = SeekableHttpStream::open(function($range) use ($urn) {
58 58
 			$command = $this->getConnection()->getCommand('GetObject', [
59 59
 				'Bucket' => $this->bucket,
60 60
 				'Key' => $urn,
61
-				'Range' => 'bytes=' . $range,
61
+				'Range' => 'bytes='.$range,
62 62
 			] + $this->getSSECParameters());
63 63
 			$request = \Aws\serialize($command);
64 64
 			$headers = [];
Please login to merge, or discard this patch.
apps/files/lib/Command/Object/Put.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -33,52 +33,52 @@
 block discarded – undo
33 33
 use Symfony\Component\Console\Question\ConfirmationQuestion;
34 34
 
35 35
 class Put extends Command {
36
-	private ObjectUtil $objectUtils;
37
-	private IMimeTypeDetector $mimeTypeDetector;
36
+    private ObjectUtil $objectUtils;
37
+    private IMimeTypeDetector $mimeTypeDetector;
38 38
 
39
-	public function __construct(ObjectUtil $objectUtils, IMimeTypeDetector $mimeTypeDetector) {
40
-		$this->objectUtils = $objectUtils;
41
-		$this->mimeTypeDetector = $mimeTypeDetector;
42
-		parent::__construct();
43
-	}
39
+    public function __construct(ObjectUtil $objectUtils, IMimeTypeDetector $mimeTypeDetector) {
40
+        $this->objectUtils = $objectUtils;
41
+        $this->mimeTypeDetector = $mimeTypeDetector;
42
+        parent::__construct();
43
+    }
44 44
 
45
-	protected function configure(): void {
46
-		$this
47
-			->setName('files:object:put')
48
-			->setDescription('Write a file to the object store')
49
-			->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN")
50
-			->addArgument('object', InputArgument::REQUIRED, "Object to write")
51
-			->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config");;
52
-	}
45
+    protected function configure(): void {
46
+        $this
47
+            ->setName('files:object:put')
48
+            ->setDescription('Write a file to the object store')
49
+            ->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN")
50
+            ->addArgument('object', InputArgument::REQUIRED, "Object to write")
51
+            ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config");;
52
+    }
53 53
 
54
-	public function execute(InputInterface $input, OutputInterface $output): int {
55
-		$object = $input->getArgument('object');
56
-		$inputName = (string)$input->getArgument('input');
57
-		$objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
58
-		if (!$objectStore) {
59
-			return -1;
60
-		}
54
+    public function execute(InputInterface $input, OutputInterface $output): int {
55
+        $object = $input->getArgument('object');
56
+        $inputName = (string)$input->getArgument('input');
57
+        $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
58
+        if (!$objectStore) {
59
+            return -1;
60
+        }
61 61
 
62
-		if ($fileId = $this->objectUtils->objectExistsInDb($object)) {
63
-			$output->writeln("<error>Warning, object $object belongs to an existing file, overwriting the object contents can lead to unexpected behavior.</error>");
64
-			$output->writeln("You can use <info>occ files:put $inputName $fileId</info> to write to the file safely.");
65
-			$output->writeln("");
62
+        if ($fileId = $this->objectUtils->objectExistsInDb($object)) {
63
+            $output->writeln("<error>Warning, object $object belongs to an existing file, overwriting the object contents can lead to unexpected behavior.</error>");
64
+            $output->writeln("You can use <info>occ files:put $inputName $fileId</info> to write to the file safely.");
65
+            $output->writeln("");
66 66
 
67
-			/** @var QuestionHelper $helper */
68
-			$helper = $this->getHelper('question');
69
-			$question = new ConfirmationQuestion("Write to the object anyway? [y/N] ", false);
70
-			if (!$helper->ask($input, $output, $question)) {
71
-				return -1;
72
-			}
73
-		}
67
+            /** @var QuestionHelper $helper */
68
+            $helper = $this->getHelper('question');
69
+            $question = new ConfirmationQuestion("Write to the object anyway? [y/N] ", false);
70
+            if (!$helper->ask($input, $output, $question)) {
71
+                return -1;
72
+            }
73
+        }
74 74
 
75
-		$source = $inputName === '-' ? STDIN : fopen($inputName, 'r');
76
-		if (!$source) {
77
-			$output->writeln("<error>Failed to open $inputName</error>");
78
-			return 1;
79
-		}
80
-		$objectStore->writeObject($object, $source, $this->mimeTypeDetector->detectPath($inputName));
81
-		return 0;
82
-	}
75
+        $source = $inputName === '-' ? STDIN : fopen($inputName, 'r');
76
+        if (!$source) {
77
+            $output->writeln("<error>Failed to open $inputName</error>");
78
+            return 1;
79
+        }
80
+        $objectStore->writeObject($object, $source, $this->mimeTypeDetector->detectPath($inputName));
81
+        return 0;
82
+    }
83 83
 
84 84
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
 			->setDescription('Write a file to the object store')
49 49
 			->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN")
50 50
 			->addArgument('object', InputArgument::REQUIRED, "Object to write")
51
-			->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config");;
51
+			->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config"); ;
52 52
 	}
53 53
 
54 54
 	public function execute(InputInterface $input, OutputInterface $output): int {
55 55
 		$object = $input->getArgument('object');
56
-		$inputName = (string)$input->getArgument('input');
56
+		$inputName = (string) $input->getArgument('input');
57 57
 		$objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
58 58
 		if (!$objectStore) {
59 59
 			return -1;
Please login to merge, or discard this patch.
apps/files/lib/Command/Object/ObjectUtil.php 2 patches
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -30,81 +30,81 @@
 block discarded – undo
30 30
 use Symfony\Component\Console\Output\OutputInterface;
31 31
 
32 32
 class ObjectUtil {
33
-	private IConfig $config;
34
-	private IDBConnection $connection;
33
+    private IConfig $config;
34
+    private IDBConnection $connection;
35 35
 
36
-	public function __construct(IConfig $config, IDBConnection $connection) {
37
-		$this->config = $config;
38
-		$this->connection = $connection;
39
-	}
36
+    public function __construct(IConfig $config, IDBConnection $connection) {
37
+        $this->config = $config;
38
+        $this->connection = $connection;
39
+    }
40 40
 
41
-	private function getObjectStoreConfig(): ?array {
42
-		$config = $this->config->getSystemValue('objectstore_multibucket');
43
-		if (is_array($config)) {
44
-			$config['multibucket'] = true;
45
-			return $config;
46
-		}
47
-		$config = $this->config->getSystemValue('objectstore');
48
-		if (is_array($config)) {
49
-			if (!isset($config['multibucket'])) {
50
-				$config['multibucket'] = false;
51
-			}
52
-			return $config;
53
-		} else {
54
-			return null;
55
-		}
56
-	}
41
+    private function getObjectStoreConfig(): ?array {
42
+        $config = $this->config->getSystemValue('objectstore_multibucket');
43
+        if (is_array($config)) {
44
+            $config['multibucket'] = true;
45
+            return $config;
46
+        }
47
+        $config = $this->config->getSystemValue('objectstore');
48
+        if (is_array($config)) {
49
+            if (!isset($config['multibucket'])) {
50
+                $config['multibucket'] = false;
51
+            }
52
+            return $config;
53
+        } else {
54
+            return null;
55
+        }
56
+    }
57 57
 
58
-	public function getObjectStore(?string $bucket, OutputInterface $output): ?IObjectStore {
59
-		$config = $this->getObjectStoreConfig();
60
-		if (!$config) {
61
-			$output->writeln("<error>Instance is not using primary object store</error>");
62
-			return null;
63
-		}
64
-		if ($config['multibucket'] && !$bucket) {
65
-			$output->writeln("<error>--bucket option required</error> because <info>multi bucket</info> is enabled.");
66
-			return null;
67
-		}
58
+    public function getObjectStore(?string $bucket, OutputInterface $output): ?IObjectStore {
59
+        $config = $this->getObjectStoreConfig();
60
+        if (!$config) {
61
+            $output->writeln("<error>Instance is not using primary object store</error>");
62
+            return null;
63
+        }
64
+        if ($config['multibucket'] && !$bucket) {
65
+            $output->writeln("<error>--bucket option required</error> because <info>multi bucket</info> is enabled.");
66
+            return null;
67
+        }
68 68
 
69
-		if (!isset($config['arguments'])) {
70
-			throw new \Exception("no arguments configured for object store configuration");
71
-		}
72
-		if (!isset($config['class'])) {
73
-			throw new \Exception("no class configured for object store configuration");
74
-		}
69
+        if (!isset($config['arguments'])) {
70
+            throw new \Exception("no arguments configured for object store configuration");
71
+        }
72
+        if (!isset($config['class'])) {
73
+            throw new \Exception("no class configured for object store configuration");
74
+        }
75 75
 
76
-		if ($bucket) {
77
-			// s3, swift
78
-			$config['arguments']['bucket'] = $bucket;
79
-			// azure
80
-			$config['arguments']['container'] = $bucket;
81
-		}
76
+        if ($bucket) {
77
+            // s3, swift
78
+            $config['arguments']['bucket'] = $bucket;
79
+            // azure
80
+            $config['arguments']['container'] = $bucket;
81
+        }
82 82
 
83
-		$store = new $config['class']($config['arguments']);
84
-		if (!$store instanceof IObjectStore) {
85
-			throw new \Exception("configured object store class is not an object store implementation");
86
-		}
87
-		return $store;
88
-	}
83
+        $store = new $config['class']($config['arguments']);
84
+        if (!$store instanceof IObjectStore) {
85
+            throw new \Exception("configured object store class is not an object store implementation");
86
+        }
87
+        return $store;
88
+    }
89 89
 
90
-	/**
91
-	 * Check if an object is referenced in the database
92
-	 */
93
-	public function objectExistsInDb(string $object): int|false {
94
-		if (str_starts_with($object, 'urn:oid:')) {
95
-			$fileId = (int)substr($object, strlen('urn:oid:'));
96
-			$query = $this->connection->getQueryBuilder();
97
-			$query->select('fileid')
98
-				->from('filecache')
99
-				->where($query->expr()->eq('fileid', $query->createNamedParameter($fileId, IQueryBuilder::PARAM_INT)));
100
-			$result = $query->executeQuery();
101
-			if ($result->fetchOne() !== false) {
102
-				return $fileId;
103
-			} else {
104
-				return false;
105
-			}
106
-		} else {
107
-			return false;
108
-		}
109
-	}
90
+    /**
91
+     * Check if an object is referenced in the database
92
+     */
93
+    public function objectExistsInDb(string $object): int|false {
94
+        if (str_starts_with($object, 'urn:oid:')) {
95
+            $fileId = (int)substr($object, strlen('urn:oid:'));
96
+            $query = $this->connection->getQueryBuilder();
97
+            $query->select('fileid')
98
+                ->from('filecache')
99
+                ->where($query->expr()->eq('fileid', $query->createNamedParameter($fileId, IQueryBuilder::PARAM_INT)));
100
+            $result = $query->executeQuery();
101
+            if ($result->fetchOne() !== false) {
102
+                return $fileId;
103
+            } else {
104
+                return false;
105
+            }
106
+        } else {
107
+            return false;
108
+        }
109
+    }
110 110
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@
 block discarded – undo
90 90
 	/**
91 91
 	 * Check if an object is referenced in the database
92 92
 	 */
93
-	public function objectExistsInDb(string $object): int|false {
93
+	public function objectExistsInDb(string $object): int | false {
94 94
 		if (str_starts_with($object, 'urn:oid:')) {
95
-			$fileId = (int)substr($object, strlen('urn:oid:'));
95
+			$fileId = (int) substr($object, strlen('urn:oid:'));
96 96
 			$query = $this->connection->getQueryBuilder();
97 97
 			$query->select('fileid')
98 98
 				->from('filecache')
Please login to merge, or discard this patch.
apps/files/lib/Command/Object/Get.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -31,50 +31,50 @@
 block discarded – undo
31 31
 use Symfony\Component\Console\Output\OutputInterface;
32 32
 
33 33
 class Get extends Command {
34
-	private ObjectUtil $objectUtils;
34
+    private ObjectUtil $objectUtils;
35 35
 
36
-	public function __construct(ObjectUtil $objectUtils) {
37
-		$this->objectUtils = $objectUtils;
38
-		parent::__construct();
39
-	}
36
+    public function __construct(ObjectUtil $objectUtils) {
37
+        $this->objectUtils = $objectUtils;
38
+        parent::__construct();
39
+    }
40 40
 
41
-	protected function configure(): void {
42
-		$this
43
-			->setName('files:object:get')
44
-			->setDescription('Get the contents of an object')
45
-			->addArgument('object', InputArgument::REQUIRED, "Object to get")
46
-			->addArgument('output', InputArgument::REQUIRED, "Target local file to output to, use - for STDOUT")
47
-			->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to get the object from, only required in cases where it can't be determined from the config");
48
-	}
41
+    protected function configure(): void {
42
+        $this
43
+            ->setName('files:object:get')
44
+            ->setDescription('Get the contents of an object')
45
+            ->addArgument('object', InputArgument::REQUIRED, "Object to get")
46
+            ->addArgument('output', InputArgument::REQUIRED, "Target local file to output to, use - for STDOUT")
47
+            ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to get the object from, only required in cases where it can't be determined from the config");
48
+    }
49 49
 
50
-	public function execute(InputInterface $input, OutputInterface $output): int {
51
-		$object = $input->getArgument('object');
52
-		$outputName = $input->getArgument('output');
53
-		$objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
54
-		if (!$objectStore) {
55
-			return 1;
56
-		}
50
+    public function execute(InputInterface $input, OutputInterface $output): int {
51
+        $object = $input->getArgument('object');
52
+        $outputName = $input->getArgument('output');
53
+        $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
54
+        if (!$objectStore) {
55
+            return 1;
56
+        }
57 57
 
58
-		if (!$objectStore->objectExists($object)) {
59
-			$output->writeln("<error>Object $object does not exist</error>");
60
-			return 1;
61
-		} else {
62
-			try {
63
-				$source = $objectStore->readObject($object);
64
-			} catch (\Exception $e) {
65
-				$msg = $e->getMessage();
66
-				$output->writeln("<error>Failed to read $object from object store: $msg</error>");
67
-				return 1;
68
-			}
69
-			$target = $outputName === '-' ? STDOUT : fopen($outputName, 'w');
70
-			if (!$target) {
71
-				$output->writeln("<error>Failed to open $outputName for writing</error>");
72
-				return 1;
73
-			}
58
+        if (!$objectStore->objectExists($object)) {
59
+            $output->writeln("<error>Object $object does not exist</error>");
60
+            return 1;
61
+        } else {
62
+            try {
63
+                $source = $objectStore->readObject($object);
64
+            } catch (\Exception $e) {
65
+                $msg = $e->getMessage();
66
+                $output->writeln("<error>Failed to read $object from object store: $msg</error>");
67
+                return 1;
68
+            }
69
+            $target = $outputName === '-' ? STDOUT : fopen($outputName, 'w');
70
+            if (!$target) {
71
+                $output->writeln("<error>Failed to open $outputName for writing</error>");
72
+                return 1;
73
+            }
74 74
 
75
-			stream_copy_to_stream($source, $target);
76
-			return 0;
77
-		}
78
-	}
75
+            stream_copy_to_stream($source, $target);
76
+            return 0;
77
+        }
78
+    }
79 79
 
80 80
 }
Please login to merge, or discard this patch.
apps/files/lib/Command/Object/Delete.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -34,45 +34,45 @@
 block discarded – undo
34 34
 use Symfony\Component\Console\Question\ConfirmationQuestion;
35 35
 
36 36
 class Delete extends Command {
37
-	private ObjectUtil $objectUtils;
37
+    private ObjectUtil $objectUtils;
38 38
 
39
-	public function __construct(ObjectUtil $objectUtils) {
40
-		$this->objectUtils = $objectUtils;
41
-		parent::__construct();
42
-	}
39
+    public function __construct(ObjectUtil $objectUtils) {
40
+        $this->objectUtils = $objectUtils;
41
+        parent::__construct();
42
+    }
43 43
 
44
-	protected function configure(): void {
45
-		$this
46
-			->setName('files:object:delete')
47
-			->setDescription('Delete an object from the object store')
48
-			->addArgument('object', InputArgument::REQUIRED, "Object to delete")
49
-			->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to delete the object from, only required in cases where it can't be determined from the config");
50
-	}
44
+    protected function configure(): void {
45
+        $this
46
+            ->setName('files:object:delete')
47
+            ->setDescription('Delete an object from the object store')
48
+            ->addArgument('object', InputArgument::REQUIRED, "Object to delete")
49
+            ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to delete the object from, only required in cases where it can't be determined from the config");
50
+    }
51 51
 
52
-	public function execute(InputInterface $input, OutputInterface $output): int {
53
-		$object = $input->getArgument('object');
54
-		$objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
55
-		if (!$objectStore) {
56
-			return -1;
57
-		}
52
+    public function execute(InputInterface $input, OutputInterface $output): int {
53
+        $object = $input->getArgument('object');
54
+        $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output);
55
+        if (!$objectStore) {
56
+            return -1;
57
+        }
58 58
 
59
-		if ($fileId = $this->objectUtils->objectExistsInDb($object)) {
60
-			$output->writeln("<error>Warning, object $object belongs to an existing file, deleting the object will lead to unexpected behavior if not replaced</error>");
61
-			$output->writeln("  Note: use <info>occ files:delete $fileId</info> to delete the file cleanly or <info>occ info:file $fileId</info> for more information about the file");
62
-			$output->writeln("");
63
-		}
59
+        if ($fileId = $this->objectUtils->objectExistsInDb($object)) {
60
+            $output->writeln("<error>Warning, object $object belongs to an existing file, deleting the object will lead to unexpected behavior if not replaced</error>");
61
+            $output->writeln("  Note: use <info>occ files:delete $fileId</info> to delete the file cleanly or <info>occ info:file $fileId</info> for more information about the file");
62
+            $output->writeln("");
63
+        }
64 64
 
65
-		if (!$objectStore->objectExists($object)) {
66
-			$output->writeln("<error>Object $object does not exist</error>");
67
-			return -1;
68
-		}
65
+        if (!$objectStore->objectExists($object)) {
66
+            $output->writeln("<error>Object $object does not exist</error>");
67
+            return -1;
68
+        }
69 69
 
70
-		/** @var QuestionHelper $helper */
71
-		$helper = $this->getHelper('question');
72
-		$question = new ConfirmationQuestion("Delete $object? [y/N] ", false);
73
-		if ($helper->ask($input, $output, $question)) {
74
-			$objectStore->deleteObject($object);
75
-		}
76
-		return 0;
77
-	}
70
+        /** @var QuestionHelper $helper */
71
+        $helper = $this->getHelper('question');
72
+        $question = new ConfirmationQuestion("Delete $object? [y/N] ", false);
73
+        if ($helper->ask($input, $output, $question)) {
74
+            $objectStore->deleteObject($object);
75
+        }
76
+        return 0;
77
+    }
78 78
 }
Please login to merge, or discard this patch.
apps/files/composer/composer/autoload_static.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -6,88 +6,88 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitFiles
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\Files\\' => 10,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\Files\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
25
-        'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__ . '/..' . '/../lib/Activity/FavoriteProvider.php',
26
-        'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__ . '/..' . '/../lib/Activity/Filter/Favorites.php',
27
-        'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__ . '/..' . '/../lib/Activity/Filter/FileChanges.php',
28
-        'OCA\\Files\\Activity\\Helper' => __DIR__ . '/..' . '/../lib/Activity/Helper.php',
29
-        'OCA\\Files\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php',
30
-        'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__ . '/..' . '/../lib/Activity/Settings/FavoriteAction.php',
31
-        'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileActivitySettings.php',
32
-        'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileChanged.php',
33
-        'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileFavoriteChanged.php',
34
-        'OCA\\Files\\App' => __DIR__ . '/..' . '/../lib/App.php',
35
-        'OCA\\Files\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
36
-        'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
37
-        'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupFileLocks.php',
38
-        'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
39
-        'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
40
-        'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__ . '/..' . '/../lib/BackgroundJob/ScanFiles.php',
41
-        'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__ . '/..' . '/../lib/BackgroundJob/TransferOwnership.php',
42
-        'OCA\\Files\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
43
-        'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/Listener.php',
44
-        'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/ResourceProvider.php',
45
-        'OCA\\Files\\Command\\Delete' => __DIR__ . '/..' . '/../lib/Command/Delete.php',
46
-        'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__ . '/..' . '/../lib/Command/DeleteOrphanedFiles.php',
47
-        'OCA\\Files\\Command\\Get' => __DIR__ . '/..' . '/../lib/Command/Get.php',
48
-        'OCA\\Files\\Command\\Object\\Delete' => __DIR__ . '/..' . '/../lib/Command/Object/Delete.php',
49
-        'OCA\\Files\\Command\\Object\\Get' => __DIR__ . '/..' . '/../lib/Command/Object/Get.php',
50
-        'OCA\\Files\\Command\\Object\\ObjectUtil' => __DIR__ . '/..' . '/../lib/Command/Object/ObjectUtil.php',
51
-        'OCA\\Files\\Command\\Object\\Put' => __DIR__ . '/..' . '/../lib/Command/Object/Put.php',
52
-        'OCA\\Files\\Command\\Put' => __DIR__ . '/..' . '/../lib/Command/Put.php',
53
-        'OCA\\Files\\Command\\RepairTree' => __DIR__ . '/..' . '/../lib/Command/RepairTree.php',
54
-        'OCA\\Files\\Command\\Scan' => __DIR__ . '/..' . '/../lib/Command/Scan.php',
55
-        'OCA\\Files\\Command\\ScanAppData' => __DIR__ . '/..' . '/../lib/Command/ScanAppData.php',
56
-        'OCA\\Files\\Command\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Command/TransferOwnership.php',
57
-        'OCA\\Files\\Controller\\ApiController' => __DIR__ . '/..' . '/../lib/Controller/ApiController.php',
58
-        'OCA\\Files\\Controller\\DirectEditingController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingController.php',
59
-        'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingViewController.php',
60
-        'OCA\\Files\\Controller\\OpenLocalEditorController' => __DIR__ . '/..' . '/../lib/Controller/OpenLocalEditorController.php',
61
-        'OCA\\Files\\Controller\\TemplateController' => __DIR__ . '/..' . '/../lib/Controller/TemplateController.php',
62
-        'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__ . '/..' . '/../lib/Controller/TransferOwnershipController.php',
63
-        'OCA\\Files\\Controller\\ViewController' => __DIR__ . '/..' . '/../lib/Controller/ViewController.php',
64
-        'OCA\\Files\\Db\\OpenLocalEditor' => __DIR__ . '/..' . '/../lib/Db/OpenLocalEditor.php',
65
-        'OCA\\Files\\Db\\OpenLocalEditorMapper' => __DIR__ . '/..' . '/../lib/Db/OpenLocalEditorMapper.php',
66
-        'OCA\\Files\\Db\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Db/TransferOwnership.php',
67
-        'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__ . '/..' . '/../lib/Db/TransferOwnershipMapper.php',
68
-        'OCA\\Files\\DirectEditingCapabilities' => __DIR__ . '/..' . '/../lib/DirectEditingCapabilities.php',
69
-        'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__ . '/..' . '/../lib/Event/LoadAdditionalScriptsEvent.php',
70
-        'OCA\\Files\\Event\\LoadSidebar' => __DIR__ . '/..' . '/../lib/Event/LoadSidebar.php',
71
-        'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__ . '/..' . '/../lib/Exception/TransferOwnershipException.php',
72
-        'OCA\\Files\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
73
-        'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__ . '/..' . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
74
-        'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php',
75
-        'OCA\\Files\\Listener\\RenderReferenceEventListener' => __DIR__ . '/..' . '/../lib/Listener/RenderReferenceEventListener.php',
76
-        'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__ . '/..' . '/../lib/Migration/Version11301Date20191205150729.php',
77
-        'OCA\\Files\\Migration\\Version12101Date20221011153334' => __DIR__ . '/..' . '/../lib/Migration/Version12101Date20221011153334.php',
78
-        'OCA\\Files\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
79
-        'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__ . '/..' . '/../lib/Search/FilesSearchProvider.php',
80
-        'OCA\\Files\\Service\\DirectEditingService' => __DIR__ . '/..' . '/../lib/Service/DirectEditingService.php',
81
-        'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__ . '/..' . '/../lib/Service/OwnershipTransferService.php',
82
-        'OCA\\Files\\Service\\TagService' => __DIR__ . '/..' . '/../lib/Service/TagService.php',
83
-        'OCA\\Files\\Service\\UserConfig' => __DIR__ . '/..' . '/../lib/Service/UserConfig.php',
84
-        'OCA\\Files\\Service\\ViewConfig' => __DIR__ . '/..' . '/../lib/Service/ViewConfig.php',
85
-        'OCA\\Files\\Settings\\PersonalSettings' => __DIR__ . '/..' . '/../lib/Settings/PersonalSettings.php',
23
+    public static $classMap = array(
24
+        'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php',
25
+        'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__.'/..'.'/../lib/Activity/FavoriteProvider.php',
26
+        'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__.'/..'.'/../lib/Activity/Filter/Favorites.php',
27
+        'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__.'/..'.'/../lib/Activity/Filter/FileChanges.php',
28
+        'OCA\\Files\\Activity\\Helper' => __DIR__.'/..'.'/../lib/Activity/Helper.php',
29
+        'OCA\\Files\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php',
30
+        'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__.'/..'.'/../lib/Activity/Settings/FavoriteAction.php',
31
+        'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__.'/..'.'/../lib/Activity/Settings/FileActivitySettings.php',
32
+        'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileChanged.php',
33
+        'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileFavoriteChanged.php',
34
+        'OCA\\Files\\App' => __DIR__.'/..'.'/../lib/App.php',
35
+        'OCA\\Files\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
36
+        'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
37
+        'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupFileLocks.php',
38
+        'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => __DIR__.'/..'.'/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
39
+        'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__.'/..'.'/../lib/BackgroundJob/DeleteOrphanedItems.php',
40
+        'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__.'/..'.'/../lib/BackgroundJob/ScanFiles.php',
41
+        'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__.'/..'.'/../lib/BackgroundJob/TransferOwnership.php',
42
+        'OCA\\Files\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
43
+        'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__.'/..'.'/../lib/Collaboration/Resources/Listener.php',
44
+        'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__.'/..'.'/../lib/Collaboration/Resources/ResourceProvider.php',
45
+        'OCA\\Files\\Command\\Delete' => __DIR__.'/..'.'/../lib/Command/Delete.php',
46
+        'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__.'/..'.'/../lib/Command/DeleteOrphanedFiles.php',
47
+        'OCA\\Files\\Command\\Get' => __DIR__.'/..'.'/../lib/Command/Get.php',
48
+        'OCA\\Files\\Command\\Object\\Delete' => __DIR__.'/..'.'/../lib/Command/Object/Delete.php',
49
+        'OCA\\Files\\Command\\Object\\Get' => __DIR__.'/..'.'/../lib/Command/Object/Get.php',
50
+        'OCA\\Files\\Command\\Object\\ObjectUtil' => __DIR__.'/..'.'/../lib/Command/Object/ObjectUtil.php',
51
+        'OCA\\Files\\Command\\Object\\Put' => __DIR__.'/..'.'/../lib/Command/Object/Put.php',
52
+        'OCA\\Files\\Command\\Put' => __DIR__.'/..'.'/../lib/Command/Put.php',
53
+        'OCA\\Files\\Command\\RepairTree' => __DIR__.'/..'.'/../lib/Command/RepairTree.php',
54
+        'OCA\\Files\\Command\\Scan' => __DIR__.'/..'.'/../lib/Command/Scan.php',
55
+        'OCA\\Files\\Command\\ScanAppData' => __DIR__.'/..'.'/../lib/Command/ScanAppData.php',
56
+        'OCA\\Files\\Command\\TransferOwnership' => __DIR__.'/..'.'/../lib/Command/TransferOwnership.php',
57
+        'OCA\\Files\\Controller\\ApiController' => __DIR__.'/..'.'/../lib/Controller/ApiController.php',
58
+        'OCA\\Files\\Controller\\DirectEditingController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingController.php',
59
+        'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingViewController.php',
60
+        'OCA\\Files\\Controller\\OpenLocalEditorController' => __DIR__.'/..'.'/../lib/Controller/OpenLocalEditorController.php',
61
+        'OCA\\Files\\Controller\\TemplateController' => __DIR__.'/..'.'/../lib/Controller/TemplateController.php',
62
+        'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__.'/..'.'/../lib/Controller/TransferOwnershipController.php',
63
+        'OCA\\Files\\Controller\\ViewController' => __DIR__.'/..'.'/../lib/Controller/ViewController.php',
64
+        'OCA\\Files\\Db\\OpenLocalEditor' => __DIR__.'/..'.'/../lib/Db/OpenLocalEditor.php',
65
+        'OCA\\Files\\Db\\OpenLocalEditorMapper' => __DIR__.'/..'.'/../lib/Db/OpenLocalEditorMapper.php',
66
+        'OCA\\Files\\Db\\TransferOwnership' => __DIR__.'/..'.'/../lib/Db/TransferOwnership.php',
67
+        'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__.'/..'.'/../lib/Db/TransferOwnershipMapper.php',
68
+        'OCA\\Files\\DirectEditingCapabilities' => __DIR__.'/..'.'/../lib/DirectEditingCapabilities.php',
69
+        'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__.'/..'.'/../lib/Event/LoadAdditionalScriptsEvent.php',
70
+        'OCA\\Files\\Event\\LoadSidebar' => __DIR__.'/..'.'/../lib/Event/LoadSidebar.php',
71
+        'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__.'/..'.'/../lib/Exception/TransferOwnershipException.php',
72
+        'OCA\\Files\\Helper' => __DIR__.'/..'.'/../lib/Helper.php',
73
+        'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__.'/..'.'/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
74
+        'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarListener.php',
75
+        'OCA\\Files\\Listener\\RenderReferenceEventListener' => __DIR__.'/..'.'/../lib/Listener/RenderReferenceEventListener.php',
76
+        'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__.'/..'.'/../lib/Migration/Version11301Date20191205150729.php',
77
+        'OCA\\Files\\Migration\\Version12101Date20221011153334' => __DIR__.'/..'.'/../lib/Migration/Version12101Date20221011153334.php',
78
+        'OCA\\Files\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php',
79
+        'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__.'/..'.'/../lib/Search/FilesSearchProvider.php',
80
+        'OCA\\Files\\Service\\DirectEditingService' => __DIR__.'/..'.'/../lib/Service/DirectEditingService.php',
81
+        'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__.'/..'.'/../lib/Service/OwnershipTransferService.php',
82
+        'OCA\\Files\\Service\\TagService' => __DIR__.'/..'.'/../lib/Service/TagService.php',
83
+        'OCA\\Files\\Service\\UserConfig' => __DIR__.'/..'.'/../lib/Service/UserConfig.php',
84
+        'OCA\\Files\\Service\\ViewConfig' => __DIR__.'/..'.'/../lib/Service/ViewConfig.php',
85
+        'OCA\\Files\\Settings\\PersonalSettings' => __DIR__.'/..'.'/../lib/Settings/PersonalSettings.php',
86 86
     );
87 87
 
88 88
     public static function getInitializer(ClassLoader $loader)
89 89
     {
90
-        return \Closure::bind(function () use ($loader) {
90
+        return \Closure::bind(function() use ($loader) {
91 91
             $loader->prefixLengthsPsr4 = ComposerStaticInitFiles::$prefixLengthsPsr4;
92 92
             $loader->prefixDirsPsr4 = ComposerStaticInitFiles::$prefixDirsPsr4;
93 93
             $loader->classMap = ComposerStaticInitFiles::$classMap;
Please login to merge, or discard this patch.
apps/files/composer/composer/autoload_classmap.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -6,66 +6,66 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
-    'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir . '/../lib/Activity/FavoriteProvider.php',
11
-    'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir . '/../lib/Activity/Filter/Favorites.php',
12
-    'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir . '/../lib/Activity/Filter/FileChanges.php',
13
-    'OCA\\Files\\Activity\\Helper' => $baseDir . '/../lib/Activity/Helper.php',
14
-    'OCA\\Files\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php',
15
-    'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir . '/../lib/Activity/Settings/FavoriteAction.php',
16
-    'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir . '/../lib/Activity/Settings/FileActivitySettings.php',
17
-    'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir . '/../lib/Activity/Settings/FileChanged.php',
18
-    'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir . '/../lib/Activity/Settings/FileFavoriteChanged.php',
19
-    'OCA\\Files\\App' => $baseDir . '/../lib/App.php',
20
-    'OCA\\Files\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
21
-    'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
22
-    'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir . '/../lib/BackgroundJob/CleanupFileLocks.php',
23
-    'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => $baseDir . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
24
-    'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
25
-    'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir . '/../lib/BackgroundJob/ScanFiles.php',
26
-    'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir . '/../lib/BackgroundJob/TransferOwnership.php',
27
-    'OCA\\Files\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
28
-    'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir . '/../lib/Collaboration/Resources/Listener.php',
29
-    'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir . '/../lib/Collaboration/Resources/ResourceProvider.php',
30
-    'OCA\\Files\\Command\\Delete' => $baseDir . '/../lib/Command/Delete.php',
31
-    'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir . '/../lib/Command/DeleteOrphanedFiles.php',
32
-    'OCA\\Files\\Command\\Get' => $baseDir . '/../lib/Command/Get.php',
33
-    'OCA\\Files\\Command\\Object\\Delete' => $baseDir . '/../lib/Command/Object/Delete.php',
34
-    'OCA\\Files\\Command\\Object\\Get' => $baseDir . '/../lib/Command/Object/Get.php',
35
-    'OCA\\Files\\Command\\Object\\ObjectUtil' => $baseDir . '/../lib/Command/Object/ObjectUtil.php',
36
-    'OCA\\Files\\Command\\Object\\Put' => $baseDir . '/../lib/Command/Object/Put.php',
37
-    'OCA\\Files\\Command\\Put' => $baseDir . '/../lib/Command/Put.php',
38
-    'OCA\\Files\\Command\\RepairTree' => $baseDir . '/../lib/Command/RepairTree.php',
39
-    'OCA\\Files\\Command\\Scan' => $baseDir . '/../lib/Command/Scan.php',
40
-    'OCA\\Files\\Command\\ScanAppData' => $baseDir . '/../lib/Command/ScanAppData.php',
41
-    'OCA\\Files\\Command\\TransferOwnership' => $baseDir . '/../lib/Command/TransferOwnership.php',
42
-    'OCA\\Files\\Controller\\ApiController' => $baseDir . '/../lib/Controller/ApiController.php',
43
-    'OCA\\Files\\Controller\\DirectEditingController' => $baseDir . '/../lib/Controller/DirectEditingController.php',
44
-    'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir . '/../lib/Controller/DirectEditingViewController.php',
45
-    'OCA\\Files\\Controller\\OpenLocalEditorController' => $baseDir . '/../lib/Controller/OpenLocalEditorController.php',
46
-    'OCA\\Files\\Controller\\TemplateController' => $baseDir . '/../lib/Controller/TemplateController.php',
47
-    'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir . '/../lib/Controller/TransferOwnershipController.php',
48
-    'OCA\\Files\\Controller\\ViewController' => $baseDir . '/../lib/Controller/ViewController.php',
49
-    'OCA\\Files\\Db\\OpenLocalEditor' => $baseDir . '/../lib/Db/OpenLocalEditor.php',
50
-    'OCA\\Files\\Db\\OpenLocalEditorMapper' => $baseDir . '/../lib/Db/OpenLocalEditorMapper.php',
51
-    'OCA\\Files\\Db\\TransferOwnership' => $baseDir . '/../lib/Db/TransferOwnership.php',
52
-    'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir . '/../lib/Db/TransferOwnershipMapper.php',
53
-    'OCA\\Files\\DirectEditingCapabilities' => $baseDir . '/../lib/DirectEditingCapabilities.php',
54
-    'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir . '/../lib/Event/LoadAdditionalScriptsEvent.php',
55
-    'OCA\\Files\\Event\\LoadSidebar' => $baseDir . '/../lib/Event/LoadSidebar.php',
56
-    'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir . '/../lib/Exception/TransferOwnershipException.php',
57
-    'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php',
58
-    'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
59
-    'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php',
60
-    'OCA\\Files\\Listener\\RenderReferenceEventListener' => $baseDir . '/../lib/Listener/RenderReferenceEventListener.php',
61
-    'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir . '/../lib/Migration/Version11301Date20191205150729.php',
62
-    'OCA\\Files\\Migration\\Version12101Date20221011153334' => $baseDir . '/../lib/Migration/Version12101Date20221011153334.php',
63
-    'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
64
-    'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir . '/../lib/Search/FilesSearchProvider.php',
65
-    'OCA\\Files\\Service\\DirectEditingService' => $baseDir . '/../lib/Service/DirectEditingService.php',
66
-    'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir . '/../lib/Service/OwnershipTransferService.php',
67
-    'OCA\\Files\\Service\\TagService' => $baseDir . '/../lib/Service/TagService.php',
68
-    'OCA\\Files\\Service\\UserConfig' => $baseDir . '/../lib/Service/UserConfig.php',
69
-    'OCA\\Files\\Service\\ViewConfig' => $baseDir . '/../lib/Service/ViewConfig.php',
70
-    'OCA\\Files\\Settings\\PersonalSettings' => $baseDir . '/../lib/Settings/PersonalSettings.php',
9
+    'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php',
10
+    'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir.'/../lib/Activity/FavoriteProvider.php',
11
+    'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir.'/../lib/Activity/Filter/Favorites.php',
12
+    'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir.'/../lib/Activity/Filter/FileChanges.php',
13
+    'OCA\\Files\\Activity\\Helper' => $baseDir.'/../lib/Activity/Helper.php',
14
+    'OCA\\Files\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php',
15
+    'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir.'/../lib/Activity/Settings/FavoriteAction.php',
16
+    'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir.'/../lib/Activity/Settings/FileActivitySettings.php',
17
+    'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir.'/../lib/Activity/Settings/FileChanged.php',
18
+    'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir.'/../lib/Activity/Settings/FileFavoriteChanged.php',
19
+    'OCA\\Files\\App' => $baseDir.'/../lib/App.php',
20
+    'OCA\\Files\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
21
+    'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php',
22
+    'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir.'/../lib/BackgroundJob/CleanupFileLocks.php',
23
+    'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => $baseDir.'/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
24
+    'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir.'/../lib/BackgroundJob/DeleteOrphanedItems.php',
25
+    'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir.'/../lib/BackgroundJob/ScanFiles.php',
26
+    'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir.'/../lib/BackgroundJob/TransferOwnership.php',
27
+    'OCA\\Files\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
28
+    'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir.'/../lib/Collaboration/Resources/Listener.php',
29
+    'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir.'/../lib/Collaboration/Resources/ResourceProvider.php',
30
+    'OCA\\Files\\Command\\Delete' => $baseDir.'/../lib/Command/Delete.php',
31
+    'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir.'/../lib/Command/DeleteOrphanedFiles.php',
32
+    'OCA\\Files\\Command\\Get' => $baseDir.'/../lib/Command/Get.php',
33
+    'OCA\\Files\\Command\\Object\\Delete' => $baseDir.'/../lib/Command/Object/Delete.php',
34
+    'OCA\\Files\\Command\\Object\\Get' => $baseDir.'/../lib/Command/Object/Get.php',
35
+    'OCA\\Files\\Command\\Object\\ObjectUtil' => $baseDir.'/../lib/Command/Object/ObjectUtil.php',
36
+    'OCA\\Files\\Command\\Object\\Put' => $baseDir.'/../lib/Command/Object/Put.php',
37
+    'OCA\\Files\\Command\\Put' => $baseDir.'/../lib/Command/Put.php',
38
+    'OCA\\Files\\Command\\RepairTree' => $baseDir.'/../lib/Command/RepairTree.php',
39
+    'OCA\\Files\\Command\\Scan' => $baseDir.'/../lib/Command/Scan.php',
40
+    'OCA\\Files\\Command\\ScanAppData' => $baseDir.'/../lib/Command/ScanAppData.php',
41
+    'OCA\\Files\\Command\\TransferOwnership' => $baseDir.'/../lib/Command/TransferOwnership.php',
42
+    'OCA\\Files\\Controller\\ApiController' => $baseDir.'/../lib/Controller/ApiController.php',
43
+    'OCA\\Files\\Controller\\DirectEditingController' => $baseDir.'/../lib/Controller/DirectEditingController.php',
44
+    'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir.'/../lib/Controller/DirectEditingViewController.php',
45
+    'OCA\\Files\\Controller\\OpenLocalEditorController' => $baseDir.'/../lib/Controller/OpenLocalEditorController.php',
46
+    'OCA\\Files\\Controller\\TemplateController' => $baseDir.'/../lib/Controller/TemplateController.php',
47
+    'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir.'/../lib/Controller/TransferOwnershipController.php',
48
+    'OCA\\Files\\Controller\\ViewController' => $baseDir.'/../lib/Controller/ViewController.php',
49
+    'OCA\\Files\\Db\\OpenLocalEditor' => $baseDir.'/../lib/Db/OpenLocalEditor.php',
50
+    'OCA\\Files\\Db\\OpenLocalEditorMapper' => $baseDir.'/../lib/Db/OpenLocalEditorMapper.php',
51
+    'OCA\\Files\\Db\\TransferOwnership' => $baseDir.'/../lib/Db/TransferOwnership.php',
52
+    'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir.'/../lib/Db/TransferOwnershipMapper.php',
53
+    'OCA\\Files\\DirectEditingCapabilities' => $baseDir.'/../lib/DirectEditingCapabilities.php',
54
+    'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir.'/../lib/Event/LoadAdditionalScriptsEvent.php',
55
+    'OCA\\Files\\Event\\LoadSidebar' => $baseDir.'/../lib/Event/LoadSidebar.php',
56
+    'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir.'/../lib/Exception/TransferOwnershipException.php',
57
+    'OCA\\Files\\Helper' => $baseDir.'/../lib/Helper.php',
58
+    'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir.'/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
59
+    'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir.'/../lib/Listener/LoadSidebarListener.php',
60
+    'OCA\\Files\\Listener\\RenderReferenceEventListener' => $baseDir.'/../lib/Listener/RenderReferenceEventListener.php',
61
+    'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir.'/../lib/Migration/Version11301Date20191205150729.php',
62
+    'OCA\\Files\\Migration\\Version12101Date20221011153334' => $baseDir.'/../lib/Migration/Version12101Date20221011153334.php',
63
+    'OCA\\Files\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php',
64
+    'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir.'/../lib/Search/FilesSearchProvider.php',
65
+    'OCA\\Files\\Service\\DirectEditingService' => $baseDir.'/../lib/Service/DirectEditingService.php',
66
+    'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir.'/../lib/Service/OwnershipTransferService.php',
67
+    'OCA\\Files\\Service\\TagService' => $baseDir.'/../lib/Service/TagService.php',
68
+    'OCA\\Files\\Service\\UserConfig' => $baseDir.'/../lib/Service/UserConfig.php',
69
+    'OCA\\Files\\Service\\ViewConfig' => $baseDir.'/../lib/Service/ViewConfig.php',
70
+    'OCA\\Files\\Settings\\PersonalSettings' => $baseDir.'/../lib/Settings/PersonalSettings.php',
71 71
 );
Please login to merge, or discard this patch.