File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
app/code/Magento/ImportExport/Model Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,21 @@ class Csv extends \Magento\ImportExport\Model\Export\Adapter\AbstractAdapter
33
33
*/
34
34
protected $ _fileHandler ;
35
35
36
+ /**
37
+ * {@inheritdoc }
38
+ */
39
+ public function __construct (\Magento \Framework \Filesystem $ filesystem , $ destination = null )
40
+ {
41
+ register_shutdown_function ([$ this , 'destruct ' ]);
42
+ parent ::__construct ($ filesystem , $ destination );
43
+ }
44
+
36
45
/**
37
46
* Object destructor.
47
+ *
48
+ * @return void
38
49
*/
39
- public function __destruct ()
50
+ public function destruct ()
40
51
{
41
52
if (is_object ($ this ->_fileHandler )) {
42
53
$ this ->_fileHandler ->close ();
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ public function __construct(
44
44
$ delimiter = ', ' ,
45
45
$ enclosure = '" '
46
46
) {
47
+ register_shutdown_function ([$ this , 'destruct ' ]);
47
48
try {
48
49
$ this ->_file = $ directory ->openFile ($ directory ->getRelativePath ($ file ), 'r ' );
49
50
} catch (\Magento \Framework \Exception \FileSystemException $ e ) {
@@ -58,8 +59,10 @@ public function __construct(
58
59
59
60
/**
60
61
* Close file handle
62
+ *
63
+ * @return void
61
64
*/
62
- public function __destruct ()
65
+ public function destruct ()
63
66
{
64
67
if (is_object ($ this ->_file )) {
65
68
$ this ->_file ->close ();
You can’t perform that action at this time.
0 commit comments