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
Backup
Media.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Backup
;
7
13
class
Media
extends
Snapshot
14
{
21
public
function
rollback
()
22
{
23
$this->
_prepareIgnoreList
();
24
return
parent::rollback();
25
}
26
33
public
function
create
()
34
{
35
$this->
_prepareIgnoreList
();
36
return
parent::create();
37
}
38
45
public
function
getType
()
46
{
47
return
'media'
;
48
}
49
55
protected
function
_prepareIgnoreList
()
56
{
57
$rootDir
= $this->
getRootDir
();
58
$map
= [
59
$rootDir
=> [
'var'
,
'pub'
],
60
$rootDir
.
'/pub'
=> [
'media'
],
61
$rootDir
.
'/var'
=> [$this->
getDbBackupFilename
()],
62
];
63
64
foreach
(
$map
as
$path
=> $whiteList) {
65
foreach
(
new
\DirectoryIterator(
$path
) as
$item
) {
66
$filename =
$item
->getFilename();
67
if
(!
$item
->isDot() && !in_array($filename, $whiteList)) {
68
$this->
addIgnorePaths
(str_replace(
'\\'
,
'/'
,
$item
->getPathname()));
69
}
70
}
71
}
72
73
return
$this;
74
}
75
}
$map
$map
Definition:
classmap_generator.php:167
Magento\Framework\Backup
Definition:
AbstractBackup.php:6
Magento\Framework\Backup\Snapshot\getDbBackupFilename
getDbBackupFilename()
Definition:
Snapshot.php:154
Magento\Framework\Backup\Media\rollback
rollback()
Definition:
Media.php:21
Magento\Framework\Backup\Media\_prepareIgnoreList
_prepareIgnoreList()
Definition:
Media.php:55
$item
$item
Definition:
partial_invoice.php:27
Magento\Framework\Backup\Media\create
create()
Definition:
Media.php:33
Magento\Framework\Backup\AbstractBackup\getRootDir
getRootDir()
Definition:
AbstractBackup.php:171
Magento\Framework\Backup\Media\getType
getType()
Definition:
Media.php:45
Magento\Framework\Backup\Snapshot
Definition:
Snapshot.php:18
Magento\Framework\Backup\Filesystem\addIgnorePaths
addIgnorePaths($paths)
Definition:
Filesystem.php:217
$rootDir
$rootDir
Definition:
website.php:12
Magento\Framework\Backup\Media
Definition:
Media.php:13
$path
$path
Definition:
import_with_filesystem_images.php:14