Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Archive
AbstractArchive.php
Go to the documentation of this file.
1
<?php
12
namespace
Magento\Framework\Archive
;
13
14
class
AbstractArchive
15
{
24
protected
function
_writeFile
($destination,
$data
)
25
{
26
$destination = trim($destination);
27
if
(
false
===
file_put_contents
($destination,
$data
)) {
28
throw
new \Exception(
"Can't write to file: "
. $destination);
29
}
30
return
true
;
31
}
32
40
protected
function
_readFile
(
$source
)
41
{
42
$data
=
''
;
43
if
(
is_file
(
$source
) &&
is_readable
(
$source
)) {
44
$data
= @
file_get_contents
(
$source
);
45
if
(
$data
===
false
) {
46
throw
new \Magento\Framework\Exception\LocalizedException(
47
new
\
Magento
\Framework\
Phrase
(
"Can't get contents from: %1"
, [
$source
])
48
);
49
}
50
}
51
return
$data
;
52
}
53
61
public
function
getFilename
(
$source
, $withExtension =
false
)
62
{
63
$file = str_replace(dirname(
$source
) .
'/'
,
''
,
$source
);
64
if
(!$withExtension) {
65
$file = substr($file, 0, strrpos($file,
'.'
));
66
}
67
return
$file;
68
}
69
}
Magento\Framework\Backup\is_file
is_file($path)
Definition:
io.php:47
$source
$source
Definition:
source.php:23
Magento\Framework\Filesystem\Driver\file_put_contents
file_put_contents()
Definition:
http_mock.php:25
Magento\Framework\Archive\AbstractArchive
Definition:
AbstractArchive.php:14
Magento\Framework\Archive\AbstractArchive\_writeFile
_writeFile($destination, $data)
Definition:
AbstractArchive.php:24
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\Archive
Definition:
AbstractArchive.php:12
Magento\Framework\Archive\AbstractArchive\getFilename
getFilename($source, $withExtension=false)
Definition:
AbstractArchive.php:61
Magento
Magento\Framework\Filesystem\Driver\file_get_contents
file_get_contents()
Definition:
http_mock.php:15
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Archive\AbstractArchive\_readFile
_readFile($source)
Definition:
AbstractArchive.php:40
Magento\Framework\Backup\Filesystem\Rollback\is_readable
is_readable($path)
Definition:
ioMock.php:14