403Webshell
Server IP : 54.94.228.101  /  Your IP : 172.28.20.13
Web Server : Apache
System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/vinumday2_0/vendor/maatwebsite/excel/src/Maatwebsite/Excel/Classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/vinumday2_0/vendor/maatwebsite/excel/src/Maatwebsite/Excel/Classes/Cache.php
<?php namespace Maatwebsite\Excel\Classes;

use PHPExcel_Settings;
use PHPExcel_CachedObjectStorageFactory;

class Cache {

    /**
     * PHPExcel cache class
     * @var string
     */
    protected $class = 'PHPExcel_CachedObjectStorageFactory';

    /**
     * Available caching drivers
     * @var array
     */
    protected $available = [
        'memory'     => 'cache_in_memory',
        'gzip'       => 'cache_in_memory_gzip',
        'serialized' => 'cache_in_memory_serialized',
        'igbinary'   => 'cache_igbinary',
        'discISAM'   => 'cache_to_discISAM',
        'apc'        => 'cache_to_apc',
        'memcache'   => 'cache_to_memcache',
        'temp'       => 'cache_to_phpTemp',
        'wincache'   => 'cache_to_wincache',
        'sqlite'     => 'cache_to_sqlite',
        'sqlite3'    => 'cache_to_sqlite3'
    ];

    /**
     * The name of the config file
     * @var string
     */
    private $configName = 'excel.cache';

    /**
     * Cache constructor
     */
    public function __construct()
    {
        // Get driver and settings from the config
        $this->driver = config($this->configName . '.driver', 'memory');
        $this->settings = config($this->configName . '.settings', []);

        // Init if caching is enabled
        if ($this->isEnabled())
            $this->init();
    }

    /**
     * Init the cache
     * @return void
     */
    public function init()
    {
        // Find the cache driver
        $this->findDriver();

        // Set the storage driver
        PHPExcel_Settings::setCacheStorageMethod($this->method, $this->settings);
    }

    /**
     * Set the right driver
     * @return void
     */
    public function findDriver()
    {
        $property = $this->detect();
        $this->method = constant($this->class . '::' . $property);
    }

    /**
     * Detect the caching driver
     * @return string $driver
     */
    protected function detect()
    {
        // Add additional settings
        $this->addAdditionalSettings();

        // return the driver
        return isset($this->available[$this->driver]) ? $this->available[$this->driver] : reset($this->available);
    }

    /**
     * Add additional settings for the current driver
     * @return  void
     */
    protected function addAdditionalSettings()
    {
        switch ($this->driver)
        {
            case 'memcache':

                // Add extra memcache settings
                $this->settings = array_merge($this->settings, [
                    'memcacheServer' => config($this->configName . '.memcache.host', 'localhost'),
                    'memcachePort'   => config($this->configName . '.memcache.port', 11211)
                ]);

                break;

            case 'discISAM':

                // Add dir
                $this->settings = array_merge($this->settings, [
                    'dir' => config($this->configName . '.dir', storage_path('cache')),
                ]);

                break;
        }
    }

    /**
     * Check if caching is enabled
     * @return boolean
     */
    public function isEnabled()
    {
        return config($this->configName . '.enable', true) ? true : false;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit