Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Filesystem API: IStorage #25671

Closed
labkode opened this issue Aug 1, 2016 · 5 comments
Closed

New Filesystem API: IStorage #25671

labkode opened this issue Aug 1, 2016 · 5 comments
Assignees
Milestone

Comments

@labkode
Copy link
Member

labkode commented Aug 1, 2016

@DeepDiver1975 @PVince81 @icewind1991 @moscicki @NadirRoGue

Hi,
I have taken the latest ownCloud stable version (9.1) and started to prototyping a custom EOS storage on it. I started to implement the methods required by the IStorage interface to create a HomeStorage based on EOS but I have found that there are still core classes that rely on \OCP\Files\Storage instead of \OCP\Files\IStorage. See trace:

Type: TypeError
Code: 0
Message: Argument 2 passed to OC_Util::{closure}() must implement interface OCP\Files\Storage, instance of OC\Files\EosStore\HomeEosStoreStorage given, called in /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/StorageFactory.php on line 100
File: /Applications/MAMP/htdocs/owncloud/lib/private/legacy/util.php
Line: 173

Trace
#0 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/StorageFactory.php(100): OC_Util::{closure}('/test/', Object(OC\Files\EosStore\HomeEosStoreStorage), Object(OC\Files\Mount\MountPoint))
#1 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/StorageFactory.php(82): OC\Files\Storage\StorageFactory->wrap(Object(OC\Files\Mount\MountPoint), Object(OC\Files\EosStore\HomeEosStoreStorage))
#2 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Mount/MountPoint.php(137): OC\Files\Storage\StorageFactory->getInstance(Object(OC\Files\Mount\MountPoint), '\\OC\\Files\\EosSt...', Array)
#3 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Mount/MountPoint.php(160): OC\Files\Mount\MountPoint->createStorage()
#4 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Filesystem.php(315): OC\Files\Mount\MountPoint->getStorage()
#5 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Filesystem.php(418): OC\Files\Filesystem::getStorage('test')
#6 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Filesystem.php(370): OC\Files\Filesystem::initMountPoints('test')
#7 /Applications/MAMP/htdocs/owncloud/lib/private/legacy/util.php(255): OC\Files\Filesystem::init('test', '/test/files')
#8 /Applications/MAMP/htdocs/owncloud/lib/base.php(890): OC_Util::setupFS()
#9 /Applications/MAMP/htdocs/owncloud/index.php(39): OC::handleRequest()
#10 {main}

I also attach the diagram of storage classes; ideally I would like to have my EOS classes implementing the IStorage and not the Storage interface (that has been deprecated).
diagram

I think the solution to this problem is to promote the use of IStorage in any class that relies on Storage, but maybe that affects some logic :(

Another class that relies on methods not defined in the IStorage is the Wrapper,

Type: Error
Code: 0
Message: Call to undefined method OC\Files\EosStore\HomeEosStoreStorage::getStorageCache()
File: /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php
Line: 447

Trace
#0 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(447): OC\Files\Storage\Wrapper\Wrapper->getStorageCache()
#1 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(447): OC\Files\Storage\Wrapper\Wrapper->getStorageCache()
#2 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(447): OC\Files\Storage\Wrapper\Wrapper->getStorageCache()
#3 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Config/LazyStorageMountInfo.php(54): OC\Files\Storage\Wrapper\Wrapper->getStorageCache()
#4 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Config/UserMountCache.php(138): OC\Files\Config\LazyStorageMountInfo->getStorageId()
#5 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Config/UserMountCache.php(124): OC\Files\Config\UserMountCache->addToCache(Object(OC\Files\Config\LazyStorageMountInfo))
#6 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Config/MountProviderCollection.php(133): OC\Files\Config\UserMountCache->registerMounts(Object(OC\User\User), Array)
#7 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Filesystem.php(425): OC\Files\Config\MountProviderCollection->registerMounts(Object(OC\User\User), Array)
#8 /Applications/MAMP/htdocs/owncloud/lib/private/Files/Filesystem.php(370): OC\Files\Filesystem::initMountPoints('test')
#9 /Applications/MAMP/htdocs/owncloud/lib/private/legacy/util.php(255): OC\Files\Filesystem::init('test', '/test/files')
#10 /Applications/MAMP/htdocs/owncloud/lib/base.php(890): OC_Util::setupFS()
#11 /Applications/MAMP/htdocs/owncloud/index.php(39): OC::handleRequest()
#12 {main}
@DeepDiver1975 DeepDiver1975 self-assigned this Aug 1, 2016
@DeepDiver1975 DeepDiver1975 added this to the 9.2 milestone Aug 1, 2016
@butonic
Copy link
Member

butonic commented Sep 14, 2016

Ping @DeepDiver1975 as discussed today

@butonic
Copy link
Member

butonic commented Sep 14, 2016

Next step = implement user table so we can properly initialize the storages?

@PVince81
Copy link
Contributor

PVince81 commented Dec 8, 2016

What would be the task here ? Adding the methods to the interface would likely break other existing storages. So make it a IStorage2 interface and make sure to include all methods ?

@PVince81
Copy link
Contributor

PVince81 commented Apr 6, 2017

CLosing due to lack of feedback.

We already have enough "rewrite the storage thing" tickets: #22388

Will link back from there

@PVince81 PVince81 closed this as completed Apr 6, 2017
@PVince81 PVince81 mentioned this issue Apr 6, 2017
4 tasks
@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants