Task #54230

Epic #55070: Workpackages

Epic #54260: WP: FAL Missing Issues / Features / API

Story #54268: As an TYPO3-Contributor I want to have a clean CodeBase in order maintain the product

Refactor Driver API

Added by Steffen Ritter about 6 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2013-12-06
Due date:
2013-12-31
% Done:

100%

Estimated time:
12.00 h
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

The Driver is a concept to just encapsulate the Filesystem access...
It should not know about FileObject or FolderObjects... A filesystem only knows about its Identifiers.

The connection to the FAL Object world happens in the ResourceStorage.

Refactor the Driver to only act on Identifiers and define an Interface for that, replace all type-hints for abstract Driver to use the interface


Related issues

Related to TYPO3 Core - Task #53770: ResourceStorage uses deprecated driver API Closed 2013-11-19
Related to TYPO3 Core - Task #55416: Accessing the root folder of a file mount is not possible for non-admins Closed 2014-01-29
Related to TYPO3 Core - Bug #57415: Local driver does not sanitize directory names on recursive creation Closed 2014-03-28
Related to TYPO3 Core - Bug #85302: ResourceStorage throws wrong exception on folder move between storages Closed 2018-06-18
Precedes TYPO3 Core - Task #54231: The Driver Registry should check for the implementation of the Interface Closed 2014-01-01 2014-01-01

Associated revisions

Revision f83eddd5 (diff)
Added by Steffen Ritter almost 6 years ago

[!!!][TASK] Driver API has too many crosscutting concerns

The Driver within the FileAbstractionLayer is the actual
abstraction of a concrete file-system meant to unify
access to several kind of storage-systems the file data
might reside in. For each way of storing files there
has to be a driver.

Therefore a driver is solely a unique API to interact with
an underlying storage system based upon its own identifier
system.

Opposite to that, the AbstractDriver (defining our Interface)
knows about its storage, file- and folder-objects as well
as indexes. The methods within the current driver need to
implement more FAL-internal logic than one would expect from
what the driver is purposed to. As a result only a few drivers
are existing by now. In addition it's nearly impossible to
change FAL interals without touching every driver out there.

This change deals with these problems. In several steps the
current driver API has been refactored to have less dependencies
and only fullfills it's original purpose: the abstraction of a
file storage system.

The following things are considered:
1. Change every return value which has been an object to the
identifier and adapt the ResourceStorage accordingly.
2. Change every method parameter being FileInterface, File,
AbstractFile or Folder objects to a string: the identifier.
3. Get rid of the storage as a member variable, only the uid
of the storage is needed at two places.
4. Remove all abstract methods from the AbstractDriver and
put them in a newly created DriverInterface.
5. Exchange all references to AbstractDriver to the interface.
6. Remove unused methods, which came to light doing so.
7. Merge addFile/removeFile and *Raw since the do the same if
no objects are in place.
8. Unify the creation of folder objects and how information
is retrieved (analogue to files now).
9. Unify and simplify the methods for retrieving folder
contents (files / folders).
10. Adapt the UnitTests of both classes to the changes.
This also leads to the removal of some tests which are
superfluous with that change.
11. Make the DriverRegistry check the implementation of the
newly created interface.
12. Unify the parameter names in the methods.

Releases: 6.2
Resolves: #54230
Resolves: #54231
Change-Id: I4a51572c6a10859e6fd5f12f6cb539950444992e
Reviewed-on: https://review.typo3.org/26520
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack

Revision 84b6e61f (diff)
Added by Steffen Ritter almost 6 years ago

[TASK] Skip two tests in LocalDriverTests in PHP 5.3

For most tests in the LocalDriverTest vfsStream is used to
emulate the filesystem. This needs PHP filesystem functions
to use the stream wrappers.

For touch() this has been enabled with PHP 5.4. The reversal
conclusion is, that this does not work with PHP 5.3 which
causes failing tests there.

As a result If the PHP version is 5.3 we skip the two tests.
This is a follow-up to https://review.typo3.org/#/c/26520/

Resolves: #54230
Releases: 6.2
Change-Id: I4e92927e1d77f825bab8583318a944a8916051d5
Reviewed-on: https://review.typo3.org/26845
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

History

#1 Updated by Steffen Ritter almost 6 years ago

  • Parent task set to #54268

#2 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#3 Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#4 Updated by Gerrit Code Review almost 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#5 Updated by Gerrit Code Review almost 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#6 Updated by Steffen Ritter almost 6 years ago

  • % Done changed from 0 to 70

#7 Updated by Gerrit Code Review almost 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#8 Updated by Gerrit Code Review almost 6 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#9 Updated by Gerrit Code Review almost 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#10 Updated by Gerrit Code Review almost 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#11 Updated by Gerrit Code Review almost 6 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#12 Updated by Gerrit Code Review almost 6 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#13 Updated by Gerrit Code Review almost 6 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26520

#14 Updated by Steffen Ritter almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 70 to 100

#15 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26845

#16 Updated by Steffen Ritter almost 6 years ago

  • Status changed from Under Review to Resolved

#17 Updated by Steffen Ritter almost 6 years ago

  • % Done changed from 100 to 90

#18 Updated by Steffen Ritter almost 6 years ago

  • % Done changed from 90 to 100

#19 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

#20 Updated by Mathias Brodala over 1 year ago

  • Related to Bug #85302: ResourceStorage throws wrong exception on folder move between storages added

Also available in: Atom PDF