<?php
namespace TYPO3\CMS\Core\Resource\Driver;
-/**
+/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
/**
* Sets the storage uid the driver belongs to
*
- * @param integer $storageUid
+ * @param int $storageUid
* @return void
*/
public function setStorageUid($storageUid);
/**
* Returns the capabilities of this driver.
*
- * @return integer
+ * @return int
* @see Storage::CAPABILITY_* constants
*/
public function getCapabilities();
/**
- * Merges the capabilites merged by the user at the storage
+ * Merges the capabilities merged by the user at the storage
* configuration into the actual capabilities of the driver
* and returns the result.
*
- * @param integer $capabilities
- *
- * @return integer
+ * @param int $capabilities
+ * @return int
*/
public function mergeConfigurationCapabilities($capabilities);
/**
* Returns TRUE if this driver has the given capability.
*
- * @param integer $capability A capability, as defined in a CAPABILITY_* constant
- * @return boolean
+ * @param int $capability A capability, as defined in a CAPABILITY_* constant
+ * @return bool
*/
public function hasCapability($capability);
* therefore always reflect the file system and not try to change its
* behaviour
*
- * @return boolean
+ * @return bool
*/
public function isCaseSensitiveFileSystem();
* Returns the identifier of the folder the file resides in
*
* @param string $fileIdentifier
- *
* @return string
*/
public function getParentFolderIdentifierOfIdentifier($fileIdentifier);
* Returns the public URL to a file.
* Either fully qualified URL or relative to PATH_site (rawurlencoded).
*
- *
* @param string $identifier
* @return string
*/
*
* @param string $folderIdentifier
* @param bool $deleteRecursively
- * @return boolean
+ * @return bool
*/
public function deleteFolder($folderIdentifier, $deleteRecursively = FALSE);
* Checks if a file exists.
*
* @param string $fileIdentifier
- *
- * @return boolean
+ * @return bool
*/
public function fileExists($fileIdentifier);
* Checks if a folder exists.
*
* @param string $folderIdentifier
- *
- * @return boolean
+ * @return bool
*/
public function folderExists($folderIdentifier);
* Checks if a folder contains files and (if supported) other folders.
*
* @param string $folderIdentifier
- * @return boolean TRUE if there are no files and folders within $folder
+ * @return bool TRUE if there are no files and folders within $folder
*/
public function isFolderEmpty($folderIdentifier);
*
* @param string $fileIdentifier
* @param string $localFilePath
- * @return boolean TRUE if the operation succeeded
+ * @return bool TRUE if the operation succeeded
*/
public function replaceFile($fileIdentifier, $localFilePath);
* this has to be taken care of in the upper layers (e.g. the Storage)!
*
* @param string $fileIdentifier
- * @return boolean TRUE if deleting the file succeeded
+ * @return bool TRUE if deleting the file succeeded
*/
public function deleteFile($fileIdentifier);
* @param string $fileIdentifier
* @param string $targetFolderIdentifier
* @param string $newFileName
- *
* @return string
*/
public function moveFileWithinStorage($fileIdentifier, $targetFolderIdentifier, $newFileName);
* @param string $sourceFolderIdentifier
* @param string $targetFolderIdentifier
* @param string $newFolderName
- *
* @return array All files which are affected, map of old => new file identifiers
*/
public function moveFolderWithinStorage($sourceFolderIdentifier, $targetFolderIdentifier, $newFolderName);
* @param string $sourceFolderIdentifier
* @param string $targetFolderIdentifier
* @param string $newFolderName
- *
- * @return boolean
+ * @return bool
*/
public function copyFolderWithinStorage($sourceFolderIdentifier, $targetFolderIdentifier, $newFolderName);
*
* @param string $fileIdentifier
* @param string $contents
- * @return integer The number of bytes written to the file
+ * @return int The number of bytes written to the file
*/
public function setFileContents($fileIdentifier, $contents);
*
* @param string $fileName
* @param string $folderIdentifier
- * @return boolean
+ * @return bool
*/
public function fileExistsInFolder($fileName, $folderIdentifier);
*
* @param string $folderName
* @param string $folderIdentifier
- * @return boolean
+ * @return bool
*/
public function folderExistsInFolder($folderName, $folderIdentifier);
*
* @param string $folderIdentifier
* @param string $identifier identifier to be checked against $folderIdentifier
- * @return boolean TRUE if $content is within or matches $folderIdentifier
+ * @return bool TRUE if $content is within or matches $folderIdentifier
*/
public function isWithin($folderIdentifier, $identifier);
*/
public function getFolderInfoByIdentifier($folderIdentifier);
+ /**
+ * Returns the identifier of a file inside the folder
+ *
+ * @param string $fileName
+ * @param string $folderIdentifier
+ * @return string file identifier
+ */
+ public function getFileInFolder($fileName, $folderIdentifier);
+
/**
* Returns a list of files inside the specified path
*
* @param string $folderIdentifier
- * @param integer $start
- * @param integer $numberOfItems
+ * @param int $start
+ * @param int $numberOfItems
* @param bool $recursive
* @param array $filenameFilterCallbacks callbacks for filtering the items
- *
+ * @param string $sort Property name used to sort the items.
+ * Among them may be: '' (empty, no sorting), name,
+ * fileext, size, tstamp and rw.
+ * If a driver does not support the given property, it
+ * should fall back to "name".
+ * @param bool $sortRev TRUE to indicate reverse sorting (last to first)
* @return array of FileIdentifiers
*/
- public function getFilesInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = FALSE, array $filenameFilterCallbacks = array());
+ public function getFilesInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = FALSE, array $filenameFilterCallbacks = array(), $sort = '', $sortRev = FALSE);
+
+ /**
+ * Returns the identifier of a folder inside the folder
+ *
+ * @param string $folderName The name of the target folder
+ * @param string $folderIdentifier
+ * @return string folder identifier
+ */
+ public function getFolderInFolder($folderName, $folderIdentifier);
/**
* Returns a list of folders inside the specified path
*
* @param string $folderIdentifier
- * @param integer $start
- * @param integer $numberOfItems
+ * @param int $start
+ * @param int $numberOfItems
* @param bool $recursive
* @param array $folderNameFilterCallbacks callbacks for filtering the items
- *
+ * @param string $sort Property name used to sort the items.
+ * Among them may be: '' (empty, no sorting), name,
+ * fileext, size, tstamp and rw.
+ * If a driver does not support the given property, it
+ * should fall back to "name".
+ * @param bool $sortRev TRUE to indicate reverse sorting (last to first)
* @return array of Folder Identifier
*/
- public function getFoldersInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = FALSE, array $folderNameFilterCallbacks = array());
+ public function getFoldersInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = FALSE, array $folderNameFilterCallbacks = array(), $sort = '', $sortRev = FALSE);
+
+ /**
+ * Returns the number of files inside the specified path
+ *
+ * @param string $folderIdentifier
+ * @param bool $recursive
+ * @param array $filenameFilterCallbacks callbacks for filtering the items
+ * @return integer Number of files in folder
+ */
+ public function countFilesInFolder($folderIdentifier, $recursive = FALSE, array $filenameFilterCallbacks = array());
+
+ /**
+ * Returns the number of folders inside the specified path
+ *
+ * @param string $folderIdentifier
+ * @param bool $recursive
+ * @param array $folderNameFilterCallbacks callbacks for filtering the items
+ * @return integer Number of folders in folder
+ */
+ public function countFoldersInFolder($folderIdentifier, $recursive = FALSE, array $folderNameFilterCallbacks = array());
}