diff --git a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php index 26ab2f4654e6b2173192308d517faa4c5efda78b..b771b1913cd3136b13772432001a62a4ca4cc2af 100644 --- a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php +++ b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php @@ -288,9 +288,12 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver 1314516810 ); } + $absolutePath = $this->getAbsolutePath($folderIdentifier); return array( 'identifier' => $folderIdentifier, 'name' => PathUtility::basename($folderIdentifier), + 'mtime' => filemtime($absolutePath), + 'ctime' => filectime($absolutePath), 'storage' => $this->storageUid ); } diff --git a/typo3/sysext/core/Classes/Resource/Folder.php b/typo3/sysext/core/Classes/Resource/Folder.php index a1a7b893b43e3b50bfde264fb989e437353e2c81..8714c0d58168ddf844f7a2e5409e26c69fd2d9a7 100644 --- a/typo3/sysext/core/Classes/Resource/Folder.php +++ b/typo3/sysext/core/Classes/Resource/Folder.php @@ -512,4 +512,24 @@ class Folder implements FolderInterface { return $this->getStorage()->getFolder($this->getStorage()->getFolderIdentifierFromFileIdentifier($this->getIdentifier())); } + + /** + * Returns the modification time of the file as Unix timestamp + * + * @return int + */ + public function getModificationTime() + { + return $this->storage->getFolderInfo($this)['mtime']; + } + + /** + * Returns the creation time of the file as Unix timestamp + * + * @return int + */ + public function getCreationTime() + { + return $this->storage->getFolderInfo($this)['ctime']; + } } diff --git a/typo3/sysext/core/Classes/Resource/FolderInterface.php b/typo3/sysext/core/Classes/Resource/FolderInterface.php index a1e242c385deeac0965e4d321884013d534272e8..547eae263308573d0350e5eef9ba5c70800e8406 100644 --- a/typo3/sysext/core/Classes/Resource/FolderInterface.php +++ b/typo3/sysext/core/Classes/Resource/FolderInterface.php @@ -76,4 +76,18 @@ interface FolderInterface extends ResourceInterface * @return bool TRUE if deletion succeeded */ public function delete(); + + /** + * Returns the modification time of the folder as Unix timestamp + * + * @return int + */ + public function getModificationTime(); + + /** + * Returns the creation time of the folder as Unix timestamp + * + * @return int + */ + public function getCreationTime(); } diff --git a/typo3/sysext/core/Classes/Resource/InaccessibleFolder.php b/typo3/sysext/core/Classes/Resource/InaccessibleFolder.php index cd5b504b561309a8b114ca6184544fade0665b78..4f17ed42d484408e72b9c915e2df998413909eab 100644 --- a/typo3/sysext/core/Classes/Resource/InaccessibleFolder.php +++ b/typo3/sysext/core/Classes/Resource/InaccessibleFolder.php @@ -265,4 +265,20 @@ class InaccessibleFolder extends Folder { $this->throwInaccessibleException(); } + + /** + * @return int + */ + public function getModificationTime() + { + return 0; + } + + /** + * @return int + */ + public function getCreationTime() + { + return 0; + } } diff --git a/typo3/sysext/core/Classes/Resource/ResourceStorage.php b/typo3/sysext/core/Classes/Resource/ResourceStorage.php index 2527c934f2cabeff6d8ecbde65f024cea845dac2..3a5388915565fd3fce28cd282efe8c1f4f643303 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceStorage.php +++ b/typo3/sysext/core/Classes/Resource/ResourceStorage.php @@ -2293,6 +2293,17 @@ class ResourceStorage implements ResourceStorageInterface return $newFolder; } + /** + * Retrieves information about a folder + * + * @param Folder $folder + * @return array + */ + public function getFolderInfo(Folder $folder) + { + return $this->driver->getFolderInfoByIdentifier($folder->getIdentifier()); + } + /** * Returns the default folder where new files are stored if no other folder is given. * diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-65165-AdditionalMethodsInFolderInterface.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-65165-AdditionalMethodsInFolderInterface.rst new file mode 100644 index 0000000000000000000000000000000000000000..c56366bbe1731f3e3ada8f8d0c105be063d55125 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-65165-AdditionalMethodsInFolderInterface.rst @@ -0,0 +1,30 @@ +===================================================== +Breaking: #65165 - AdditionalMethodsInFolderInterface +===================================================== + +Description +=========== + +The interface ``AdditionalMethodsInFolderInterface`` has received two additional methods. Classes that implement +``FolderInterface`` have to implement those methods as well. The new methods are: + +* ``getModificationTime()`` - Returns the modification time of the folder as Unix timestamp. +* ``getCreationTime()`` - Returns the creation time of the folder as Unix timestamp. + + +Impact +====== + +Classes implementing the ``FolderInterface`` no longer fulfill the requirements of the interface. + + +Affected Installations +====================== + +Installations that use custom implementations of the ``FolderInterface``. + + +Migration +========= + +Implement the two new methods in custom implementations of the ``FolderInterface``. diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php index bfecd1ce5686116746cf7d5c4032f578b45e3b34..81794f98c387fb208d21bb7bb1ec32bee39333b3 100644 --- a/typo3/sysext/filelist/Classes/FileList.php +++ b/typo3/sysext/filelist/Classes/FileList.php @@ -503,8 +503,8 @@ class FileList extends AbstractRecordList $theData[$field] = $this->getLanguageService()->getLL('folder', true); break; case 'tstamp': - // @todo: FAL: how to get the mtime info -- $theData[$field] = \TYPO3\CMS\Backend\Utility\BackendUtility::date($theFile['tstamp']); - $theData[$field] = '-'; + $tstamp = $folderObject->getModificationTime(); + $theData[$field] = $tstamp ? BackendUtility::date($tstamp) : '-'; break; case 'file': $theData[$field] = $this->linkWrapDir($displayName, $folderObject);