diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-30 19:13:01 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-16 13:17:12 +0200 |
commit | f2889dc6e4aa701f36081b314f38f620cbb1fc88 (patch) | |
tree | 8969d61c3dc2a71cd8eb1b745d88fc10782e1d75 | |
parent | 4b9ec49285081137195c5852682b127a37ea8bfe (diff) | |
download | nextcloud-server-f2889dc6e4aa701f36081b314f38f620cbb1fc88.tar.gz nextcloud-server-f2889dc6e4aa701f36081b314f38f620cbb1fc88.zip |
Consolidate webdav code - move all to one app
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | apps/dav/appinfo/info.xml | 22 | ||||
-rw-r--r-- | apps/dav/appinfo/v1/publicwebdav.php (renamed from apps/files_sharing/publicwebdav.php) | 6 | ||||
-rw-r--r-- | apps/dav/appinfo/v1/webdav.php | 55 | ||||
-rw-r--r-- | apps/dav/lib/connector/publicauth.php (renamed from apps/files_sharing/lib/connector/publicauth.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/appenabledplugin.php (renamed from lib/private/connector/sabre/appenabledplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/auth.php (renamed from lib/private/connector/sabre/auth.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/blocklegacyclientplugin.php (renamed from lib/private/connector/sabre/blocklegacyclientplugin.php) | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/copyetagheaderplugin.php (renamed from lib/private/connector/sabre/copyetagheaderplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/custompropertiesbackend.php (renamed from lib/private/connector/sabre/custompropertiesbackend.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/directory.php (renamed from lib/private/connector/sabre/directory.php) | 14 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/dummygetresponseplugin.php (renamed from lib/private/connector/sabre/dummygetresponseplugin.php) | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/exception/entitytoolarge.php (renamed from lib/private/connector/sabre/exception/entitytoolarge.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/exception/filelocked.php (renamed from lib/private/connector/sabre/exception/filelocked.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/exception/invalidpath.php (renamed from lib/private/connector/sabre/exception/invalidpath.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/exception/unsupportedmediatype.php (renamed from lib/private/connector/sabre/exception/unsupportedmediatype.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/exceptionloggerplugin.php (renamed from lib/private/connector/sabre/exceptionloggerplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/file.php (renamed from lib/private/connector/sabre/file.php) | 8 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/filesplugin.php (renamed from lib/private/connector/sabre/filesplugin.php) | 12 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/listenerplugin.php (renamed from lib/private/connector/sabre/listenerplugin.php) | 0 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/lockplugin.php (renamed from lib/private/connector/sabre/lockplugin.php) | 6 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/maintenanceplugin.php (renamed from lib/private/connector/sabre/maintenanceplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/node.php (renamed from lib/private/connector/sabre/node.php) | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/objecttree.php (renamed from lib/private/connector/sabre/objecttree.php) | 10 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/principal.php (renamed from lib/private/connector/sabre/principal.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/quotaplugin.php (renamed from lib/private/connector/sabre/quotaplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/server.php (renamed from lib/private/connector/sabre/server.php) | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/serverfactory.php (renamed from lib/private/connector/sabre/serverfactory.php) | 32 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/taglist.php (renamed from lib/private/connector/sabre/taglist.php) | 4 | ||||
-rw-r--r-- | apps/dav/lib/connector/sabre/tagsplugin.php (renamed from lib/private/connector/sabre/tagsplugin.php) | 6 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/BlockLegacyClientPluginTest.php (renamed from tests/lib/connector/sabre/BlockLegacyClientPluginTest.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/DummyGetResponsePluginTest.php (renamed from tests/lib/connector/sabre/DummyGetResponsePluginTest.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/MaintenancePluginTest.php (renamed from tests/lib/connector/sabre/MaintenancePluginTest.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/copyetagheaderplugintest.php (renamed from tests/lib/connector/sabre/copyetagheaderplugintest.php) | 4 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/custompropertiesbackend.php (renamed from tests/lib/connector/sabre/custompropertiesbackend.php) | 12 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/directory.php (renamed from tests/lib/connector/sabre/directory.php) | 12 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/exception/invalidpathtest.php (renamed from tests/lib/connector/sabre/exception/invalidpathtest.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/exceptionloggerplugin.php (renamed from tests/lib/connector/sabre/exceptionloggerplugin.php) | 4 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/file.php (renamed from tests/lib/connector/sabre/file.php) | 46 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/filesplugin.php (renamed from tests/lib/connector/sabre/filesplugin.php) | 28 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/node.php (renamed from tests/lib/connector/sabre/node.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/objecttree.php (renamed from tests/lib/connector/sabre/objecttree.php) | 28 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/principal.php (renamed from tests/lib/connector/sabre/principal.php) | 4 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/quotaplugin.php (renamed from tests/lib/connector/sabre/quotaplugin.php) | 4 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/auth.php (renamed from tests/lib/connector/sabre/requesttest/auth.php) | 0 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/exceptionplugin.php (renamed from tests/lib/connector/sabre/requesttest/exceptionplugin.php) | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/requesttest.php (renamed from tests/lib/connector/sabre/requesttest/requesttest.php) | 6 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/sapi.php (renamed from tests/lib/connector/sabre/requesttest/sapi.php) | 0 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php (renamed from tests/lib/connector/sabre/requesttest/uploadtest.php) | 0 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/tagsplugin.php (renamed from tests/lib/connector/sabre/tagsplugin.php) | 34 | ||||
-rw-r--r-- | apps/files/appinfo/info.xml | 4 | ||||
-rw-r--r-- | apps/files/appinfo/remote.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/appinfo/info.xml | 1 | ||||
-rw-r--r-- | core/shipped.json | 1 | ||||
-rw-r--r-- | lib/private/files/storage/common.php | 2 | ||||
-rw-r--r-- | remote.php | 2 |
56 files changed, 249 insertions, 177 deletions
diff --git a/.gitignore b/.gitignore index 4a625fb8580..a6baffc6a59 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ # ignore all apps except core ones /apps*/* +!/apps/dav !/apps/files !/apps/files_encryption !/apps/encryption diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml new file mode 100644 index 00000000000..955b381ce2b --- /dev/null +++ b/apps/dav/appinfo/info.xml @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<info> + <id>dav</id> + <name>WebDAV</name> + <description>ownCloud WebDAV endppint</description> + <licence>AGPL</licence> + <author>owncloud.org</author> + <requiremin>8.2</requiremin> + <shipped>true</shipped> + <standalone/> + <default_enable/> + <types> + <filesystem/> + </types> + <remote> + <files>appinfo/v1/webdav.php</files> + <webdav>appinfo/v1/webdav.php</webdav> + </remote> + <public> + <webdav>appinfo/v1/publicwebdav.php</webdav> + </public> +</info> diff --git a/apps/files_sharing/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php index 7d96c8e8c97..5bdfd94e658 100644 --- a/apps/files_sharing/publicwebdav.php +++ b/apps/dav/appinfo/v1/publicwebdav.php @@ -23,16 +23,16 @@ */ // load needed apps -$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging'); +$RUNTIME_APPTYPES = ['filesystem', 'authentication', 'logging']; OC_App::loadApps($RUNTIME_APPTYPES); OC_Util::obEnd(); // Backends -$authBackend = new OCA\Files_Sharing\Connector\PublicAuth(\OC::$server->getConfig()); +$authBackend = new OCA\DAV\Connector\PublicAuth(\OC::$server->getConfig()); -$serverFactory = new \OC\Connector\Sabre\ServerFactory( +$serverFactory = new OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->getDatabaseConnection(), diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php new file mode 100644 index 00000000000..b416ef64793 --- /dev/null +++ b/apps/dav/appinfo/v1/webdav.php @@ -0,0 +1,55 @@ +<?php +/** + * @author Bart Visscher <bartv@thisnet.nl> + * @author Frank Karlitschek <frank@owncloud.org> + * @author Jakob Sack <mail@jakobsack.de> + * @author Jörn Friedrich Dreyer <jfd@butonic.de> + * @author Lukas Reschke <lukas@owncloud.com> + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Vincent Petry <pvince81@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +// no php execution timeout for webdav +set_time_limit(0); + +// Turn off output buffering to prevent memory problems +\OC_Util::obEnd(); + +$serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory( + \OC::$server->getConfig(), + \OC::$server->getLogger(), + \OC::$server->getDatabaseConnection(), + \OC::$server->getUserSession(), + \OC::$server->getMountManager(), + \OC::$server->getTagManager() +); + +// Backends +$authBackend = new \OCA\DAV\Connector\Sabre\Auth(); +$requestUri = \OC::$server->getRequest()->getRequestUri(); + +$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function() { + // use the view for the logged in user + return \OC\Files\Filesystem::getView(); +}); + +// And off we go! +$server->exec(); diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/dav/lib/connector/publicauth.php index 4ac355180fc..f37be41402a 100644 --- a/apps/files_sharing/lib/connector/publicauth.php +++ b/apps/dav/lib/connector/publicauth.php @@ -24,7 +24,7 @@ * */ -namespace OCA\Files_Sharing\Connector; +namespace OCA\DAV\Connector; class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic { diff --git a/lib/private/connector/sabre/appenabledplugin.php b/apps/dav/lib/connector/sabre/appenabledplugin.php index 696a9fcb81f..e70512d0fd1 100644 --- a/lib/private/connector/sabre/appenabledplugin.php +++ b/apps/dav/lib/connector/sabre/appenabledplugin.php @@ -21,7 +21,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\App\IAppManager; use Sabre\DAV\Exception\Forbidden; diff --git a/lib/private/connector/sabre/auth.php b/apps/dav/lib/connector/sabre/auth.php index d33ffad7d5c..2e52a179d29 100644 --- a/lib/private/connector/sabre/auth.php +++ b/apps/dav/lib/connector/sabre/auth.php @@ -27,7 +27,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use Exception; use Sabre\DAV\Auth\Backend\AbstractBasic; diff --git a/lib/private/connector/sabre/blocklegacyclientplugin.php b/apps/dav/lib/connector/sabre/blocklegacyclientplugin.php index 9480cd1f06d..ed61f43a536 100644 --- a/lib/private/connector/sabre/blocklegacyclientplugin.php +++ b/apps/dav/lib/connector/sabre/blocklegacyclientplugin.php @@ -19,7 +19,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\IConfig; use Sabre\HTTP\RequestInterface; @@ -30,7 +30,7 @@ use Sabre\DAV\Exception; * Class BlockLegacyClientPlugin is used to detect old legacy sync clients and * returns a 403 status to those clients * - * @package OC\Connector\Sabre + * @package OCA\DAV\Connector\Sabre */ class BlockLegacyClientPlugin extends ServerPlugin { /** @var \Sabre\DAV\Server */ diff --git a/lib/private/connector/sabre/copyetagheaderplugin.php b/apps/dav/lib/connector/sabre/copyetagheaderplugin.php index fe1a8fab70e..b33b208adad 100644 --- a/lib/private/connector/sabre/copyetagheaderplugin.php +++ b/apps/dav/lib/connector/sabre/copyetagheaderplugin.php @@ -19,7 +19,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use \Sabre\HTTP\RequestInterface; use \Sabre\HTTP\ResponseInterface; diff --git a/lib/private/connector/sabre/custompropertiesbackend.php b/apps/dav/lib/connector/sabre/custompropertiesbackend.php index a05de1adb35..ff35476319f 100644 --- a/lib/private/connector/sabre/custompropertiesbackend.php +++ b/apps/dav/lib/connector/sabre/custompropertiesbackend.php @@ -21,7 +21,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\IDBConnection; use OCP\IUser; diff --git a/lib/private/connector/sabre/directory.php b/apps/dav/lib/connector/sabre/directory.php index 0261ab18047..8c736ea0108 100644 --- a/lib/private/connector/sabre/directory.php +++ b/apps/dav/lib/connector/sabre/directory.php @@ -26,15 +26,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; -use OC\Connector\Sabre\Exception\InvalidPath; -use OC\Connector\Sabre\Exception\FileLocked; +use OCA\DAV\Connector\Sabre\Exception\InvalidPath; +use OCA\DAV\Connector\Sabre\Exception\FileLocked; use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; use Sabre\DAV\Exception\Locked; -class Directory extends \OC\Connector\Sabre\Node +class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota { /** @@ -110,7 +110,7 @@ class Directory extends \OC\Connector\Sabre\Node $path = $this->fileView->getAbsolutePath($this->path) . '/' . $name; // using a dummy FileInfo is acceptable here since it will be refreshed after the put is complete $info = new \OC\Files\FileInfo($path, null, null, array(), null); - $node = new \OC\Connector\Sabre\File($this->fileView, $info); + $node = new \OCA\DAV\Connector\Sabre\File($this->fileView, $info); $node->acquireLock(ILockingProvider::LOCK_SHARED); return $node->put($data); } catch (\OCP\Files\StorageNotAvailableException $e) { @@ -179,9 +179,9 @@ class Directory extends \OC\Connector\Sabre\Node } if ($info['mimetype'] == 'httpd/unix-directory') { - $node = new \OC\Connector\Sabre\Directory($this->fileView, $info); + $node = new \OCA\DAV\Connector\Sabre\Directory($this->fileView, $info); } else { - $node = new \OC\Connector\Sabre\File($this->fileView, $info); + $node = new \OCA\DAV\Connector\Sabre\File($this->fileView, $info); } return $node; } diff --git a/lib/private/connector/sabre/dummygetresponseplugin.php b/apps/dav/lib/connector/sabre/dummygetresponseplugin.php index 6f5a009d084..7c7a332fedd 100644 --- a/lib/private/connector/sabre/dummygetresponseplugin.php +++ b/apps/dav/lib/connector/sabre/dummygetresponseplugin.php @@ -19,7 +19,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use Sabre\HTTP\ResponseInterface; use Sabre\HTTP\RequestInterface; @@ -34,7 +34,7 @@ use Sabre\HTTP\RequestInterface; * * FIXME: Remove once clients are all compliant. * - * @package OC\Connector\Sabre + * @package OCA\DAV\Connector\Sabre */ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { /** @var \Sabre\DAV\Server */ diff --git a/lib/private/connector/sabre/exception/entitytoolarge.php b/apps/dav/lib/connector/sabre/exception/entitytoolarge.php index e9699deeaf1..f5a7aa99c6d 100644 --- a/lib/private/connector/sabre/exception/entitytoolarge.php +++ b/apps/dav/lib/connector/sabre/exception/entitytoolarge.php @@ -20,7 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre\Exception; +namespace OCA\DAV\Connector\Sabre\Exception; /** * Entity Too Large diff --git a/lib/private/connector/sabre/exception/filelocked.php b/apps/dav/lib/connector/sabre/exception/filelocked.php index 1657a7ae376..1e1585edbda 100644 --- a/lib/private/connector/sabre/exception/filelocked.php +++ b/apps/dav/lib/connector/sabre/exception/filelocked.php @@ -22,7 +22,7 @@ * */ -namespace OC\Connector\Sabre\Exception; +namespace OCA\DAV\Connector\Sabre\Exception; use Exception; diff --git a/lib/private/connector/sabre/exception/invalidpath.php b/apps/dav/lib/connector/sabre/exception/invalidpath.php index 6d84078fb1c..608e427a5aa 100644 --- a/lib/private/connector/sabre/exception/invalidpath.php +++ b/apps/dav/lib/connector/sabre/exception/invalidpath.php @@ -19,7 +19,7 @@ * */ -namespace OC\Connector\Sabre\Exception; +namespace OCA\DAV\Connector\Sabre\Exception; use Sabre\DAV\Exception; diff --git a/lib/private/connector/sabre/exception/unsupportedmediatype.php b/apps/dav/lib/connector/sabre/exception/unsupportedmediatype.php index b7e8594427f..96b9b8332de 100644 --- a/lib/private/connector/sabre/exception/unsupportedmediatype.php +++ b/apps/dav/lib/connector/sabre/exception/unsupportedmediatype.php @@ -20,7 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre\Exception; +namespace OCA\DAV\Connector\Sabre\Exception; /** * Unsupported Media Type diff --git a/lib/private/connector/sabre/exceptionloggerplugin.php b/apps/dav/lib/connector/sabre/exceptionloggerplugin.php index 3f53431c8a1..64ec5cfda82 100644 --- a/lib/private/connector/sabre/exceptionloggerplugin.php +++ b/apps/dav/lib/connector/sabre/exceptionloggerplugin.php @@ -22,7 +22,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\ILogger; use Sabre\DAV\Exception; diff --git a/lib/private/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php index f4acc8290bc..9e515cdc687 100644 --- a/lib/private/connector/sabre/file.php +++ b/apps/dav/lib/connector/sabre/file.php @@ -30,12 +30,12 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; -use OC\Connector\Sabre\Exception\EntityTooLarge; -use OC\Connector\Sabre\Exception\FileLocked; -use OC\Connector\Sabre\Exception\UnsupportedMediaType; use OC\Files\Filesystem; +use OCA\DAV\Connector\Sabre\Exception\EntityTooLarge; +use OCA\DAV\Connector\Sabre\Exception\FileLocked; +use OCA\DAV\Connector\Sabre\Exception\UnsupportedMediaType; use OCP\Encryption\Exceptions\GenericEncryptionException; use OCP\Files\EntityTooLargeException; use OCP\Files\InvalidContentException; diff --git a/lib/private/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php index 38a7139d9e9..c9fc78a795f 100644 --- a/lib/private/connector/sabre/filesplugin.php +++ b/apps/dav/lib/connector/sabre/filesplugin.php @@ -24,7 +24,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use Sabre\DAV\IFile; use \Sabre\DAV\PropFind; @@ -161,7 +161,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { */ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) { - if ($node instanceof \OC\Connector\Sabre\Node) { + if ($node instanceof \OCA\DAV\Connector\Sabre\Node) { $propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) { return $node->getFileId(); @@ -181,9 +181,9 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { }); } - if ($node instanceof \OC\Connector\Sabre\File) { + if ($node instanceof \OCA\DAV\Connector\Sabre\File) { $propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function() use ($node) { - /** @var $node \OC\Connector\Sabre\File */ + /** @var $node \OCA\DAV\Connector\Sabre\File */ $directDownloadUrl = $node->getDirectDownload(); if (isset($directDownloadUrl['url'])) { return $directDownloadUrl['url']; @@ -192,7 +192,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { }); } - if ($node instanceof \OC\Connector\Sabre\Directory) { + if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) { $propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) { return $node->getSize(); }); @@ -254,7 +254,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { return; } $node = $this->server->tree->getNodeForPath($filePath); - if ($node instanceof \OC\Connector\Sabre\Node) { + if ($node instanceof \OCA\DAV\Connector\Sabre\Node) { $fileId = $node->getFileId(); if (!is_null($fileId)) { $this->server->httpResponse->setHeader('OC-FileId', $fileId); diff --git a/lib/private/connector/sabre/listenerplugin.php b/apps/dav/lib/connector/sabre/listenerplugin.php index ec628add28b..ec628add28b 100644 --- a/lib/private/connector/sabre/listenerplugin.php +++ b/apps/dav/lib/connector/sabre/listenerplugin.php diff --git a/lib/private/connector/sabre/lockplugin.php b/apps/dav/lib/connector/sabre/lockplugin.php index a3a7bb84e39..47203df905f 100644 --- a/lib/private/connector/sabre/lockplugin.php +++ b/apps/dav/lib/connector/sabre/lockplugin.php @@ -21,16 +21,14 @@ namespace OC\Connector\Sabre; -use OC\Connector\Sabre\Exception\FileLocked; +use OCA\DAV\Connector\Sabre\Exception\FileLocked; +use OCA\DAV\Connector\Sabre\Node; use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; use Sabre\DAV\Exception\NotFound; -use \Sabre\DAV\PropFind; -use \Sabre\DAV\PropPatch; use Sabre\DAV\ServerPlugin; use Sabre\DAV\Tree; use Sabre\HTTP\RequestInterface; -use Sabre\HTTP\ResponseInterface; class LockPlugin extends ServerPlugin { /** diff --git a/lib/private/connector/sabre/maintenanceplugin.php b/apps/dav/lib/connector/sabre/maintenanceplugin.php index 4b7ff8a39da..b9b261fbe05 100644 --- a/lib/private/connector/sabre/maintenanceplugin.php +++ b/apps/dav/lib/connector/sabre/maintenanceplugin.php @@ -24,7 +24,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\IConfig; use Sabre\DAV\Exception\ServiceUnavailable; diff --git a/lib/private/connector/sabre/node.php b/apps/dav/lib/connector/sabre/node.php index 30faf9941bd..377536b5308 100644 --- a/lib/private/connector/sabre/node.php +++ b/apps/dav/lib/connector/sabre/node.php @@ -28,9 +28,9 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; -use OC\Connector\Sabre\Exception\InvalidPath; +use OCA\DAV\Connector\Sabre\Exception\InvalidPath; abstract class Node implements \Sabre\DAV\INode { diff --git a/lib/private/connector/sabre/objecttree.php b/apps/dav/lib/connector/sabre/objecttree.php index 18d3c1dcf23..80c0ef74610 100644 --- a/lib/private/connector/sabre/objecttree.php +++ b/apps/dav/lib/connector/sabre/objecttree.php @@ -23,10 +23,10 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; -use OC\Connector\Sabre\Exception\InvalidPath; -use OC\Connector\Sabre\Exception\FileLocked; +use OCA\DAV\Connector\Sabre\Exception\InvalidPath; +use OCA\DAV\Connector\Sabre\Exception\FileLocked; use OC\Files\FileInfo; use OC\Files\Mount\MoveableMount; use OCP\Files\StorageInvalidException; @@ -160,9 +160,9 @@ class ObjectTree extends \Sabre\DAV\Tree { } if ($info->getType() === 'dir') { - $node = new \OC\Connector\Sabre\Directory($this->fileView, $info); + $node = new \OCA\DAV\Connector\Sabre\Directory($this->fileView, $info); } else { - $node = new \OC\Connector\Sabre\File($this->fileView, $info); + $node = new \OCA\DAV\Connector\Sabre\File($this->fileView, $info); } $this->cache[$path] = $node; diff --git a/lib/private/connector/sabre/principal.php b/apps/dav/lib/connector/sabre/principal.php index 9d81c4337d8..35215e1f63c 100644 --- a/lib/private/connector/sabre/principal.php +++ b/apps/dav/lib/connector/sabre/principal.php @@ -28,7 +28,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\IUserManager; use OCP\IConfig; diff --git a/lib/private/connector/sabre/quotaplugin.php b/apps/dav/lib/connector/sabre/quotaplugin.php index 22b687b3508..8340d489dc0 100644 --- a/lib/private/connector/sabre/quotaplugin.php +++ b/apps/dav/lib/connector/sabre/quotaplugin.php @@ -25,7 +25,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; /** * This plugin check user quota and deny creating files when they exceeds the quota. diff --git a/lib/private/connector/sabre/server.php b/apps/dav/lib/connector/sabre/server.php index 7a031f1d32a..eafe1b537f8 100644 --- a/lib/private/connector/sabre/server.php +++ b/apps/dav/lib/connector/sabre/server.php @@ -22,10 +22,10 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; /** - * Class \OC\Connector\Sabre\Server + * Class \OCA\DAV\Connector\Sabre\Server * * This class overrides some methods from @see \Sabre\DAV\Server. * diff --git a/lib/private/connector/sabre/serverfactory.php b/apps/dav/lib/connector/sabre/serverfactory.php index 893e29fd41c..b62f90ab802 100644 --- a/lib/private/connector/sabre/serverfactory.php +++ b/apps/dav/lib/connector/sabre/serverfactory.php @@ -20,7 +20,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use OCP\Files\Mount\IMountManager; use OCP\IConfig; @@ -59,22 +59,22 @@ class ServerFactory { */ public function createServer($baseUri, $requestUri, BackendInterface $authBackend, callable $viewCallBack) { // Fire up server - $objectTree = new \OC\Connector\Sabre\ObjectTree(); - $server = new \OC\Connector\Sabre\Server($objectTree); + $objectTree = new \OCA\DAV\Connector\Sabre\ObjectTree(); + $server = new \OCA\DAV\Connector\Sabre\Server($objectTree); // Set URL explicitly due to reverse-proxy situations $server->httpRequest->setUrl($requestUri); $server->setBaseUri($baseUri); // Load plugins $defaults = new \OC_Defaults(); - $server->addPlugin(new \OC\Connector\Sabre\MaintenancePlugin($this->config)); - $server->addPlugin(new \OC\Connector\Sabre\BlockLegacyClientPlugin($this->config)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin($this->config)); $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, $defaults->getName())); // FIXME: The following line is a workaround for legacy components relying on being able to send a GET to / - $server->addPlugin(new \OC\Connector\Sabre\DummyGetResponsePlugin()); - $server->addPlugin(new \OC\Connector\Sabre\ExceptionLoggerPlugin('webdav', $this->logger)); - $server->addPlugin(new \OC\Connector\Sabre\LockPlugin($objectTree)); - $server->addPlugin(new \OC\Connector\Sabre\ListenerPlugin($this->dispatcher)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\DummyGetResponsePlugin()); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $this->logger)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin($objectTree)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\ListenerPlugin($this->dispatcher)); // wait with registering these until auth is handled and the filesystem is setup $server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) { @@ -84,21 +84,21 @@ class ServerFactory { // Create ownCloud Dir if ($rootInfo->getType() === 'dir') { - $root = new \OC\Connector\Sabre\Directory($view, $rootInfo); + $root = new \OCA\DAV\Connector\Sabre\Directory($view, $rootInfo); } else { - $root = new \OC\Connector\Sabre\File($view, $rootInfo); + $root = new \OCA\DAV\Connector\Sabre\File($view, $rootInfo); } $objectTree->init($root, $view, $this->mountManager); - $server->addPlugin(new \OC\Connector\Sabre\FilesPlugin($objectTree, $view)); - $server->addPlugin(new \OC\Connector\Sabre\QuotaPlugin($view)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesPlugin($objectTree, $view)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view)); if($this->userSession->isLoggedIn()) { - $server->addPlugin(new \OC\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); // custom properties plugin must be the last one $server->addPlugin( new \Sabre\DAV\PropertyStorage\Plugin( - new \OC\Connector\Sabre\CustomPropertiesBackend( + new \OCA\DAV\Connector\Sabre\CustomPropertiesBackend( $objectTree, $this->databaseConnection, $this->userSession->getUser() @@ -106,7 +106,7 @@ class ServerFactory { ) ); } - $server->addPlugin(new \OC\Connector\Sabre\CopyEtagHeaderPlugin()); + $server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin()); }, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request return $server; } diff --git a/lib/private/connector/sabre/taglist.php b/apps/dav/lib/connector/sabre/taglist.php index 9fb34ba12d0..177cc23e805 100644 --- a/lib/private/connector/sabre/taglist.php +++ b/apps/dav/lib/connector/sabre/taglist.php @@ -20,7 +20,7 @@ * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; use Sabre\DAV; @@ -86,7 +86,7 @@ class TagList extends DAV\Property { * * @param \DOMElement $dom * @param array $propertyMap - * @return \OC\Connector\Sabre\TagList + * @return \OCA\DAV\Connector\Sabre\TagList */ static function unserialize(\DOMElement $dom, array $propertyMap) { diff --git a/lib/private/connector/sabre/tagsplugin.php b/apps/dav/lib/connector/sabre/tagsplugin.php index 7756eb45bda..7446d97790b 100644 --- a/lib/private/connector/sabre/tagsplugin.php +++ b/apps/dav/lib/connector/sabre/tagsplugin.php @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Connector\Sabre; +namespace OCA\DAV\Connector\Sabre; /** * ownCloud @@ -206,12 +206,12 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin PropFind $propFind, \Sabre\DAV\INode $node ) { - if (!($node instanceof \OC\Connector\Sabre\Node)) { + if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) { return; } // need prefetch ? - if ($node instanceof \OC\Connector\Sabre\Directory + if ($node instanceof \OCA\DAV\Connector\Sabre\Directory && $propFind->getDepth() !== 0 && (!is_null($propFind->getStatus(self::TAGS_PROPERTYNAME)) || !is_null($propFind->getStatus(self::FAVORITE_PROPERTYNAME)) diff --git a/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/connector/sabre/BlockLegacyClientPluginTest.php index 05488d9716a..1e390cf15f7 100644 --- a/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php +++ b/apps/dav/tests/unit/connector/sabre/BlockLegacyClientPluginTest.php @@ -21,7 +21,7 @@ namespace Test\Connector\Sabre; -use OC\Connector\Sabre\BlockLegacyClientPlugin; +use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; use Test\TestCase; use OCP\IConfig; diff --git a/tests/lib/connector/sabre/DummyGetResponsePluginTest.php b/apps/dav/tests/unit/connector/sabre/DummyGetResponsePluginTest.php index 096c2c5f0d2..1fd89c84ff6 100644 --- a/tests/lib/connector/sabre/DummyGetResponsePluginTest.php +++ b/apps/dav/tests/unit/connector/sabre/DummyGetResponsePluginTest.php @@ -21,7 +21,7 @@ namespace Test\Connector\Sabre; -use OC\Connector\Sabre\DummyGetResponsePlugin; +use OCA\DAV\Connector\Sabre\DummyGetResponsePlugin; use Test\TestCase; /** diff --git a/tests/lib/connector/sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/connector/sabre/MaintenancePluginTest.php index e5b50f71de6..c0acd4fc3de 100644 --- a/tests/lib/connector/sabre/MaintenancePluginTest.php +++ b/apps/dav/tests/unit/connector/sabre/MaintenancePluginTest.php @@ -21,7 +21,7 @@ namespace Test\Connector\Sabre; -use OC\Connector\Sabre\MaintenancePlugin; +use OCA\DAV\Connector\Sabre\MaintenancePlugin; use Test\TestCase; use OCP\IConfig; diff --git a/tests/lib/connector/sabre/copyetagheaderplugintest.php b/apps/dav/tests/unit/connector/sabre/copyetagheaderplugintest.php index 6b1b5e96fda..2080755cd51 100644 --- a/tests/lib/connector/sabre/copyetagheaderplugintest.php +++ b/apps/dav/tests/unit/connector/sabre/copyetagheaderplugintest.php @@ -11,14 +11,14 @@ namespace Tests\Connector\Sabre; class CopyEtagPluginTest extends \Test\TestCase { /** - * @var \OC\Connector\Sabre\CopyEtagHeaderPlugin + * @var \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin */ private $plugin; public function setUp() { parent::setUp(); $this->server = new \Sabre\DAV\Server(); - $this->plugin = new \OC\Connector\Sabre\CopyEtagHeaderPlugin(); + $this->plugin = new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin(); $this->plugin->initialize($this->server); } diff --git a/tests/lib/connector/sabre/custompropertiesbackend.php b/apps/dav/tests/unit/connector/sabre/custompropertiesbackend.php index 212bece9402..973a5d4c27b 100644 --- a/tests/lib/connector/sabre/custompropertiesbackend.php +++ b/apps/dav/tests/unit/connector/sabre/custompropertiesbackend.php @@ -21,7 +21,7 @@ class CustomPropertiesBackend extends \Test\TestCase { private $tree; /** - * @var \OC\Connector\Sabre\CustomPropertiesBackend + * @var \OCA\DAV\Connector\Sabre\CustomPropertiesBackend */ private $plugin; @@ -44,7 +44,7 @@ class CustomPropertiesBackend extends \Test\TestCase { ->method('getUID') ->will($this->returnValue($userId)); - $this->plugin = new \OC\Connector\Sabre\CustomPropertiesBackend( + $this->plugin = new \OCA\DAV\Connector\Sabre\CustomPropertiesBackend( $this->tree, \OC::$server->getDatabaseConnection(), $this->user @@ -143,7 +143,7 @@ class CustomPropertiesBackend extends \Test\TestCase { * Test setting/getting properties */ public function testSetGetPropertiesForFile() { - $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $this->tree->expects($this->any()) ->method('getNodeForPath') ->with('/dummypath') @@ -175,9 +175,9 @@ class CustomPropertiesBackend extends \Test\TestCase { * Test getting properties from directory */ public function testGetPropertiesForDirectory() { - $rootNode = $this->createTestNode('\OC\Connector\Sabre\Directory'); + $rootNode = $this->createTestNode('\OCA\DAV\Connector\Sabre\Directory'); - $nodeSub = $this->getMockBuilder('\OC\Connector\Sabre\File') + $nodeSub = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File') ->disableOriginalConstructor() ->getMock(); $nodeSub->expects($this->any()) @@ -259,7 +259,7 @@ class CustomPropertiesBackend extends \Test\TestCase { * Test delete property */ public function testDeleteProperty() { - $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $this->tree->expects($this->any()) ->method('getNodeForPath') ->with('/dummypath') diff --git a/tests/lib/connector/sabre/directory.php b/apps/dav/tests/unit/connector/sabre/directory.php index c846f109d87..d85290df80a 100644 --- a/tests/lib/connector/sabre/directory.php +++ b/apps/dav/tests/unit/connector/sabre/directory.php @@ -29,7 +29,7 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase { ->method('getPath') ->will($this->returnValue($path)); - return new \OC\Connector\Sabre\Directory($this->view, $this->info); + return new \OCA\DAV\Connector\Sabre\Directory($this->view, $this->info); } /** @@ -124,7 +124,7 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase { ->method('getRelativePath') ->will($this->returnValue('')); - $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info); + $dir = new \OCA\DAV\Connector\Sabre\Directory($this->view, $this->info); $nodes = $dir->getChildren(); $this->assertEquals(2, count($nodes)); @@ -142,12 +142,12 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase { ->method('getFileInfo') ->willThrowException(new \OCP\Files\StorageNotAvailableException()); - $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info); + $dir = new \OCA\DAV\Connector\Sabre\Directory($this->view, $this->info); $dir->getChild('.'); } /** - * @expectedException \OC\Connector\Sabre\Exception\InvalidPath + * @expectedException \OCA\DAV\Connector\Sabre\Exception\InvalidPath */ public function testGetChildThrowInvalidPath() { $this->view->expects($this->once()) @@ -156,7 +156,7 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase { $this->view->expects($this->never()) ->method('getFileInfo'); - $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info); + $dir = new \OCA\DAV\Connector\Sabre\Directory($this->view, $this->info); $dir->getChild('.'); } @@ -186,7 +186,7 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase { ->method('getStorage') ->will($this->returnValue($storage)); - $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info); + $dir = new \OCA\DAV\Connector\Sabre\Directory($this->view, $this->info); $this->assertEquals([200, 800], $dir->getQuotaInfo()); //200 used, 800 free } } diff --git a/tests/lib/connector/sabre/exception/invalidpathtest.php b/apps/dav/tests/unit/connector/sabre/exception/invalidpathtest.php index d2d58887d62..4c0af58ffea 100644 --- a/tests/lib/connector/sabre/exception/invalidpathtest.php +++ b/apps/dav/tests/unit/connector/sabre/exception/invalidpathtest.php @@ -2,7 +2,7 @@ namespace Test\Connector\Sabre\Exception; -use OC\Connector\Sabre\Exception\InvalidPath; +use OCA\DAV\Connector\Sabre\Exception\InvalidPath; /** * Copyright (c) 2015 Thomas Müller <deepdiver@owncloud.com> diff --git a/tests/lib/connector/sabre/exceptionloggerplugin.php b/apps/dav/tests/unit/connector/sabre/exceptionloggerplugin.php index 0662ba029d9..d85aa5a9cc3 100644 --- a/tests/lib/connector/sabre/exceptionloggerplugin.php +++ b/apps/dav/tests/unit/connector/sabre/exceptionloggerplugin.php @@ -9,8 +9,8 @@ namespace Test\Connector\Sabre; -use OC\Connector\Sabre\Exception\InvalidPath; -use OC\Connector\Sabre\ExceptionLoggerPlugin as PluginToTest; +use OCA\DAV\Connector\Sabre\Exception\InvalidPath; +use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin as PluginToTest; use OC\Log; use OCP\ILogger; use PHPUnit_Framework_MockObject_MockObject; diff --git a/tests/lib/connector/sabre/file.php b/apps/dav/tests/unit/connector/sabre/file.php index fe4c5ec7c29..6685ddac913 100644 --- a/tests/lib/connector/sabre/file.php +++ b/apps/dav/tests/unit/connector/sabre/file.php @@ -61,11 +61,11 @@ class File extends \Test\TestCase { ], [ new \OCP\Files\EntityTooLargeException(), - 'OC\Connector\Sabre\Exception\EntityTooLarge' + 'OCA\DAV\Connector\Sabre\Exception\EntityTooLarge' ], [ new \OCP\Files\InvalidContentException(), - 'OC\Connector\Sabre\Exception\UnsupportedMediaType' + 'OCA\DAV\Connector\Sabre\Exception\UnsupportedMediaType' ], [ new \OCP\Files\InvalidPathException(), @@ -73,11 +73,11 @@ class File extends \Test\TestCase { ], [ new \OCP\Files\LockNotAcquiredException('/test.txt', 1), - 'OC\Connector\Sabre\Exception\FileLocked' + 'OCA\DAV\Connector\Sabre\Exception\FileLocked' ], [ new \OCP\Lock\LockedException('/test.txt'), - 'OC\Connector\Sabre\Exception\FileLocked' + 'OCA\DAV\Connector\Sabre\Exception\FileLocked' ], [ new \OCP\Encryption\Exceptions\GenericEncryptionException(), @@ -137,7 +137,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $caughtException = null; @@ -196,7 +196,7 @@ class File extends \Test\TestCase { $info = new \OC\Files\FileInfo('/test.txt-chunking-12345-2-0', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL ], null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // put first chunk $this->assertNull($file->put('test data one')); @@ -204,7 +204,7 @@ class File extends \Test\TestCase { $info = new \OC\Files\FileInfo('/test.txt-chunking-12345-2-1', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL ], null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $caughtException = null; @@ -249,7 +249,7 @@ class File extends \Test\TestCase { null ); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // beforeMethod locks $view->lockFile($path, ILockingProvider::LOCK_SHARED); @@ -436,7 +436,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $thrown = false; @@ -469,7 +469,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $thrown = false; @@ -481,7 +481,7 @@ class File extends \Test\TestCase { // afterMethod unlocks $view->unlockFile($info->getPath(), ILockingProvider::LOCK_SHARED); - } catch (\OC\Connector\Sabre\Exception\FileLocked $e) { + } catch (\OCA\DAV\Connector\Sabre\Exception\FileLocked $e) { $thrown = true; } @@ -503,19 +503,19 @@ class File extends \Test\TestCase { $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt-chunking-12345-2-0', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL ], null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); $this->assertNull($file->put('test data one')); $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt-chunking-12345-2-1', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL ], null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $thrown = false; try { $file->put($this->getStream('test data')); - } catch (\OC\Connector\Sabre\Exception\FileLocked $e) { + } catch (\OCA\DAV\Connector\Sabre\Exception\FileLocked $e) { $thrown = true; } @@ -536,7 +536,7 @@ class File extends \Test\TestCase { $info = new \OC\Files\FileInfo('/*', null, null, array( 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $thrown = false; @@ -548,7 +548,7 @@ class File extends \Test\TestCase { // afterMethod unlocks $view->unlockFile($info->getPath(), ILockingProvider::LOCK_SHARED); - } catch (\OC\Connector\Sabre\Exception\InvalidPath $e) { + } catch (\OCA\DAV\Connector\Sabre\Exception\InvalidPath $e) { $thrown = true; } @@ -559,7 +559,7 @@ class File extends \Test\TestCase { /** * Test setting name with setName() with invalid chars * - * @expectedException \OC\Connector\Sabre\Exception\InvalidPath + * @expectedException \OCA\DAV\Connector\Sabre\Exception\InvalidPath */ public function testSetNameInvalidChars() { // setup @@ -572,7 +572,7 @@ class File extends \Test\TestCase { $info = new \OC\Files\FileInfo('/*', null, null, array( 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); $file->setName('/super*star.txt'); } @@ -600,7 +600,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $thrown = false; @@ -636,7 +636,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $file->delete(); @@ -654,7 +654,7 @@ class File extends \Test\TestCase { 'permissions' => 0 ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $file->delete(); @@ -677,7 +677,7 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ), null); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // action $file->delete(); @@ -714,7 +714,7 @@ class File extends \Test\TestCase { null ); - $file = new \OC\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info); $this->assertFalse( $this->isFileLocked($view, $path, \OCP\Lock\ILockingProvider::LOCK_SHARED), diff --git a/tests/lib/connector/sabre/filesplugin.php b/apps/dav/tests/unit/connector/sabre/filesplugin.php index 391062d6796..a91ca7a4ff7 100644 --- a/tests/lib/connector/sabre/filesplugin.php +++ b/apps/dav/tests/unit/connector/sabre/filesplugin.php @@ -9,12 +9,12 @@ namespace Tests\Connector\Sabre; * See the COPYING-README file. */ class FilesPlugin extends \Test\TestCase { - const GETETAG_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::GETETAG_PROPERTYNAME; - const FILEID_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::FILEID_PROPERTYNAME; - const SIZE_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::SIZE_PROPERTYNAME; - const PERMISSIONS_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::PERMISSIONS_PROPERTYNAME; - const LASTMODIFIED_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::LASTMODIFIED_PROPERTYNAME; - const DOWNLOADURL_PROPERTYNAME = \OC\Connector\Sabre\FilesPlugin::DOWNLOADURL_PROPERTYNAME; + const GETETAG_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::GETETAG_PROPERTYNAME; + const FILEID_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::FILEID_PROPERTYNAME; + const SIZE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::SIZE_PROPERTYNAME; + const PERMISSIONS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::PERMISSIONS_PROPERTYNAME; + const LASTMODIFIED_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::LASTMODIFIED_PROPERTYNAME; + const DOWNLOADURL_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::DOWNLOADURL_PROPERTYNAME; /** * @var \Sabre\DAV\Server @@ -22,12 +22,12 @@ class FilesPlugin extends \Test\TestCase { private $server; /** - * @var \Sabre\DAV\ObjectTree + * @var \Sabre\DAV\Tree */ private $tree; /** - * @var \OC\Connector\Sabre\FilesPlugin + * @var \OCA\DAV\Connector\Sabre\FilesPlugin */ private $plugin; @@ -48,7 +48,7 @@ class FilesPlugin extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); - $this->plugin = new \OC\Connector\Sabre\FilesPlugin($this->tree, $this->view); + $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view); $this->plugin->initialize($this->server); } @@ -81,7 +81,7 @@ class FilesPlugin extends \Test\TestCase { /** */ public function testGetPropertiesForFile() { - $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $propFind = new \Sabre\DAV\PropFind( '/dummyPath', @@ -115,7 +115,7 @@ class FilesPlugin extends \Test\TestCase { } public function testGetPublicPermissions() { - $this->plugin = new \OC\Connector\Sabre\FilesPlugin($this->tree, $this->view, true); + $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view, true); $this->plugin->initialize($this->server); $propFind = new \Sabre\DAV\PropFind( @@ -126,7 +126,7 @@ class FilesPlugin extends \Test\TestCase { 0 ); - $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $node->expects($this->any()) ->method('getDavPermissions') ->will($this->returnValue('DWCKMSR')); @@ -140,7 +140,7 @@ class FilesPlugin extends \Test\TestCase { } public function testGetPropertiesForDirectory() { - $node = $this->createTestNode('\OC\Connector\Sabre\Directory'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\Directory'); $propFind = new \Sabre\DAV\PropFind( '/dummyPath', @@ -174,7 +174,7 @@ class FilesPlugin extends \Test\TestCase { } public function testUpdateProps() { - $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $testDate = 'Fri, 13 Feb 2015 00:01:02 GMT'; diff --git a/tests/lib/connector/sabre/node.php b/apps/dav/tests/unit/connector/sabre/node.php index 3b3a6107813..a9610fd84b3 100644 --- a/tests/lib/connector/sabre/node.php +++ b/apps/dav/tests/unit/connector/sabre/node.php @@ -46,7 +46,7 @@ class Node extends \Test\TestCase { ->will($this->returnValue($type)); $view = $this->getMock('\OC\Files\View'); - $node = new \OC\Connector\Sabre\File($view, $info); + $node = new \OCA\DAV\Connector\Sabre\File($view, $info); $this->assertEquals($expected, $node->getDavPermissions()); } } diff --git a/tests/lib/connector/sabre/objecttree.php b/apps/dav/tests/unit/connector/sabre/objecttree.php index 1eaddf53a11..2691385c1c1 100644 --- a/tests/lib/connector/sabre/objecttree.php +++ b/apps/dav/tests/unit/connector/sabre/objecttree.php @@ -6,11 +6,11 @@ * See the COPYING-README file. */ -namespace Test\OC\Connector\Sabre; +namespace Test\OCA\DAV\Connector\Sabre; use OC\Files\FileInfo; -use OC\Connector\Sabre\Directory; +use OCA\DAV\Connector\Sabre\Directory; use OC\Files\Storage\Temporary; class TestDoubleFileView extends \OC\Files\View { @@ -62,7 +62,7 @@ class ObjectTree extends \Test\TestCase { /** * @dataProvider moveFailedInvalidCharsProvider - * @expectedException \OC\Connector\Sabre\Exception\InvalidPath + * @expectedException \OCA\DAV\Connector\Sabre\Exception\InvalidPath */ public function testMoveFailedInvalidChars($source, $destination, $updatables, $deletables) { $this->moveTest($source, $destination, $updatables, $deletables); @@ -104,7 +104,7 @@ class ObjectTree extends \Test\TestCase { $info = new FileInfo('', null, null, array(), null); $rootDir = new Directory($view, $info); - $objectTree = $this->getMock('\OC\Connector\Sabre\ObjectTree', + $objectTree = $this->getMock('\OCA\DAV\Connector\Sabre\ObjectTree', array('nodeExists', 'getNodeForPath'), array($rootDir, $view)); @@ -113,7 +113,7 @@ class ObjectTree extends \Test\TestCase { ->with($this->identicalTo($source)) ->will($this->returnValue(false)); - /** @var $objectTree \OC\Connector\Sabre\ObjectTree */ + /** @var $objectTree \OCA\DAV\Connector\Sabre\ObjectTree */ $mountManager = \OC\Files\Filesystem::getMountManager(); $objectTree->init($rootDir, $view, $mountManager); $objectTree->move($source, $destination); @@ -134,7 +134,7 @@ class ObjectTree extends \Test\TestCase { $_SERVER['HTTP_OC_CHUNKED'] = true; } - $rootNode = $this->getMockBuilder('\OC\Connector\Sabre\Directory') + $rootNode = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory') ->disableOriginalConstructor() ->getMock(); $mountManager = $this->getMock('\OC\Files\Mount\Manager'); @@ -152,7 +152,7 @@ class ObjectTree extends \Test\TestCase { ->with($fileInfoQueryPath) ->will($this->returnValue($fileInfo)); - $tree = new \OC\Connector\Sabre\ObjectTree(); + $tree = new \OCA\DAV\Connector\Sabre\ObjectTree(); $tree->init($rootNode, $view, $mountManager); $node = $tree->getNodeForPath($inputFileName); @@ -161,9 +161,9 @@ class ObjectTree extends \Test\TestCase { $this->assertEquals($outputFileName, $node->getName()); if ($type === 'file') { - $this->assertTrue($node instanceof \OC\Connector\Sabre\File); + $this->assertTrue($node instanceof \OCA\DAV\Connector\Sabre\File); } else { - $this->assertTrue($node instanceof \OC\Connector\Sabre\Directory); + $this->assertTrue($node instanceof \OCA\DAV\Connector\Sabre\Directory); } unset($_SERVER['HTTP_OC_CHUNKED']); @@ -239,7 +239,7 @@ class ObjectTree extends \Test\TestCase { } /** - * @expectedException \OC\Connector\Sabre\Exception\InvalidPath + * @expectedException \OCA\DAV\Connector\Sabre\Exception\InvalidPath */ public function testGetNodeForPathInvalidPath() { $path = '/foo\bar'; @@ -254,12 +254,12 @@ class ObjectTree extends \Test\TestCase { return [$storage, ltrim($path, '/')]; })); - $rootNode = $this->getMockBuilder('\OC\Connector\Sabre\Directory') + $rootNode = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory') ->disableOriginalConstructor() ->getMock(); $mountManager = $this->getMock('\OC\Files\Mount\Manager'); - $tree = new \OC\Connector\Sabre\ObjectTree(); + $tree = new \OCA\DAV\Connector\Sabre\ObjectTree(); $tree->init($rootNode, $view, $mountManager); $tree->getNodeForPath($path); @@ -278,12 +278,12 @@ class ObjectTree extends \Test\TestCase { return [$storage, ltrim($path, '/')]; })); - $rootNode = $this->getMockBuilder('\OC\Connector\Sabre\Directory') + $rootNode = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory') ->disableOriginalConstructor() ->getMock(); $mountManager = $this->getMock('\OC\Files\Mount\Manager'); - $tree = new \OC\Connector\Sabre\ObjectTree(); + $tree = new \OCA\DAV\Connector\Sabre\ObjectTree(); $tree->init($rootNode, $view, $mountManager); $this->assertInstanceOf('\Sabre\DAV\INode', $tree->getNodeForPath($path)); diff --git a/tests/lib/connector/sabre/principal.php b/apps/dav/tests/unit/connector/sabre/principal.php index 1841a79bec7..3c0abeac3f1 100644 --- a/tests/lib/connector/sabre/principal.php +++ b/apps/dav/tests/unit/connector/sabre/principal.php @@ -19,7 +19,7 @@ class Principal extends \Test\TestCase { private $userManager; /** @var IConfig */ private $config; - /** @var \OC\Connector\Sabre\Principal */ + /** @var \OCA\DAV\Connector\Sabre\Principal */ private $connector; public function setUp() { @@ -28,7 +28,7 @@ class Principal extends \Test\TestCase { $this->config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); - $this->connector = new \OC\Connector\Sabre\Principal($this->config, $this->userManager); + $this->connector = new \OCA\DAV\Connector\Sabre\Principal($this->config, $this->userManager); parent::setUp(); } diff --git a/tests/lib/connector/sabre/quotaplugin.php b/apps/dav/tests/unit/connector/sabre/quotaplugin.php index 3d9cd9b5da0..5d3364e1f8c 100644 --- a/tests/lib/connector/sabre/quotaplugin.php +++ b/apps/dav/tests/unit/connector/sabre/quotaplugin.php @@ -14,14 +14,14 @@ class Test_OC_Connector_Sabre_QuotaPlugin extends \Test\TestCase { private $server; /** - * @var \OC\Connector\Sabre\QuotaPlugin + * @var \OCA\DAV\Connector\Sabre\QuotaPlugin */ private $plugin; private function init($quota) { $view = $this->buildFileViewMock($quota); $this->server = new \Sabre\DAV\Server(); - $this->plugin = new \OC\Connector\Sabre\QuotaPlugin($view); + $this->plugin = new \OCA\DAV\Connector\Sabre\QuotaPlugin($view); $this->plugin->initialize($this->server); } diff --git a/tests/lib/connector/sabre/requesttest/auth.php b/apps/dav/tests/unit/connector/sabre/requesttest/auth.php index 7cab4da5264..7cab4da5264 100644 --- a/tests/lib/connector/sabre/requesttest/auth.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/auth.php diff --git a/tests/lib/connector/sabre/requesttest/exceptionplugin.php b/apps/dav/tests/unit/connector/sabre/requesttest/exceptionplugin.php index 2b9e5d6d46d..606b5a27984 100644 --- a/tests/lib/connector/sabre/requesttest/exceptionplugin.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/exceptionplugin.php @@ -10,7 +10,7 @@ namespace Test\Connector\Sabre\RequestTest; use Sabre\DAV\Exception; -class ExceptionPlugin extends \OC\Connector\Sabre\ExceptionLoggerPlugin { +class ExceptionPlugin extends \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin { /** * @var \Exception[] */ diff --git a/tests/lib/connector/sabre/requesttest/requesttest.php b/apps/dav/tests/unit/connector/sabre/requesttest/requesttest.php index 4d4c8173caa..4e1bc16819c 100644 --- a/tests/lib/connector/sabre/requesttest/requesttest.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/requesttest.php @@ -8,8 +8,8 @@ namespace Test\Connector\Sabre\RequestTest; -use OC\Connector\Sabre\Server; -use OC\Connector\Sabre\ServerFactory; +use OCA\DAV\Connector\Sabre\Server; +use OCA\DAV\Connector\Sabre\ServerFactory; use OC\Files\Mount\MountPoint; use OC\Files\Storage\StorageFactory; use OC\Files\Storage\Temporary; @@ -25,7 +25,7 @@ abstract class RequestTest extends TestCase { use MountProviderTrait; /** - * @var \OC\Connector\Sabre\ServerFactory + * @var \OCA\DAV\Connector\Sabre\ServerFactory */ protected $serverFactory; diff --git a/tests/lib/connector/sabre/requesttest/sapi.php b/apps/dav/tests/unit/connector/sabre/requesttest/sapi.php index cda9fdb70f5..cda9fdb70f5 100644 --- a/tests/lib/connector/sabre/requesttest/sapi.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/sapi.php diff --git a/tests/lib/connector/sabre/requesttest/uploadtest.php b/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php index 8f39aff81b9..8f39aff81b9 100644 --- a/tests/lib/connector/sabre/requesttest/uploadtest.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php diff --git a/tests/lib/connector/sabre/tagsplugin.php b/apps/dav/tests/unit/connector/sabre/tagsplugin.php index f8af73fecfb..4731e770cfa 100644 --- a/tests/lib/connector/sabre/tagsplugin.php +++ b/apps/dav/tests/unit/connector/sabre/tagsplugin.php @@ -10,9 +10,9 @@ namespace Tests\Connector\Sabre; */ class TagsPlugin extends \Test\TestCase { - const TAGS_PROPERTYNAME = \OC\Connector\Sabre\TagsPlugin::TAGS_PROPERTYNAME; - const FAVORITE_PROPERTYNAME = \OC\Connector\Sabre\TagsPlugin::FAVORITE_PROPERTYNAME; - const TAG_FAVORITE = \OC\Connector\Sabre\TagsPlugin::TAG_FAVORITE; + const TAGS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::TAGS_PROPERTYNAME; + const FAVORITE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::FAVORITE_PROPERTYNAME; + const TAG_FAVORITE = \OCA\DAV\Connector\Sabre\TagsPlugin::TAG_FAVORITE; /** * @var \Sabre\DAV\Server @@ -35,7 +35,7 @@ class TagsPlugin extends \Test\TestCase { private $tagger; /** - * @var \OC\Connector\Sabre\TagsPlugin + * @var \OCA\DAV\Connector\Sabre\TagsPlugin */ private $plugin; @@ -51,7 +51,7 @@ class TagsPlugin extends \Test\TestCase { ->method('load') ->with('files') ->will($this->returnValue($this->tagger)); - $this->plugin = new \OC\Connector\Sabre\TagsPlugin($this->tree, $this->tagManager); + $this->plugin = new \OCA\DAV\Connector\Sabre\TagsPlugin($this->tree, $this->tagManager); $this->plugin->initialize($this->server); } @@ -59,7 +59,7 @@ class TagsPlugin extends \Test\TestCase { * @dataProvider tagsGetPropertiesDataProvider */ public function testGetProperties($tags, $requestedProperties, $expectedProperties) { - $node = $this->getMockBuilder('\OC\Connector\Sabre\Node') + $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node') ->disableOriginalConstructor() ->getMock(); $node->expects($this->any()) @@ -98,13 +98,13 @@ class TagsPlugin extends \Test\TestCase { * @dataProvider tagsGetPropertiesDataProvider */ public function testPreloadThenGetProperties($tags, $requestedProperties, $expectedProperties) { - $node1 = $this->getMockBuilder('\OC\Connector\Sabre\File') + $node1 = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File') ->disableOriginalConstructor() ->getMock(); $node1->expects($this->any()) ->method('getId') ->will($this->returnValue(111)); - $node2 = $this->getMockBuilder('\OC\Connector\Sabre\File') + $node2 = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File') ->disableOriginalConstructor() ->getMock(); $node2->expects($this->any()) @@ -119,7 +119,7 @@ class TagsPlugin extends \Test\TestCase { $expectedCallCount = 1; } - $node = $this->getMockBuilder('\OC\Connector\Sabre\Directory') + $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory') ->disableOriginalConstructor() ->getMock(); $node->expects($this->any()) @@ -184,7 +184,7 @@ class TagsPlugin extends \Test\TestCase { array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME), array( 200 => array( - self::TAGS_PROPERTYNAME => new \OC\Connector\Sabre\TagList(array('tag1', 'tag2')), + self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')), self::FAVORITE_PROPERTYNAME => true, ) ) @@ -195,7 +195,7 @@ class TagsPlugin extends \Test\TestCase { array(self::TAGS_PROPERTYNAME), array( 200 => array( - self::TAGS_PROPERTYNAME => new \OC\Connector\Sabre\TagList(array('tag1', 'tag2')), + self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')), ) ) ), @@ -223,7 +223,7 @@ class TagsPlugin extends \Test\TestCase { array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME), array( 200 => array( - self::TAGS_PROPERTYNAME => new \OC\Connector\Sabre\TagList(array()), + self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array()), self::FAVORITE_PROPERTYNAME => false, ) ) @@ -234,7 +234,7 @@ class TagsPlugin extends \Test\TestCase { public function testUpdateTags() { // this test will replace the existing tags "tagremove" with "tag1" and "tag2" // and keep "tagkeep" - $node = $this->getMockBuilder('\OC\Connector\Sabre\Node') + $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node') ->disableOriginalConstructor() ->getMock(); $node->expects($this->any()) @@ -266,7 +266,7 @@ class TagsPlugin extends \Test\TestCase { // properties to set $propPatch = new \Sabre\DAV\PropPatch(array( - self::TAGS_PROPERTYNAME => new \OC\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep')) + self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep')) )); $this->plugin->handleUpdateProperties( @@ -285,7 +285,7 @@ class TagsPlugin extends \Test\TestCase { } public function testUpdateTagsFromScratch() { - $node = $this->getMockBuilder('\OC\Connector\Sabre\Node') + $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node') ->disableOriginalConstructor() ->getMock(); $node->expects($this->any()) @@ -312,7 +312,7 @@ class TagsPlugin extends \Test\TestCase { // properties to set $propPatch = new \Sabre\DAV\PropPatch(array( - self::TAGS_PROPERTYNAME => new \OC\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep')) + self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep')) )); $this->plugin->handleUpdateProperties( @@ -333,7 +333,7 @@ class TagsPlugin extends \Test\TestCase { public function testUpdateFav() { // this test will replace the existing tags "tagremove" with "tag1" and "tag2" // and keep "tagkeep" - $node = $this->getMockBuilder('\OC\Connector\Sabre\Node') + $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node') ->disableOriginalConstructor() ->getMock(); $node->expects($this->any()) diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 8586c6794f2..9ec6a9c43e7 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -12,10 +12,6 @@ <types> <filesystem/> </types> - <remote> - <files>appinfo/remote.php</files> - <webdav>appinfo/remote.php</webdav> - </remote> <documentation> <user>user-files</user> </documentation> diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 02f7f3c027f..d6a745d028e 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -32,7 +32,7 @@ set_time_limit(0); // Turn off output buffering to prevent memory problems \OC_Util::obEnd(); -$serverFactory = new \OC\Connector\Sabre\ServerFactory( +$serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->getDatabaseConnection(), @@ -43,7 +43,7 @@ $serverFactory = new \OC\Connector\Sabre\ServerFactory( ); // Backends -$authBackend = new \OC\Connector\Sabre\Auth(); +$authBackend = new \OCA\DAV\Connector\Sabre\Auth(); $requestUri = \OC::$server->getRequest()->getRequestUri(); $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function() { diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 28c64cbb1b4..cf69050a9f2 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -17,6 +17,5 @@ Turning the feature off removes shared files and folders on the server for all s </types> <public> <files>public.php</files> - <webdav>publicwebdav.php</webdav> </public> </info> diff --git a/core/shipped.json b/core/shipped.json index ffa4ee9c738..184308d7a48 100644 --- a/core/shipped.json +++ b/core/shipped.json @@ -4,6 +4,7 @@ "activity", "admin_audit", "encryption", + "dav", "enterprise_key", "external", "files", diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index d9fee48bedb..cdd8eefd0d3 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -372,7 +372,7 @@ abstract class Common implements Storage { * @return string|false */ public function getETag($path) { - $ETagFunction = \OC\Connector\Sabre\Node::$ETagFunction; + $ETagFunction = \OCA\DAV\Connector\Sabre\Node::$ETagFunction; if ($ETagFunction) { $hash = call_user_func($ETagFunction, $path); return $hash; diff --git a/remote.php b/remote.php index b901b1f0fd7..0282877ca2a 100644 --- a/remote.php +++ b/remote.php @@ -26,7 +26,7 @@ * */ -use OC\Connector\Sabre\ExceptionLoggerPlugin; +use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\Server; |