HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/survey.wb-webdesign.com/public_html/vendor/kcfinder/core/class/minifier.php
<?php

/** This file is part of KCFinder project
  *
  *      @desc Minify JS & CSS
  *   @package KCFinder
  *   @version 3.12
  *    @author Pavel Tzonkov <[email protected]>
  * @copyright 2010-2014 KCFinder Project
  *   @license http://opensource.org/licenses/GPL-3.0 GPLv3
  *   @license http://opensource.org/licenses/LGPL-3.0 LGPLv3
  *      @link http://kcfinder.sunhater.com
  */

namespace kcfinder;

class minifier {

    protected $config;
    protected $type = "js";
    protected $minCmd = "";
    protected $mime = array(
        'js' => "text/javascript",
        'css' => "text/css"
    );

    public function __construct($type=null) {
        require "conf/config.php";
        $this->config = $_CONFIG;
        $type = strtolower($type);
        if (isset($this->mime[$type]))
            $this->type = $type;
        if (isset($_CONFIG["_{$this->type}MinCmd"]))
            $this->minCmd = $_CONFIG["_{$this->type}MinCmd"];
    }

    public function minify($cacheFile=null, $dir=null) {
        if ($dir === null)
            $dir = dirname((string) $_SERVER['SCRIPT_FILENAME']);

        // MODIFICATION TIME FILES
        $mtFiles = array(
            __FILE__,
            $_SERVER['SCRIPT_FILENAME'],
            "conf/config.php"
        );

        // GET SOURCE CODE FILES
        $files = dir::content($dir, array(
            'types' => "file",
            'pattern' => '/^.*\.' . $this->type . '$/'
        ));

        // GET NEWEST MODIFICATION TIME
        $mtime = 0;
        foreach (array_merge($mtFiles, $files) as $file) {
            $fmtime = filemtime($file);
            if ($fmtime > $mtime)
                $mtime = $fmtime;
        }

        $header = "Content-Type: {$this->mime[$this->type]}";

        // GET SOURCE CODE FROM CLIENT HTTP CACHE IF EXISTS
        httpCache::checkMTime($mtime, $header);

        // OUTPUT SOURCE CODE
        header($header);

        // GET SOURCE CODE FROM SERVER-SIDE CACHE
        /* if (($cacheFile !== null) &&
            file_exists($cacheFile) &&
            (
                (filemtime($cacheFile) >= $mtime) ||
                !is_writable($cacheFile)                // if cache file cannot be modified
            )                                           // the script will output it always
        ) {                                             // with its distribution content
            readfile($cacheFile);
            die;
        }
        */
        // MINIFY AND JOIN SOURCE CODE
        $source = "";
        foreach ($files as $file) {

            if (strlen((string) $this->minCmd) && (substr((string) $file, 4, 1) != "_")) {
                $cmd = str_replace("{file}", $file, (string) $this->minCmd);
                $source .= `$cmd`;

            } else
                $source .= file_get_contents($file);
        }

        /*
        // UPDATE SERVER-SIDE CACHE
        if (($cacheFile !== null) &&
            (
                is_writable($cacheFile) ||
                (
                    !file_exists($cacheFile) &&
                    dir::isWritable(dirname($cacheFile))
                )
            )
        ) {
            file_put_contents($cacheFile, $source);
            touch($cacheFile, $mtime);
        }
        */
        // OUTPUT SOURCE CODE
        echo $source;

    }
}

?>