File tree Expand file tree Collapse file tree 7 files changed +58
-35
lines changed
MediaGallerySynchronization/Model
lib/internal/Magento/Framework Expand file tree Collapse file tree 7 files changed +58
-35
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Eav \Model \Attribute \Data ;
7
7
8
- use Magento \Framework \Filesystem \DriverInterface ;
8
+ use Magento \Framework \Filesystem \ExtendedDriverInterface ;
9
9
10
10
/**
11
11
* EAV Entity Attribute Image File Data Model
@@ -29,7 +29,7 @@ protected function _validateByRules($value)
29
29
{
30
30
$ label = __ ($ this ->getAttribute ()->getStoreLabel ());
31
31
$ rules = $ this ->getAttribute ()->getValidateRules ();
32
- $ localStorage = !$ this ->_directory ->getDriver () instanceof DriverInterface ;
32
+ $ localStorage = !$ this ->_directory ->getDriver () instanceof ExtendedDriverInterface ;
33
33
$ imageProp = $ localStorage
34
34
? @getimagesize ($ value ['tmp_name ' ])
35
35
: $ this ->_directory ->getDriver ()->getMetadata ($ value ['tmp_name ' ]);
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public function execute(string $path): AssetInterface
75
75
$ absolutePath = $ this ->getMediaDirectory ()->getAbsolutePath ($ path );
76
76
$ driver = $ this ->getMediaDirectory ()->getDriver ();
77
77
78
- if ($ driver instanceof Filesystem \DriverInterface ) {
78
+ if ($ driver instanceof Filesystem \ExtendedDriverInterface ) {
79
79
$ meta = $ driver ->getMetadata ($ absolutePath );
80
80
} else {
81
81
/**
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \RemoteStorage \Driver ;
9
9
10
- use Magento \Framework \Filesystem \DriverInterface ;
10
+ use Magento \Framework \Filesystem \ExtendedDriverInterface ;
11
11
12
12
/**
13
13
* Remote storage driver.
14
14
*/
15
- interface RemoteDriverInterface extends DriverInterface
15
+ interface RemoteDriverInterface extends ExtendedDriverInterface
16
16
{
17
17
/**
18
18
* Test storage connection.
Original file line number Diff line number Diff line change 15
15
* Utility for mime type retrieval
16
16
*
17
17
* @deprecated
18
- * @see Filesystem\DriverInterface ::getMetadata()
18
+ * @see Filesystem\ExtendedDriverInterface ::getMetadata()
19
19
*/
20
20
class Mime
21
21
{
@@ -113,7 +113,7 @@ public function getMimeType($file)
113
113
throw new FileSystemException (__ ("File ' $ file' doesn't exist " ));
114
114
}
115
115
116
- if ($ driver instanceof Filesystem \DriverInterface ) {
116
+ if ($ driver instanceof Filesystem \ExtendedDriverInterface ) {
117
117
return $ driver ->getMetadata ($ file )['mimetype ' ];
118
118
}
119
119
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class MimeTest extends TestCase
56
56
protected function setUp (): void
57
57
{
58
58
$ this ->localDriverMock = $ this ->getMockForAbstractClass (Filesystem \DriverInterface::class);
59
- $ this ->remoteDriverMock = $ this ->getMockForAbstractClass (Filesystem \DriverInterface ::class);
59
+ $ this ->remoteDriverMock = $ this ->getMockForAbstractClass (Filesystem \ExtendedDriverInterface ::class);
60
60
61
61
$ this ->localDirectoryMock = $ this ->getMockForAbstractClass (Filesystem \Directory \WriteInterface::class);
62
62
$ this ->localDirectoryMock ->method ('getDriver ' )
Original file line number Diff line number Diff line change @@ -393,31 +393,4 @@ public function getRealPathSafety($path);
393
393
* @return mixed
394
394
*/
395
395
public function getRelativePath ($ basePath , $ path = null );
396
-
397
- /**
398
- * Retrieve file metadata.
399
- *
400
- * Implementation must return associative array with next keys:
401
- *
402
- * ```
403
- * [
404
- * 'path',
405
- * 'dirname',
406
- * 'basename',
407
- * 'extension',
408
- * 'filename',
409
- * 'timestamp',
410
- * 'size',
411
- * 'mimetype',
412
- * 'extra' => [
413
- * 'image-width',
414
- * 'image-height'
415
- * ]
416
- * ];
417
- *
418
- * @param string $path Absolute path to file
419
- * @return array
420
- * @throws FileSystemException
421
- */
422
- public function getMetadata (string $ path ): array ;
423
396
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Framework \Filesystem ;
9
+
10
+ use Magento \Framework \Exception \FileSystemException ;
11
+
12
+ /**
13
+ * Provides extension for Driver interface.
14
+ *
15
+ * @see DriverInterface
16
+ *
17
+ * @deprecated Method will be moved to DriverInterface
18
+ * @see DriverInterface
19
+ */
20
+ interface ExtendedDriverInterface extends DriverInterface
21
+ {
22
+ /**
23
+ * Retrieve file metadata.
24
+ *
25
+ * Implementation must return associative array with next keys:
26
+ *
27
+ * ```
28
+ * [
29
+ * 'path',
30
+ * 'dirname',
31
+ * 'basename',
32
+ * 'extension',
33
+ * 'filename',
34
+ * 'timestamp',
35
+ * 'size',
36
+ * 'mimetype',
37
+ * 'extra' => [
38
+ * 'image-width',
39
+ * 'image-height'
40
+ * ]
41
+ * ];
42
+ *
43
+ * @param string $path Absolute path to file
44
+ * @return array
45
+ * @throws FileSystemException
46
+ *
47
+ * @deprecated Method will be moved to DriverInterface
48
+ */
49
+ public function getMetadata (string $ path ): array ;
50
+ }
You can’t perform that action at this time.
0 commit comments