Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Media Class Reference
Inheritance diagram for Media:
AppInterface

Public Member Functions

 __construct (ConfigFactory $configFactory, SynchronizationFactory $syncFactory, Response $response, \Closure $isAllowed, $mediaDirectory, $configCacheFile, $relativeFileName, Filesystem $filesystem, PlaceholderFactory $placeholderFactory, State $state, ImageResize $imageResize)
 
 catchException (App\Bootstrap $bootstrap, \Exception $exception)
 
- Public Member Functions inherited from AppInterface
 launch ()
 
 catchException (App\Bootstrap $bootstrap, \Exception $exception)
 

Additional Inherited Members

- Data Fields inherited from AppInterface
const DISTRO_LOCALE_CODE = 'en_US'
 

Detailed Description

@SuppressWarnings(PHPMD.CouplingBetweenObjects)

Definition at line 26 of file Media.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ConfigFactory  $configFactory,
SynchronizationFactory  $syncFactory,
Response  $response,
\Closure  $isAllowed,
  $mediaDirectory,
  $configCacheFile,
  $relativeFileName,
Filesystem  $filesystem,
PlaceholderFactory  $placeholderFactory,
State  $state,
ImageResize  $imageResize 
)
Parameters
ConfigFactory$configFactory
SynchronizationFactory$syncFactory
Response$response
\Closure$isAllowed
string$mediaDirectory
string$configCacheFile
string$relativeFileName
Filesystem$filesystem
PlaceholderFactory$placeholderFactory
State$state
ImageResize$imageResize@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 105 of file Media.php.

117  {
118  $this->response = $response;
119  $this->isAllowed = $isAllowed;
120  $this->directory = $filesystem->getDirectoryWrite(DirectoryList::PUB);
122  if (!empty($mediaDirectory)) {
123  $this->mediaDirectoryPath = str_replace('\\', '/', realpath($mediaDirectory));
124  }
125  $this->configCacheFile = $configCacheFile;
126  $this->relativeFileName = $relativeFileName;
127  $this->configFactory = $configFactory;
128  $this->syncFactory = $syncFactory;
129  $this->placeholderFactory = $placeholderFactory;
130  $this->appState = $state;
131  $this->imageResize = $imageResize;
132  }
$response
Definition: 404.php:11
$isAllowed
Definition: get.php:20
$configFactory
Definition: config_data.php:43
$mediaDirectory
$configCacheFile
Definition: get.php:18
$filesystem

Member Function Documentation

◆ catchException()

catchException ( App\Bootstrap  $bootstrap,
\Exception  $exception 
)

{}

Definition at line 194 of file Media.php.

195  {
196  $this->response->setHttpResponseCode(404);
197  if ($bootstrap->isDeveloperMode()) {
198  $this->response->setHeader('Content-Type', 'text/plain');
199  $this->response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
200  }
201  $this->response->sendResponse();
202  return true;
203  }
if(defined('TESTS_MAGENTO_INSTALLATION') &&TESTS_MAGENTO_INSTALLATION==='enabled') $bootstrap
Definition: bootstrap.php:73

The documentation for this class was generated from the following file: