Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/fooman/pdfcore-m2/src/Model/Tcpdf/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/fooman/pdfcore-m2/src/Model/Tcpdf/Defaults.php
<?php
/**
 * @copyright Copyright (c) 2015 Fooman Limited (http://www.fooman.co.nz)
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Fooman\PdfCore\Model\Tcpdf;

use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\UrlInterface;

class Defaults
{
    protected $filesystem;
    protected $storeManager;

    public const FACTOR_PIXEL_PER_MM = 3;

    /**
     * @param \Magento\Framework\Filesystem              $filesystem
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     *
     * @throws \Magento\Framework\Exception\FileSystemException
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function __construct(
        \Magento\Framework\Filesystem $filesystem,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->filesystem = $filesystem;
        $this->storeManager = $storeManager;

        if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
            define('K_TCPDF_EXTERNAL_CONFIG', true);
        }

        if (!defined('K_PATH_MAIN')) {
            define('K_PATH_MAIN', $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA)->getAbsolutePath());
        }

        if (!defined('K_PATH_URL')) {
            define('K_PATH_URL', $this->storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_MEDIA));
        }

        if (!defined('PDF_HEADER_LOGO')) {
            define('PDF_HEADER_LOGO', '');
        }

        if (!defined('PDF_HEADER_LOGO_WIDTH')) {
            define('PDF_HEADER_LOGO_WIDTH', 30);
        }

        if (!defined('K_PATH_CACHE')) {
            $cacheDir = $this->filesystem->getDirectoryWrite(DirectoryList::CACHE);
            $cacheDir->create('pdfcache/');
            define('K_PATH_CACHE', $cacheDir->getAbsolutePath('pdfcache/'));
        }

        if (!defined('K_BLANK_IMAGE')) {
            define('K_BLANK_IMAGE', '_blank.png');
        }

        if (!defined('K_TCPDF_CALLS_IN_HTML')) {
            define('K_TCPDF_CALLS_IN_HTML', true);
        }

        if (!defined('K_TCPDF_THROW_EXCEPTION_ERROR')) {
            define('K_TCPDF_THROW_EXCEPTION_ERROR', true);
        }

        if (!defined('K_PATH_FONTS')) {
            define(
                'K_PATH_FONTS',
                $this->filesystem->getDirectoryWrite(DirectoryList::ROOT)->getAbsolutePath(
                    'vendor/fooman/tcpdf/fonts/'
                )
            );
        }
    }
}

Spamworldpro Mini