Project

General

Profile

Actions

Feature #77108

closed

Defining a complete interface version of ResourceStorageInterface

Added by Lars Tode almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2016-07-15
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

Last week we tried to create an own ResourceStorage as close as possibile to the TYPO3 core.

During the check of the internal interface for the ResourceStorage (typo3/sysext/core/Classes/Resource/ResourceStorageInterface.php) we figured out, that the interface does not define any kind of methods.

The current implementation of the ResourceStorage (typo3/sysext/core/Classes/Resource/ResourceStorage.php) has a lot of public methods.

The public methods in class ResourceStorage should be checked if they can be used for the ResourceStorageInterface.

Additionaly the arguments of the methods should refer to the interfaces instead of the implementation of an interface.

Example


/**
 * Assures read permission for given folder.
 *
 * @param Folder $folder If a folder is given, mountpoints are checked. If not only user folder read permissions are checked.
 * @return void
 * @throws Exception\InsufficientFolderAccessPermissionsException
 */
protected function assureFolderReadPermission(Folder $folder = null)
{
    // Here some code
}

What could be an issue are classes who implements these interfaces and did not fullfil the new method signature.

Actions #1

Updated by Frans Saris almost 8 years ago

Hi Lars,

what use-case do you have to implement your own ResourceStorage? Currently the ResourceStorage isn't implemented as a replaceable object so not sure if it makes sense to have all the public methods copied to the interface. The current interface is mostly there to prevent the whole ResourceStorage class being loaded in the bootstrap just to use the constants you find now in ResourceStorageInterface.

Gr. Frans

Actions #2

Updated by Lars Tode almost 8 years ago

Hi Frans,

Our use-case is to implement a files and folders that not exists on the server. We retrieve these data from a service and want TYPO3 to handle is natively as files.

The first step was the analysis of the existing ResourceStorage. There are some issues that did not work with the current implementation.

Some methods uses implementation of classes as Folder instead of FolderInterface.
The storage itself is connected to close to the database. It checks the status of the storage based on information from the database, which we did not have.

Greetings,

Lars

Actions #3

Updated by Frans Saris almost 8 years ago

But for that we have the drivers. Can't you create your own driver for this?

Actions #4

Updated by Nicole Cordes almost 8 years ago

  • Status changed from New to Needs Feedback

Hi,

I would solve it with an own driver as well. An example (maybe not that nice) is yag which added database entries to the filelist module.

Actions #5

Updated by Lars Tode almost 8 years ago

Hi,

we implemented an own driver for the service.

One problem we have is, that the ResourceStorage did a lot of local file operations. The method addFile inside the ResourceStorage for example expects that the file and folder exists.

Even an driver could not avoid this handling.

Regards

Lars

Actions #6

Updated by Lars Tode over 7 years ago

I had a really good talk with Frans on the Developer Days.

The Interface exists only for performance purposes, everything else should be implemented by a driver.

Next steps will be:

  1. Add a documentation for the driver
    • What it does
    • Implementation example
  2. Adding a comment at the top of the ResourceStorageInterface with an hint to the driver documentation
Actions #7

Updated by Riccardo De Contardi over 7 years ago

  • Status changed from Needs Feedback to New
Actions #8

Updated by Susanne Moog about 5 years ago

  • Status changed from New to Needs Feedback

Is the documentation still being written or can we close this issue?

Actions #9

Updated by Benni Mack over 4 years ago

  • Status changed from Needs Feedback to Closed

I'll close this issue. The (current) interface is deprecated in TYPO3 v10, as it does not server its purpose. Instead we could now add a new interface now (with DI in mind), but that's a different ticket then. If anyone wants to pick thaat up, then feel free to create a new ticket.

Actions

Also available in: Atom PDF