diff options
Diffstat (limited to 'lib/public/Files')
-rw-r--r-- | lib/public/Files/Cache/CacheEntryInsertedEvent.php | 37 | ||||
-rw-r--r-- | lib/public/Files/Cache/CacheEntryRemovedEvent.php | 37 | ||||
-rw-r--r-- | lib/public/Files/Cache/CacheEntryUpdatedEvent.php | 37 | ||||
-rw-r--r-- | lib/public/Files/Cache/CacheInsertEvent.php | 5 | ||||
-rw-r--r-- | lib/public/Files/Cache/CacheUpdateEvent.php | 5 | ||||
-rw-r--r-- | lib/public/Files/Cache/ICacheEntry.php | 8 | ||||
-rw-r--r-- | lib/public/Files/Cache/ICacheEvent.php | 6 | ||||
-rw-r--r-- | lib/public/Files/Folder.php | 2 | ||||
-rw-r--r-- | lib/public/Files/ObjectStore/IObjectStore.php | 8 | ||||
-rw-r--r-- | lib/public/Files/Storage.php | 6 | ||||
-rw-r--r-- | lib/public/Files/Storage/INotifyStorage.php | 18 | ||||
-rw-r--r-- | lib/public/Files/Storage/IStorage.php | 4 | ||||
-rw-r--r-- | lib/public/Files/Storage/IStorageFactory.php | 2 | ||||
-rw-r--r-- | lib/public/Files/Storage/IWriteStreamStorage.php | 1 | ||||
-rw-r--r-- | lib/public/Files/StorageNotAvailableException.php | 2 |
15 files changed, 145 insertions, 33 deletions
diff --git a/lib/public/Files/Cache/CacheEntryInsertedEvent.php b/lib/public/Files/Cache/CacheEntryInsertedEvent.php new file mode 100644 index 00000000000..890d751e534 --- /dev/null +++ b/lib/public/Files/Cache/CacheEntryInsertedEvent.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl> + * + * @author Robin Appelman <robin@icewind.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Files\Cache; + +use OC\Files\Cache\AbstractCacheEvent; + +/** + * Event for when an existing entry in the cache gets inserted + * + * @since 21.0.0 + */ +class CacheEntryInsertedEvent extends AbstractCacheEvent implements ICacheEvent { +} diff --git a/lib/public/Files/Cache/CacheEntryRemovedEvent.php b/lib/public/Files/Cache/CacheEntryRemovedEvent.php new file mode 100644 index 00000000000..e9a963a78a6 --- /dev/null +++ b/lib/public/Files/Cache/CacheEntryRemovedEvent.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl> + * + * @author Robin Appelman <robin@icewind.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Files\Cache; + +use OC\Files\Cache\AbstractCacheEvent; + +/** + * Event for when an existing entry in the cache gets removed + * + * @since 21.0.0 + */ +class CacheEntryRemovedEvent extends AbstractCacheEvent implements ICacheEvent { +} diff --git a/lib/public/Files/Cache/CacheEntryUpdatedEvent.php b/lib/public/Files/Cache/CacheEntryUpdatedEvent.php new file mode 100644 index 00000000000..37a336013f8 --- /dev/null +++ b/lib/public/Files/Cache/CacheEntryUpdatedEvent.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2020 Robin Appelman <robin@icewind.nl> + * + * @author Robin Appelman <robin@icewind.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Files\Cache; + +use OC\Files\Cache\AbstractCacheEvent; + +/** + * Event for when an existing entry in the cache gets updated + * + * @since 21.0.0 + */ +class CacheEntryUpdatedEvent extends AbstractCacheEvent implements ICacheEvent { +} diff --git a/lib/public/Files/Cache/CacheInsertEvent.php b/lib/public/Files/Cache/CacheInsertEvent.php index 84fc1a2e928..08ab15f9a2d 100644 --- a/lib/public/Files/Cache/CacheInsertEvent.php +++ b/lib/public/Files/Cache/CacheInsertEvent.php @@ -26,12 +26,11 @@ declare(strict_types=1); namespace OCP\Files\Cache; -use OC\Files\Cache\AbstractCacheEvent; - /** * Event for when a new entry gets added to the cache * * @since 16.0.0 + * @deprecated 21.0.0 use CacheEntryInsertedEvent instead */ -class CacheInsertEvent extends AbstractCacheEvent { +class CacheInsertEvent extends CacheEntryInsertedEvent { } diff --git a/lib/public/Files/Cache/CacheUpdateEvent.php b/lib/public/Files/Cache/CacheUpdateEvent.php index f20056d2666..54397045398 100644 --- a/lib/public/Files/Cache/CacheUpdateEvent.php +++ b/lib/public/Files/Cache/CacheUpdateEvent.php @@ -26,12 +26,11 @@ declare(strict_types=1); namespace OCP\Files\Cache; -use OC\Files\Cache\AbstractCacheEvent; - /** * Event for when an existing entry in the cache gets updated * * @since 16.0.0 + * @deprecated 21.0.0 use CacheEntryUpdatedEvent instead */ -class CacheUpdateEvent extends AbstractCacheEvent { +class CacheUpdateEvent extends CacheEntryUpdatedEvent { } diff --git a/lib/public/Files/Cache/ICacheEntry.php b/lib/public/Files/Cache/ICacheEntry.php index e3efe679cde..7a0e22496e0 100644 --- a/lib/public/Files/Cache/ICacheEntry.php +++ b/lib/public/Files/Cache/ICacheEntry.php @@ -23,12 +23,18 @@ namespace OCP\Files\Cache; +use ArrayAccess; + /** * meta data for a file or folder * * @since 9.0.0 + * + * This interface extends \ArrayAccess since v21.0.0, previous versions only + * implemented it in the private implementation. Hence php would allow using the + * object as array, while strictly speaking it didn't support this. */ -interface ICacheEntry { +interface ICacheEntry extends ArrayAccess { public const DIRECTORY_MIMETYPE = 'httpd/unix-directory'; /** diff --git a/lib/public/Files/Cache/ICacheEvent.php b/lib/public/Files/Cache/ICacheEvent.php index 634666f594a..56f6f46df1c 100644 --- a/lib/public/Files/Cache/ICacheEvent.php +++ b/lib/public/Files/Cache/ICacheEvent.php @@ -56,4 +56,10 @@ interface ICacheEvent { * @since 16.0.0 */ public function getFileId(): int; + + /** + * @return int + * @since 21.0.0 + */ + public function getStorageId(): int; } diff --git a/lib/public/Files/Folder.php b/lib/public/Files/Folder.php index a5d8398a3eb..3e90abdd944 100644 --- a/lib/public/Files/Folder.php +++ b/lib/public/Files/Folder.php @@ -6,7 +6,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * diff --git a/lib/public/Files/ObjectStore/IObjectStore.php b/lib/public/Files/ObjectStore/IObjectStore.php index 4925959d6c5..e9d948682f8 100644 --- a/lib/public/Files/ObjectStore/IObjectStore.php +++ b/lib/public/Files/ObjectStore/IObjectStore.php @@ -73,4 +73,12 @@ interface IObjectStore { * @since 16.0.0 */ public function objectExists($urn); + + /** + * @param string $from the unified resource name used to identify the source object + * @param string $to the unified resource name used to identify the target object + * @return void + * @since 21.0.0 + */ + public function copyObject($from, $to); } diff --git a/lib/public/Files/Storage.php b/lib/public/Files/Storage.php index fb56e7e3bfb..2033fe5d28a 100644 --- a/lib/public/Files/Storage.php +++ b/lib/public/Files/Storage.php @@ -10,7 +10,7 @@ * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * @author Vinicius Cubas Brand <vinicius@eita.org.br> * * @license AGPL-3.0 @@ -230,8 +230,8 @@ interface Storage extends IStorage { * see https://www.php.net/manual/en/function.file_put_contents.php * * @param string $path - * @param string $data - * @return bool + * @param mixed $data + * @return int|false * @since 6.0.0 */ public function file_put_contents($path, $data); diff --git a/lib/public/Files/Storage/INotifyStorage.php b/lib/public/Files/Storage/INotifyStorage.php index 57efd6dc4f4..35dc828dfdf 100644 --- a/lib/public/Files/Storage/INotifyStorage.php +++ b/lib/public/Files/Storage/INotifyStorage.php @@ -38,24 +38,6 @@ interface INotifyStorage { public const NOTIFY_RENAMED = 4; /** - * Start listening for update notifications - * - * The provided callback will be called for every incoming notification with the following parameters - * - int $type the type of update, one of the INotifyStorage::NOTIFY_* constants - * - string $path the path of the update - * - string $renameTarget the target of the rename operation, only provided for rename updates - * - * Note that this call is blocking and will not exit on it's own, to stop listening for notifications return `false` from the callback - * - * @param string $path - * @param callable $callback - * - * @since 9.1.0 - * @deprecated 12.0.0 use INotifyStorage::notify()->listen() instead - */ - public function listen($path, callable $callback); - - /** * Start the notification handler for this storage * * @param $path diff --git a/lib/public/Files/Storage/IStorage.php b/lib/public/Files/Storage/IStorage.php index f8877895747..0f5e3e5f305 100644 --- a/lib/public/Files/Storage/IStorage.php +++ b/lib/public/Files/Storage/IStorage.php @@ -226,8 +226,8 @@ interface IStorage { * see https://www.php.net/manual/en/function.file_put_contents.php * * @param string $path - * @param string $data - * @return bool + * @param mixed $data + * @return int|false * @since 9.0.0 */ public function file_put_contents($path, $data); diff --git a/lib/public/Files/Storage/IStorageFactory.php b/lib/public/Files/Storage/IStorageFactory.php index acd6178f48f..7c5860f6b77 100644 --- a/lib/public/Files/Storage/IStorageFactory.php +++ b/lib/public/Files/Storage/IStorageFactory.php @@ -5,7 +5,7 @@ * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * diff --git a/lib/public/Files/Storage/IWriteStreamStorage.php b/lib/public/Files/Storage/IWriteStreamStorage.php index 319453d4bbc..5f8e73e0cba 100644 --- a/lib/public/Files/Storage/IWriteStreamStorage.php +++ b/lib/public/Files/Storage/IWriteStreamStorage.php @@ -5,6 +5,7 @@ declare(strict_types=1); /** * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl> * + * @author Julius Härtl <jus@bitgrid.net> * @author Robin Appelman <robin@icewind.nl> * * @license GNU AGPL version 3 or any later version diff --git a/lib/public/Files/StorageNotAvailableException.php b/lib/public/Files/StorageNotAvailableException.php index ef9d22e8dff..11b8d76f706 100644 --- a/lib/public/Files/StorageNotAvailableException.php +++ b/lib/public/Files/StorageNotAvailableException.php @@ -10,7 +10,7 @@ * @author Robin Appelman <robin@icewind.nl> * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Vincent Petry <vincent@nextcloud.com> * * @license AGPL-3.0 * |