Merge pull request #8922 from nextcloud/deprecated-ocp-files-methods
Deprecated some methods of OCP\Files
This commit is contained in:
commit
dc4ba31e7e
|
@ -46,6 +46,7 @@ class DeprecationCheck extends AbstractCheck {
|
||||||
'OCP\User' => '13.0.0',
|
'OCP\User' => '13.0.0',
|
||||||
'OCP\BackgroundJob' => '14.0.0',
|
'OCP\BackgroundJob' => '14.0.0',
|
||||||
'OCP\App' => '14.0.0',
|
'OCP\App' => '14.0.0',
|
||||||
|
'OCP\Files' => '14.0.0',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +175,13 @@ class DeprecationCheck extends AbstractCheck {
|
||||||
'OCP\Util::mb_substr_replace' => '8.2.0',
|
'OCP\Util::mb_substr_replace' => '8.2.0',
|
||||||
'OCP\Util::sendMail' => '8.1.0',
|
'OCP\Util::sendMail' => '8.1.0',
|
||||||
'OCP\Util::writeLog' => '13.0.0',
|
'OCP\Util::writeLog' => '13.0.0',
|
||||||
|
|
||||||
|
'OCP\Files::rmdirr' => '14.0.0',
|
||||||
|
'OCP\Files::getMimeType' => '14.0.0',
|
||||||
|
'OCP\Files::searchByMime' => '14.0.0',
|
||||||
|
'OCP\Files::streamCopy' => '14.0.0',
|
||||||
|
'OCP\Files::buildNotExistingFileName' => '14.0.0',
|
||||||
|
'OCP\Files::getStorage' => '14.0.0',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,12 +44,14 @@ namespace OCP;
|
||||||
* This class provides access to the internal filesystem abstraction layer. Use
|
* This class provides access to the internal filesystem abstraction layer. Use
|
||||||
* this class exlusively if you want to access files
|
* this class exlusively if you want to access files
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0
|
||||||
*/
|
*/
|
||||||
class Files {
|
class Files {
|
||||||
/**
|
/**
|
||||||
* Recusive deletion of folders
|
* Recusive deletion of folders
|
||||||
* @return bool
|
* @return bool
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0
|
||||||
*/
|
*/
|
||||||
static public function rmdirr( $dir ) {
|
static public function rmdirr( $dir ) {
|
||||||
return \OC_Helper::rmdirr( $dir );
|
return \OC_Helper::rmdirr( $dir );
|
||||||
|
@ -61,6 +63,7 @@ class Files {
|
||||||
* @return string
|
* @return string
|
||||||
* does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
|
* does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0
|
||||||
*/
|
*/
|
||||||
static public function getMimeType( $path ) {
|
static public function getMimeType( $path ) {
|
||||||
return \OC::$server->getMimeTypeDetector()->detect($path);
|
return \OC::$server->getMimeTypeDetector()->detect($path);
|
||||||
|
@ -71,6 +74,7 @@ class Files {
|
||||||
* @param string $mimetype
|
* @param string $mimetype
|
||||||
* @return array
|
* @return array
|
||||||
* @since 6.0.0
|
* @since 6.0.0
|
||||||
|
* @deprecated 14.0.0
|
||||||
*/
|
*/
|
||||||
static public function searchByMime($mimetype) {
|
static public function searchByMime($mimetype) {
|
||||||
return \OC\Files\Filesystem::searchByMime($mimetype);
|
return \OC\Files\Filesystem::searchByMime($mimetype);
|
||||||
|
@ -82,6 +86,7 @@ class Files {
|
||||||
* @param resource $target
|
* @param resource $target
|
||||||
* @return int the number of bytes copied
|
* @return int the number of bytes copied
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0
|
||||||
*/
|
*/
|
||||||
public static function streamCopy( $source, $target ) {
|
public static function streamCopy( $source, $target ) {
|
||||||
list($count, ) = \OC_Helper::streamCopy( $source, $target );
|
list($count, ) = \OC_Helper::streamCopy( $source, $target );
|
||||||
|
@ -94,6 +99,7 @@ class Files {
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @return string
|
* @return string
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0 use getNonExistingName of the OCP\Files\Folder object
|
||||||
*/
|
*/
|
||||||
public static function buildNotExistingFileName($path, $filename) {
|
public static function buildNotExistingFileName($path, $filename) {
|
||||||
return \OC_Helper::buildNotExistingFileName($path, $filename);
|
return \OC_Helper::buildNotExistingFileName($path, $filename);
|
||||||
|
@ -105,6 +111,7 @@ class Files {
|
||||||
* @param string $app
|
* @param string $app
|
||||||
* @return \OC\Files\View
|
* @return \OC\Files\View
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @deprecated 14.0.0 use IAppData instead
|
||||||
*/
|
*/
|
||||||
public static function getStorage($app) {
|
public static function getStorage($app) {
|
||||||
return \OC_App::getStorage( $app );
|
return \OC_App::getStorage( $app );
|
||||||
|
|
Loading…
Reference in New Issue