Captcha cron actions
Definition at line 13 of file DeleteExpiredImages.php.
◆ __construct()
- Parameters
-
\Magento\Captcha\Helper\Data | $helper | |
\Magento\Captcha\Helper\Adminhtml\Data | $adminHelper | |
\Magento\Framework\Filesystem | $filesystem | |
\Magento\Store\Model\StoreManager | $storeManager | |
Definition at line 43 of file DeleteExpiredImages.php.
50 $this->_adminHelper = $adminHelper;
◆ _deleteExpiredImagesForWebsite()
Delete Expired Captcha Images for specific website
- Parameters
-
\Magento\Captcha\Helper\Data | $helper | |
\Magento\Store\Model\Website | null | $website | |
\Magento\Store\Model\Store | null | $store | |
- Returns
- void
Definition at line 78 of file DeleteExpiredImages.php.
84 $imageDirectory = $this->_mediaDirectory->getRelativePath(
$helper->getImgDir(
$website));
85 foreach ($this->_mediaDirectory->read($imageDirectory) as $filePath) {
86 if ($this->_mediaDirectory->isFile($filePath)
87 && pathinfo($filePath, PATHINFO_EXTENSION) ==
'png' 88 && $this->_mediaDirectory->stat($filePath)[
'mtime'] < $expire
90 $this->_mediaDirectory->delete($filePath);
◆ execute()
Delete Expired Captcha Images
- Returns
- \Magento\Captcha\Cron\DeleteExpiredImages
Definition at line 60 of file DeleteExpiredImages.php.
62 foreach ($this->_storeManager->getWebsites() as
$website) {
_deleteExpiredImagesForWebsite(\Magento\Captcha\Helper\Data $helper, \Magento\Store\Model\Website $website=null, \Magento\Store\Model\Store $store=null)
◆ $_adminHelper
◆ $_helper
◆ $_mediaDirectory
◆ $_storeManager
The documentation for this class was generated from the following file: