first commit
This commit is contained in:
25
wp-content/plugins/wp-optimize/vendor/autoload.php
vendored
Normal file
25
wp-content/plugins/wp-optimize/vendor/autoload.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInite4f181c817bb7f56c650b242f9d1d695::getLoader();
|
||||
120
wp-content/plugins/wp-optimize/vendor/bin/cssmin
vendored
Normal file
120
wp-content/plugins/wp-optimize/vendor/bin/cssmin
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../tubalmartin/cssmin/cssmin)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/tubalmartin/cssmin/cssmin');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
include __DIR__ . '/..'.'/tubalmartin/cssmin/cssmin';
|
||||
120
wp-content/plugins/wp-optimize/vendor/bin/minifycss
vendored
Normal file
120
wp-content/plugins/wp-optimize/vendor/bin/minifycss
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../matthiasmullie/minify/bin/minifycss)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss';
|
||||
120
wp-content/plugins/wp-optimize/vendor/bin/minifyjs
vendored
Normal file
120
wp-content/plugins/wp-optimize/vendor/bin/minifyjs
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../matthiasmullie/minify/bin/minifyjs)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs';
|
||||
120
wp-content/plugins/wp-optimize/vendor/bin/plessc
vendored
Normal file
120
wp-content/plugins/wp-optimize/vendor/bin/plessc
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../marcusschwarz/lesserphp/plessc)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/marcusschwarz/lesserphp/plessc');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
include __DIR__ . '/..'.'/marcusschwarz/lesserphp/plessc';
|
||||
585
wp-content/plugins/wp-optimize/vendor/composer/ClassLoader.php
vendored
Normal file
585
wp-content/plugins/wp-optimize/vendor/composer/ClassLoader.php
vendored
Normal file
@@ -0,0 +1,585 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var ?string */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var self[]
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param ?string $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
*
|
||||
* @return self[]
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
352
wp-content/plugins/wp-optimize/vendor/composer/InstalledVersions.php
vendored
Normal file
352
wp-content/plugins/wp-optimize/vendor/composer/InstalledVersions.php
vendored
Normal file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = require __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
21
wp-content/plugins/wp-optimize/vendor/composer/LICENSE
vendored
Normal file
21
wp-content/plugins/wp-optimize/vendor/composer/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
71
wp-content/plugins/wp-optimize/vendor/composer/autoload_classmap.php
vendored
Normal file
71
wp-content/plugins/wp-optimize/vendor/composer/autoload_classmap.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'HTTP_ConditionalGet' => $vendorDir . '/mrclay/minify/lib/HTTP/ConditionalGet.php',
|
||||
'HTTP_Encoder' => $vendorDir . '/mrclay/minify/lib/HTTP/Encoder.php',
|
||||
'Minify' => $vendorDir . '/mrclay/minify/lib/Minify.php',
|
||||
'Minify\\App' => $vendorDir . '/mrclay/minify/lib/Minify/App.php',
|
||||
'Minify\\Config' => $vendorDir . '/mrclay/minify/lib/Minify/Config.php',
|
||||
'Minify\\JS\\JShrink' => $vendorDir . '/mrclay/minify/lib/Minify/JS/JShrink.php',
|
||||
'Minify\\Logger\\LegacyHandler' => $vendorDir . '/mrclay/minify/lib/Minify/Logger/LegacyHandler.php',
|
||||
'Minify_Build' => $vendorDir . '/mrclay/minify/lib/Minify/Build.php',
|
||||
'Minify_CSS' => $vendorDir . '/mrclay/minify/lib/Minify/CSS.php',
|
||||
'Minify_CSS_Compressor' => $vendorDir . '/mrclay/minify/lib/Minify/CSS/Compressor.php',
|
||||
'Minify_CSS_UriRewriter' => $vendorDir . '/mrclay/minify/lib/Minify/CSS/UriRewriter.php',
|
||||
'Minify_CSSmin' => $vendorDir . '/mrclay/minify/lib/Minify/CSSmin.php',
|
||||
'Minify_CacheInterface' => $vendorDir . '/mrclay/minify/lib/Minify/CacheInterface.php',
|
||||
'Minify_Cache_APC' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/APC.php',
|
||||
'Minify_Cache_APCu' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/APCu.php',
|
||||
'Minify_Cache_File' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/File.php',
|
||||
'Minify_Cache_Memcache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/Memcache.php',
|
||||
'Minify_Cache_Null' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/Null.php',
|
||||
'Minify_Cache_WinCache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/WinCache.php',
|
||||
'Minify_Cache_XCache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/XCache.php',
|
||||
'Minify_Cache_ZendPlatform' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/ZendPlatform.php',
|
||||
'Minify_ClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
|
||||
'Minify_ClosureCompiler_Exception' => $vendorDir . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
|
||||
'Minify_CommentPreserver' => $vendorDir . '/mrclay/minify/lib/Minify/CommentPreserver.php',
|
||||
'Minify_ControllerInterface' => $vendorDir . '/mrclay/minify/lib/Minify/ControllerInterface.php',
|
||||
'Minify_Controller_Base' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Base.php',
|
||||
'Minify_Controller_Files' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Files.php',
|
||||
'Minify_Controller_Groups' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Groups.php',
|
||||
'Minify_Controller_MinApp' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/MinApp.php',
|
||||
'Minify_Controller_Page' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Page.php',
|
||||
'Minify_DebugDetector' => $vendorDir . '/mrclay/minify/lib/Minify/DebugDetector.php',
|
||||
'Minify_Env' => $vendorDir . '/mrclay/minify/lib/Minify/Env.php',
|
||||
'Minify_HTML' => $vendorDir . '/mrclay/minify/lib/Minify/HTML.php',
|
||||
'Minify_HTML_Helper' => $vendorDir . '/mrclay/minify/lib/Minify/HTML/Helper.php',
|
||||
'Minify_ImportProcessor' => $vendorDir . '/mrclay/minify/lib/Minify/ImportProcessor.php',
|
||||
'Minify_JS_ClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
|
||||
'Minify_JS_ClosureCompiler_Exception' => $vendorDir . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
|
||||
'Minify_LessCssSource' => $vendorDir . '/mrclay/minify/lib/Minify/LessCssSource.php',
|
||||
'Minify_Lines' => $vendorDir . '/mrclay/minify/lib/Minify/Lines.php',
|
||||
'Minify_NailgunClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/NailgunClosureCompiler.php',
|
||||
'Minify_Packer' => $vendorDir . '/mrclay/minify/lib/Minify/Packer.php',
|
||||
'Minify_ScssCssSource' => $vendorDir . '/mrclay/minify/lib/Minify/ScssCssSource.php',
|
||||
'Minify_ServeConfiguration' => $vendorDir . '/mrclay/minify/lib/Minify/ServeConfiguration.php',
|
||||
'Minify_Source' => $vendorDir . '/mrclay/minify/lib/Minify/Source.php',
|
||||
'Minify_SourceInterface' => $vendorDir . '/mrclay/minify/lib/Minify/SourceInterface.php',
|
||||
'Minify_SourceSet' => $vendorDir . '/mrclay/minify/lib/Minify/SourceSet.php',
|
||||
'Minify_Source_Factory' => $vendorDir . '/mrclay/minify/lib/Minify/Source/Factory.php',
|
||||
'Minify_Source_FactoryException' => $vendorDir . '/mrclay/minify/lib/Minify/Source/FactoryException.php',
|
||||
'Minify_YUICompressor' => $vendorDir . '/mrclay/minify/lib/Minify/YUICompressor.php',
|
||||
'MrClay\\Cli' => $vendorDir . '/mrclay/minify/lib/MrClay/Cli.php',
|
||||
'MrClay\\Cli\\Arg' => $vendorDir . '/mrclay/minify/lib/MrClay/Cli/Arg.php',
|
||||
'lessc' => $vendorDir . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_classic' => $vendorDir . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_compressed' => $vendorDir . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_lessjs' => $vendorDir . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_parser' => $vendorDir . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'simplehtmldom\\Debug' => $vendorDir . '/simplehtmldom/simplehtmldom/Debug.php',
|
||||
'simplehtmldom\\HtmlDocument' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlDocument.php',
|
||||
'simplehtmldom\\HtmlElement' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlElement.php',
|
||||
'simplehtmldom\\HtmlNode' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlNode.php',
|
||||
'simplehtmldom\\HtmlWeb' => $vendorDir . '/simplehtmldom/simplehtmldom/HtmlWeb.php',
|
||||
);
|
||||
12
wp-content/plugins/wp-optimize/vendor/composer/autoload_namespaces.php
vendored
Normal file
12
wp-content/plugins/wp-optimize/vendor/composer/autoload_namespaces.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Props\\' => array($vendorDir . '/mrclay/props-dic/src'),
|
||||
'Pimple' => array($vendorDir . '/pimple/pimple/src'),
|
||||
'JSMin\\' => array($vendorDir . '/mrclay/jsmin-php/src'),
|
||||
);
|
||||
23
wp-content/plugins/wp-optimize/vendor/composer/autoload_psr4.php
vendored
Normal file
23
wp-content/plugins/wp-optimize/vendor/composer/autoload_psr4.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'tubalmartin\\CssMin\\' => array($vendorDir . '/tubalmartin/cssmin/src'),
|
||||
'WebPConvert\\' => array($vendorDir . '/rosell-dk/webp-convert/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
|
||||
'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),
|
||||
'LocateBinaries\\' => array($vendorDir . '/rosell-dk/locate-binaries/src'),
|
||||
'Intervention\\HttpAuth\\' => array($vendorDir . '/intervention/httpauth/src'),
|
||||
'ImageMimeTypeSniffer\\' => array($vendorDir . '/rosell-dk/image-mime-type-sniffer/src'),
|
||||
'ImageMimeTypeGuesser\\' => array($vendorDir . '/rosell-dk/image-mime-type-guesser/src'),
|
||||
'HtaccessCapabilityTester\\' => array($vendorDir . '/rosell-dk/htaccess-capability-tester/src'),
|
||||
'FileUtil\\' => array($vendorDir . '/rosell-dk/file-util/src'),
|
||||
'ExecWithFallback\\' => array($vendorDir . '/rosell-dk/exec-with-fallback/src'),
|
||||
);
|
||||
36
wp-content/plugins/wp-optimize/vendor/composer/autoload_real.php
vendored
Normal file
36
wp-content/plugins/wp-optimize/vendor/composer/autoload_real.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInite4f181c817bb7f56c650b242f9d1d695
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInite4f181c817bb7f56c650b242f9d1d695', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite4f181c817bb7f56c650b242f9d1d695', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite4f181c817bb7f56c650b242f9d1d695::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
208
wp-content/plugins/wp-optimize/vendor/composer/autoload_static.php
vendored
Normal file
208
wp-content/plugins/wp-optimize/vendor/composer/autoload_static.php
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInite4f181c817bb7f56c650b242f9d1d695
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
't' =>
|
||||
array (
|
||||
'tubalmartin\\CssMin\\' => 19,
|
||||
),
|
||||
'W' =>
|
||||
array (
|
||||
'WebPConvert\\' => 12,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Container\\' => 14,
|
||||
),
|
||||
'M' =>
|
||||
array (
|
||||
'Monolog\\' => 8,
|
||||
'MatthiasMullie\\PathConverter\\' => 29,
|
||||
'MatthiasMullie\\Minify\\' => 22,
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
'LocateBinaries\\' => 15,
|
||||
),
|
||||
'I' =>
|
||||
array (
|
||||
'Intervention\\HttpAuth\\' => 22,
|
||||
'ImageMimeTypeSniffer\\' => 21,
|
||||
'ImageMimeTypeGuesser\\' => 21,
|
||||
),
|
||||
'H' =>
|
||||
array (
|
||||
'HtaccessCapabilityTester\\' => 25,
|
||||
),
|
||||
'F' =>
|
||||
array (
|
||||
'FileUtil\\' => 9,
|
||||
),
|
||||
'E' =>
|
||||
array (
|
||||
'ExecWithFallback\\' => 17,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'tubalmartin\\CssMin\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/tubalmartin/cssmin/src',
|
||||
),
|
||||
'WebPConvert\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/webp-convert/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'Monolog\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
|
||||
),
|
||||
'MatthiasMullie\\PathConverter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src',
|
||||
),
|
||||
'MatthiasMullie\\Minify\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/matthiasmullie/minify/src',
|
||||
),
|
||||
'LocateBinaries\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/locate-binaries/src',
|
||||
),
|
||||
'Intervention\\HttpAuth\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/intervention/httpauth/src',
|
||||
),
|
||||
'ImageMimeTypeSniffer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/image-mime-type-sniffer/src',
|
||||
),
|
||||
'ImageMimeTypeGuesser\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/image-mime-type-guesser/src',
|
||||
),
|
||||
'HtaccessCapabilityTester\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/htaccess-capability-tester/src',
|
||||
),
|
||||
'FileUtil\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/file-util/src',
|
||||
),
|
||||
'ExecWithFallback\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rosell-dk/exec-with-fallback/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'P' =>
|
||||
array (
|
||||
'Props\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/mrclay/props-dic/src',
|
||||
),
|
||||
'Pimple' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/pimple/pimple/src',
|
||||
),
|
||||
),
|
||||
'J' =>
|
||||
array (
|
||||
'JSMin\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/mrclay/jsmin-php/src',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'HTTP_ConditionalGet' => __DIR__ . '/..' . '/mrclay/minify/lib/HTTP/ConditionalGet.php',
|
||||
'HTTP_Encoder' => __DIR__ . '/..' . '/mrclay/minify/lib/HTTP/Encoder.php',
|
||||
'Minify' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify.php',
|
||||
'Minify\\App' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/App.php',
|
||||
'Minify\\Config' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Config.php',
|
||||
'Minify\\JS\\JShrink' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/JShrink.php',
|
||||
'Minify\\Logger\\LegacyHandler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Logger/LegacyHandler.php',
|
||||
'Minify_Build' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Build.php',
|
||||
'Minify_CSS' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS.php',
|
||||
'Minify_CSS_Compressor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS/Compressor.php',
|
||||
'Minify_CSS_UriRewriter' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS/UriRewriter.php',
|
||||
'Minify_CSSmin' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSSmin.php',
|
||||
'Minify_CacheInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CacheInterface.php',
|
||||
'Minify_Cache_APC' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/APC.php',
|
||||
'Minify_Cache_APCu' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/APCu.php',
|
||||
'Minify_Cache_File' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/File.php',
|
||||
'Minify_Cache_Memcache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/Memcache.php',
|
||||
'Minify_Cache_Null' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/Null.php',
|
||||
'Minify_Cache_WinCache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/WinCache.php',
|
||||
'Minify_Cache_XCache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/XCache.php',
|
||||
'Minify_Cache_ZendPlatform' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/ZendPlatform.php',
|
||||
'Minify_ClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
|
||||
'Minify_ClosureCompiler_Exception' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
|
||||
'Minify_CommentPreserver' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CommentPreserver.php',
|
||||
'Minify_ControllerInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ControllerInterface.php',
|
||||
'Minify_Controller_Base' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Base.php',
|
||||
'Minify_Controller_Files' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Files.php',
|
||||
'Minify_Controller_Groups' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Groups.php',
|
||||
'Minify_Controller_MinApp' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/MinApp.php',
|
||||
'Minify_Controller_Page' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Page.php',
|
||||
'Minify_DebugDetector' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/DebugDetector.php',
|
||||
'Minify_Env' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Env.php',
|
||||
'Minify_HTML' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/HTML.php',
|
||||
'Minify_HTML_Helper' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/HTML/Helper.php',
|
||||
'Minify_ImportProcessor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ImportProcessor.php',
|
||||
'Minify_JS_ClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
|
||||
'Minify_JS_ClosureCompiler_Exception' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
|
||||
'Minify_LessCssSource' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/LessCssSource.php',
|
||||
'Minify_Lines' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Lines.php',
|
||||
'Minify_NailgunClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/NailgunClosureCompiler.php',
|
||||
'Minify_Packer' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Packer.php',
|
||||
'Minify_ScssCssSource' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ScssCssSource.php',
|
||||
'Minify_ServeConfiguration' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ServeConfiguration.php',
|
||||
'Minify_Source' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source.php',
|
||||
'Minify_SourceInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/SourceInterface.php',
|
||||
'Minify_SourceSet' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/SourceSet.php',
|
||||
'Minify_Source_Factory' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source/Factory.php',
|
||||
'Minify_Source_FactoryException' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source/FactoryException.php',
|
||||
'Minify_YUICompressor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/YUICompressor.php',
|
||||
'MrClay\\Cli' => __DIR__ . '/..' . '/mrclay/minify/lib/MrClay/Cli.php',
|
||||
'MrClay\\Cli\\Arg' => __DIR__ . '/..' . '/mrclay/minify/lib/MrClay/Cli/Arg.php',
|
||||
'lessc' => __DIR__ . '/..' . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_classic' => __DIR__ . '/..' . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_compressed' => __DIR__ . '/..' . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_formatter_lessjs' => __DIR__ . '/..' . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'lessc_parser' => __DIR__ . '/..' . '/marcusschwarz/lesserphp/lessc.inc.php',
|
||||
'simplehtmldom\\Debug' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/Debug.php',
|
||||
'simplehtmldom\\HtmlDocument' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlDocument.php',
|
||||
'simplehtmldom\\HtmlElement' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlElement.php',
|
||||
'simplehtmldom\\HtmlNode' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlNode.php',
|
||||
'simplehtmldom\\HtmlWeb' => __DIR__ . '/..' . '/simplehtmldom/simplehtmldom/HtmlWeb.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite4f181c817bb7f56c650b242f9d1d695::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite4f181c817bb7f56c650b242f9d1d695::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInite4f181c817bb7f56c650b242f9d1d695::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInite4f181c817bb7f56c650b242f9d1d695::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
1485
wp-content/plugins/wp-optimize/vendor/composer/installed.json
vendored
Normal file
1485
wp-content/plugins/wp-optimize/vendor/composer/installed.json
vendored
Normal file
File diff suppressed because it is too large
Load Diff
224
wp-content/plugins/wp-optimize/vendor/composer/installed.php
vendored
Normal file
224
wp-content/plugins/wp-optimize/vendor/composer/installed.php
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'updraftplus/wp-optimize',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '521a0173da262e4c452a9d52134e62cead71b3cf',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => false,
|
||||
),
|
||||
'versions' => array(
|
||||
'intervention/httpauth' => array(
|
||||
'pretty_version' => '3.0.3',
|
||||
'version' => '3.0.3.0',
|
||||
'reference' => '7742aa013e1a72f94379cb6623286f06fa1ea5f7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../intervention/httpauth',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'marcusschwarz/lesserphp' => array(
|
||||
'pretty_version' => 'v0.5.5',
|
||||
'version' => '0.5.5.0',
|
||||
'reference' => '77ba82b5218ff228267d3b0e5ec8697be75e86a7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../marcusschwarz/lesserphp',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'matthiasmullie/minify' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => 'aa9c91d9f7d871b8f886e553da568e9b6768d01b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../matthiasmullie/minify',
|
||||
'aliases' => array(
|
||||
0 => '9999999-dev',
|
||||
),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'matthiasmullie/path-converter' => array(
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'reference' => 'e7d13b2c7e2f2268e1424aaed02085518afa02d9',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../matthiasmullie/path-converter',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'monolog/monolog' => array(
|
||||
'pretty_version' => '2.3.5',
|
||||
'version' => '2.3.5.0',
|
||||
'reference' => 'fd4380d6fc37626e2f799f29d91195040137eba9',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../monolog/monolog',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'mrclay/jsmin-php' => array(
|
||||
'pretty_version' => '2.4.3',
|
||||
'version' => '2.4.3.0',
|
||||
'reference' => '49feaa85933458c15bb62ae65644bf22d60b7610',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../mrclay/jsmin-php',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'mrclay/minify' => array(
|
||||
'pretty_version' => '3.0.13',
|
||||
'version' => '3.0.13.0',
|
||||
'reference' => 'ae5b9f0bfb5f2ab0bcba45289268328be27a7ae6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../mrclay/minify',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'mrclay/props-dic' => array(
|
||||
'pretty_version' => '3.0.1',
|
||||
'version' => '3.0.1.0',
|
||||
'reference' => '63fae3035770feee1836f57c7dd52c0a9b7e5b4d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../mrclay/props-dic',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'pimple/pimple' => array(
|
||||
'pretty_version' => 'v3.5.0',
|
||||
'version' => '3.5.0.0',
|
||||
'reference' => 'a94b3a4db7fb774b3d78dad2315ddc07629e1bed',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../pimple/pimple',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/container' => array(
|
||||
'pretty_version' => '2.0.2',
|
||||
'version' => '2.0.2.0',
|
||||
'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/container',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/log' => array(
|
||||
'pretty_version' => '1.1.4',
|
||||
'version' => '1.1.4.0',
|
||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/log',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/log-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0.0 || 2.0.0 || 3.0.0',
|
||||
),
|
||||
),
|
||||
'rosell-dk/exec-with-fallback' => array(
|
||||
'pretty_version' => '1.2.0',
|
||||
'version' => '1.2.0.0',
|
||||
'reference' => 'f88a6b29abd0b580566056b7c1eb0434eb5db20d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/exec-with-fallback',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/file-util' => array(
|
||||
'pretty_version' => '0.1.1',
|
||||
'version' => '0.1.1.0',
|
||||
'reference' => '2ff895308c37f448b34b031cfbfd8e45f43936fd',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/file-util',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/htaccess-capability-tester' => array(
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'reference' => 'b4499dcd9fe8b538a617069fdf34ae3de877c977',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/htaccess-capability-tester',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/image-mime-type-guesser' => array(
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'reference' => '72f7040e95a78937ae2edece452530224fcacea6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/image-mime-type-guesser',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/image-mime-type-sniffer' => array(
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'reference' => '9ed14cc5d2c14c417660a4dd1946b5f056494691',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/image-mime-type-sniffer',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/locate-binaries' => array(
|
||||
'pretty_version' => '1.0',
|
||||
'version' => '1.0.0.0',
|
||||
'reference' => 'bd2f493383ecd55aa519828dd2898e30f3b9cbb0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/locate-binaries',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rosell-dk/webp-convert' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => 'd51a1799d12997696681a535d1aa2d4354ea8b8d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rosell-dk/webp-convert',
|
||||
'aliases' => array(
|
||||
0 => '9999999-dev',
|
||||
),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'simplehtmldom/simplehtmldom' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '56496c8ced3bfcf3518c98d89cdcd40404ea5ba5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../simplehtmldom/simplehtmldom',
|
||||
'aliases' => array(
|
||||
0 => '9999999-dev',
|
||||
),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'team-updraft/common-libs' => array(
|
||||
'pretty_version' => '3.0.4',
|
||||
'version' => '3.0.4.0',
|
||||
'reference' => '6f4fdb2dba754cd0a5b8457e35ac34f3cd3ef449',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../team-updraft/common-libs',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'tubalmartin/cssmin' => array(
|
||||
'pretty_version' => 'v4.1.1',
|
||||
'version' => '4.1.1.0',
|
||||
'reference' => '3cbf557f4079d83a06f9c3ff9b957c022d7805cf',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../tubalmartin/cssmin',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'updraftplus/wp-optimize' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '521a0173da262e4c452a9d52134e62cead71b3cf',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
9
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/LICENSE
vendored
Normal file
9
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/LICENSE
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Oliver Vogel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
236
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/AbstractVault.php
vendored
Normal file
236
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/AbstractVault.php
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
use Intervention\HttpAuth\Configurator\ArrayConfigurator;
|
||||
|
||||
abstract class AbstractVault
|
||||
{
|
||||
/**
|
||||
* Environment
|
||||
*
|
||||
* @var Environment
|
||||
*/
|
||||
protected $environment;
|
||||
|
||||
/**
|
||||
* Name of realm for vault
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $realm;
|
||||
|
||||
/**
|
||||
* Username for vault
|
||||
* @var string
|
||||
*/
|
||||
protected $username;
|
||||
|
||||
/**
|
||||
* Password for vault
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Build directive for current vault
|
||||
*
|
||||
* @return Directive
|
||||
*/
|
||||
abstract public function getDirective(): Directive;
|
||||
|
||||
/**
|
||||
* Determine if vault is accessible by given key
|
||||
*
|
||||
* @param Key $key
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function unlocksWithKey(Key $key): bool;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param mixed $realm
|
||||
* @param mixed $username
|
||||
* @param mixed $password
|
||||
*/
|
||||
public function __construct($realm, $username, $password)
|
||||
{
|
||||
$this->checkParameterValidity([
|
||||
'realm' => $realm,
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
]);
|
||||
|
||||
$this->environment = new Environment();
|
||||
|
||||
$this->realm = $realm;
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw exception if any of the given parameters are empty
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
private function checkParameterValidity(array $parameters): void
|
||||
{
|
||||
foreach ($parameters as $key => $value) {
|
||||
if (empty($value)) {
|
||||
throw new Exception\InvalidParameterException(
|
||||
'Cannot create HTTP authentication vault. Parameter "' . $key . '" cannot be empty.'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return key from current token
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function getKey(): Key
|
||||
{
|
||||
return $this->environment->getToken()->toKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Denies access for non-authenticated users
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function secure(): void
|
||||
{
|
||||
if (! $this->unlocksWithKey($this->getKey())) {
|
||||
$this->denyAccess();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name of realm
|
||||
*
|
||||
* @param string $realm
|
||||
* @return AbstractVault
|
||||
*/
|
||||
public function setRealm($realm): AbstractVault
|
||||
{
|
||||
$this->realm = $realm;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for setRealm()
|
||||
*
|
||||
* @param string $realm
|
||||
* @return AbstractVault
|
||||
*/
|
||||
public function realm($realm): AbstractVault
|
||||
{
|
||||
return $this->setRealm($realm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current realm name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRealm()
|
||||
{
|
||||
return $this->realm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set username for current vault
|
||||
*
|
||||
* @param string $username
|
||||
*/
|
||||
public function setUsername($username): AbstractVault
|
||||
{
|
||||
$this->username = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for setUsername()
|
||||
*
|
||||
* @param string $username
|
||||
*/
|
||||
public function username($username): AbstractVault
|
||||
{
|
||||
return $this->setUsername($username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set password for current vault
|
||||
*
|
||||
* @param string $password
|
||||
* @return AbstractVault
|
||||
*/
|
||||
public function setPassword($password): AbstractVault
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for setPassword()
|
||||
*
|
||||
* @param string $password
|
||||
* @return AbstractVault
|
||||
*/
|
||||
public function password($password): AbstractVault
|
||||
{
|
||||
return $this->setPassword($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set username and password at once
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return AbstractVault
|
||||
*/
|
||||
public function credentials($username, $password): AbstractVault
|
||||
{
|
||||
return $this->setUsername($username)->setPassword($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends HTTP 401 Header
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function denyAccess(): void
|
||||
{
|
||||
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
|
||||
header($protocol . ' Unauthorized');
|
||||
header('WWW-Authenticate: ' . (string) $this->getDirective());
|
||||
exit('<strong>' . $protocol . ' 401 Unauthorized</strong>');
|
||||
}
|
||||
}
|
||||
89
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Directive.php
vendored
Normal file
89
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Directive.php
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
class Directive
|
||||
{
|
||||
/**
|
||||
* Type of directive (basic|digest)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* Array of parameters
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $parameters = [];
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param string $type
|
||||
* @param array $parameters
|
||||
*/
|
||||
public function __construct($type, $parameters = [])
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format current instance
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function format(): string
|
||||
{
|
||||
return sprintf(
|
||||
'%s %s',
|
||||
ucfirst(strtolower($this->type)),
|
||||
$this->getParametersString()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return value of given key from all parameters, if existing
|
||||
*
|
||||
* @param mixed $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function getParameter($key)
|
||||
{
|
||||
return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format current parameters as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getParametersString(): string
|
||||
{
|
||||
return implode(', ', array_map(function ($key, $value) {
|
||||
return sprintf('%s="%s"', $key, $value);
|
||||
}, array_keys($this->parameters), $this->parameters));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast object to string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->format();
|
||||
}
|
||||
}
|
||||
55
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Environment.php
vendored
Normal file
55
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Environment.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
use Exception;
|
||||
|
||||
class Environment
|
||||
{
|
||||
/**
|
||||
* Available auth tokens
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tokenClassnames = [
|
||||
Token\PhpAuthUser::class,
|
||||
Token\HttpAuthentification::class,
|
||||
Token\RedirectHttpAuthorization::class,
|
||||
Token\PhpAuthDigest::class,
|
||||
Token\HttpAuthorization::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Get first active auth token from all available tokens
|
||||
*
|
||||
* @return TokenInterface
|
||||
*/
|
||||
public function getToken(): TokenInterface
|
||||
{
|
||||
foreach ($this->tokenClassnames as $classname) {
|
||||
if ($auth = $this->getActiveTokenOrNull($classname)) {
|
||||
return $auth;
|
||||
}
|
||||
}
|
||||
|
||||
return new Token\NullToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to parse auth token from given classname. Returns token object
|
||||
* if token is active and could be parsed or null.
|
||||
*
|
||||
* @param string $classname
|
||||
* @return TokenInterface|null
|
||||
*/
|
||||
private function getActiveTokenOrNull($classname)
|
||||
{
|
||||
try {
|
||||
$auth = new $classname();
|
||||
} catch (Exception $e) {
|
||||
$auth = null;
|
||||
}
|
||||
|
||||
return $auth;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class AuthentificationException extends RuntimeException
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class InvalidParameterException extends RuntimeException
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class NotSupportedException extends RuntimeException
|
||||
{
|
||||
//
|
||||
}
|
||||
218
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/HttpAuth.php
vendored
Normal file
218
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/HttpAuth.php
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
class HttpAuth
|
||||
{
|
||||
/**
|
||||
* Authentication type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $type = 'basic';
|
||||
|
||||
/**
|
||||
* Name of authentication realm
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $realm = 'Secured Resource';
|
||||
|
||||
/**
|
||||
* Username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $username = 'admin';
|
||||
|
||||
/**
|
||||
* Password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $password = 'secret';
|
||||
|
||||
/**
|
||||
* Static factory method
|
||||
*
|
||||
* @param array $config
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public static function make(array $config = []): HttpAuth
|
||||
{
|
||||
return (new self())->configure($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure current instance by array
|
||||
*
|
||||
* @param array $config
|
||||
* @return HttpAuth
|
||||
*/
|
||||
private function configure(array $config = []): HttpAuth
|
||||
{
|
||||
foreach ($config as $key => $value) {
|
||||
if (isset(static::${$key})) {
|
||||
static::${$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create vault by current parameters and secure it
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function secure(): void
|
||||
{
|
||||
$this->getVault()->secure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP basic auth instance
|
||||
*
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function basic(): HttpAuth
|
||||
{
|
||||
static::$type = 'basic';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP digest auth instance
|
||||
*
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function digest(): HttpAuth
|
||||
{
|
||||
static::$type = 'digest';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type of configured vault
|
||||
*
|
||||
* @param string $value
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function type($value): HttpAuth
|
||||
{
|
||||
static::$type = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set realm name of configured vault
|
||||
*
|
||||
* @param string $value
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function realm($value): HttpAuth
|
||||
{
|
||||
static::$realm = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set username of configured vault
|
||||
*
|
||||
* @param string $value
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function username($value): HttpAuth
|
||||
{
|
||||
static::$username = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set password of configured vault
|
||||
*
|
||||
* @param string $value
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function password($value): HttpAuth
|
||||
{
|
||||
static::$password = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set credentials for configured vault
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return HttpAuth
|
||||
*/
|
||||
public function credentials($username, $password): HttpAuth
|
||||
{
|
||||
return $this->username($username)->password($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type of current instance
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return static::$type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get realm of current instance
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRealm()
|
||||
{
|
||||
return static::$realm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username of current instance
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return static::$username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password of current instance
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return static::$password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return ready configured vault
|
||||
*
|
||||
* @return AbstractVault
|
||||
*/
|
||||
protected function getVault(): AbstractVault
|
||||
{
|
||||
$classname = sprintf('%s\Vault\%sVault', __NAMESPACE__, ucfirst(strtolower(static::$type)));
|
||||
|
||||
if (! class_exists($classname)) {
|
||||
throw new Exception\NotSupportedException(
|
||||
'Unable to create HTTP authentication vault of type "' . static::$type . '".'
|
||||
);
|
||||
}
|
||||
|
||||
return new $classname(static::$realm, static::$username, static::$password);
|
||||
}
|
||||
}
|
||||
187
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Key.php
vendored
Normal file
187
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Key.php
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
class Key
|
||||
{
|
||||
/**
|
||||
* Realm
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $realm;
|
||||
|
||||
/**
|
||||
* Username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* Password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $password;
|
||||
|
||||
/**
|
||||
* QOP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $qop;
|
||||
|
||||
/**
|
||||
* Nonce
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $nonce;
|
||||
|
||||
/**
|
||||
* Opaque
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $opaque;
|
||||
|
||||
/**
|
||||
* NC
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $nc;
|
||||
|
||||
/**
|
||||
* uri
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $uri;
|
||||
|
||||
/**
|
||||
* cnonce
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $cnonce;
|
||||
|
||||
/**
|
||||
* Response
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $response;
|
||||
|
||||
public function getRealm()
|
||||
{
|
||||
return $this->realm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current qop
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQop()
|
||||
{
|
||||
return $this->qop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current nonce
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNonce()
|
||||
{
|
||||
return $this->nonce;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current opaque
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOpaque()
|
||||
{
|
||||
return $this->opaque;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current uri
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
return $this->uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current nc
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNc()
|
||||
{
|
||||
return $this->nc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current cnonce
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCnonce()
|
||||
{
|
||||
return $this->cnonce;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current response
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set property to given value on current instance
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
* @return Key
|
||||
*/
|
||||
public function setProperty($name, $value): Key
|
||||
{
|
||||
if (property_exists($this, $name)) {
|
||||
$this->{$name} = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
18
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Laravel/Facades/HttpAuth.php
vendored
Normal file
18
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Laravel/Facades/HttpAuth.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Laravel\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class HttpAuth extends Facade
|
||||
{
|
||||
/**
|
||||
* Return facade accessor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'httpauth';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Laravel;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Intervention\HttpAuth\HttpAuth;
|
||||
|
||||
class HttpAuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $defer = false;
|
||||
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../config/config.php' => config_path('httpauth.php')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// merge default config
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__ . '/../config/config.php',
|
||||
'httpauth'
|
||||
);
|
||||
|
||||
// register singleton
|
||||
$this->app->singleton('httpauth', function ($app) {
|
||||
return HttpAuth::make($app['config']->get('httpauth'));
|
||||
});
|
||||
|
||||
// bind classname
|
||||
$this->app->bind('Intervention\HttpAuth\HttpAuth', function ($app) {
|
||||
return HttpAuth::make($app['config']->get('httpauth'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return ['httpauth'];
|
||||
}
|
||||
}
|
||||
48
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/HttpAuthentification.php
vendored
Normal file
48
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/HttpAuthentification.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
use Intervention\HttpAuth\Key;
|
||||
|
||||
class HttpAuthentification extends NullToken
|
||||
{
|
||||
/**
|
||||
* Parsed authentification value
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Transform current instance to key object
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function toKey(): Key
|
||||
{
|
||||
list($username, $password) = explode(':', base64_decode(substr($this->value, 6)));
|
||||
|
||||
$key = new Key();
|
||||
$key->setProperty('username', $username);
|
||||
$key->setProperty('password', $password);
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
$value = $this->getArrayValue($_SERVER, 'HTTP_AUTHENTICATION');
|
||||
if (strtolower(substr($value, 0, 5)) === 'basic') {
|
||||
$this->value = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
23
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/HttpAuthorization.php
vendored
Normal file
23
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/HttpAuthorization.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
class HttpAuthorization extends PhpAuthDigest
|
||||
{
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
$value = $this->getArrayValue($_SERVER, 'HTTP_AUTHORIZATION');
|
||||
if (strtolower(substr($value, 0, 6)) === 'digest') {
|
||||
$this->value = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
57
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/NullToken.php
vendored
Normal file
57
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/NullToken.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
use Intervention\HttpAuth\Exception\AuthentificationException;
|
||||
use Intervention\HttpAuth\Key;
|
||||
use Intervention\HttpAuth\TokenInterface;
|
||||
|
||||
class NullToken implements TokenInterface
|
||||
{
|
||||
/**
|
||||
* Create new instance
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ($this->parse() === false) {
|
||||
throw new AuthentificationException('Failed to parse token');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform current instance to key object
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function toKey(): Key
|
||||
{
|
||||
return new Key();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of given key in given array data.
|
||||
* Returns null if key doesn't exists
|
||||
*
|
||||
* @param array $data
|
||||
* @param mixed $key
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getArrayValue($data, $key)
|
||||
{
|
||||
if (array_key_exists($key, $data)) {
|
||||
return $data[$key];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
49
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/PhpAuthDigest.php
vendored
Normal file
49
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/PhpAuthDigest.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
use Intervention\HttpAuth\Key;
|
||||
|
||||
class PhpAuthDigest extends NullToken
|
||||
{
|
||||
/**
|
||||
* Parsed authentification value
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Transform current instance to key object
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function toKey(): Key
|
||||
{
|
||||
$authKey = new Key();
|
||||
preg_match_all('@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@', $this->value, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $m) {
|
||||
$key = $m[1];
|
||||
$value = $m[2] ? $m[2] : $m[3];
|
||||
$authKey->setProperty($key, $value);
|
||||
}
|
||||
|
||||
return $authKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
if ($value = $this->getArrayValue($_SERVER, 'PHP_AUTH_DIGEST')) {
|
||||
$this->value = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
53
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/PhpAuthUser.php
vendored
Normal file
53
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Token/PhpAuthUser.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
use Intervention\HttpAuth\Key;
|
||||
|
||||
class PhpAuthUser extends NullToken
|
||||
{
|
||||
/**
|
||||
* Parsed authentification username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $username;
|
||||
|
||||
/**
|
||||
* Parsed authentification password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Transform current instance to key object
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function toKey(): Key
|
||||
{
|
||||
$key = new Key();
|
||||
$key->setProperty('username', $this->username);
|
||||
$key->setProperty('password', $this->password);
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
if ($username = $this->getArrayValue($_SERVER, 'PHP_AUTH_USER')) {
|
||||
$this->username = $username;
|
||||
$this->password = array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Token;
|
||||
|
||||
class RedirectHttpAuthorization extends HttpAuthentification
|
||||
{
|
||||
/**
|
||||
* Parse environment variables and store value in object
|
||||
*
|
||||
* @return bool "true" if value was found or "false"
|
||||
*/
|
||||
protected function parse(): bool
|
||||
{
|
||||
$value = $this->getArrayValue($_SERVER, 'REDIRECT_HTTP_AUTHORIZATION');
|
||||
if (strtolower(substr($value, 0, 5)) === 'basic') {
|
||||
$this->value = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
13
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/TokenInterface.php
vendored
Normal file
13
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/TokenInterface.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth;
|
||||
|
||||
interface TokenInterface
|
||||
{
|
||||
/**
|
||||
* Transform current instance to key object
|
||||
*
|
||||
* @return Key
|
||||
*/
|
||||
public function toKey(): Key;
|
||||
}
|
||||
37
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Vault/BasicVault.php
vendored
Normal file
37
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Vault/BasicVault.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Vault;
|
||||
|
||||
use Intervention\HttpAuth\AbstractVault;
|
||||
use Intervention\HttpAuth\Directive;
|
||||
use Intervention\HttpAuth\Key;
|
||||
|
||||
class BasicVault extends AbstractVault
|
||||
{
|
||||
/**
|
||||
* Determine if given key is able to unlock (access) vault.
|
||||
*
|
||||
* @param Key $key
|
||||
* @return bool
|
||||
*/
|
||||
public function unlocksWithKey(Key $key): bool
|
||||
{
|
||||
$username_match = $this->getUsername() == $key->getUsername();
|
||||
$password_match = $this->getPassword() == $key->getPassword();
|
||||
|
||||
return $username_match && $password_match;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return auth directive
|
||||
*
|
||||
* @return Directive
|
||||
*/
|
||||
public function getDirective(): Directive
|
||||
{
|
||||
return new Directive('basic', [
|
||||
'realm' => $this->getRealm(),
|
||||
'charset' => 'UTF-8',
|
||||
]);
|
||||
}
|
||||
}
|
||||
67
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Vault/DigestVault.php
vendored
Normal file
67
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/Vault/DigestVault.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Intervention\HttpAuth\Vault;
|
||||
|
||||
use Intervention\HttpAuth\AbstractVault;
|
||||
use Intervention\HttpAuth\Directive;
|
||||
use Intervention\HttpAuth\Key;
|
||||
|
||||
class DigestVault extends AbstractVault
|
||||
{
|
||||
/**
|
||||
* Determine if given key is able to unlock (access) vault.
|
||||
*
|
||||
* @param Key $key
|
||||
* @return bool
|
||||
*/
|
||||
public function unlocksWithKey(Key $key): bool
|
||||
{
|
||||
$username_match = $key->getUsername() == $this->getUsername();
|
||||
$hash_match = $key->getResponse() == $this->getKeyHash($key);
|
||||
|
||||
return $username_match && $hash_match;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build and return hash from given key/vault
|
||||
*
|
||||
* @param Key $key
|
||||
* @return string
|
||||
*/
|
||||
private function getKeyHash(Key $key): string
|
||||
{
|
||||
return md5(implode(':', [
|
||||
md5(sprintf('%s:%s:%s', $key->getUsername(), $this->getRealm(), $this->getPassword())),
|
||||
$key->getNonce(),
|
||||
$key->getNc(),
|
||||
$key->getCnonce(),
|
||||
$key->getQop(),
|
||||
md5(sprintf('%s:%s', $this->getRequestMethod(), $key->getUri())),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTTP request method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getRequestMethod()
|
||||
{
|
||||
return isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return auth directive
|
||||
*
|
||||
* @return Directive
|
||||
*/
|
||||
public function getDirective(): Directive
|
||||
{
|
||||
return new Directive('digest', [
|
||||
'realm' => $this->getRealm(),
|
||||
'qop' => 'auth',
|
||||
'nonce' => uniqid(),
|
||||
'opaque' => md5($this->getRealm()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
49
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/config/config.php
vendored
Normal file
49
wp-content/plugins/wp-optimize/vendor/intervention/httpauth/src/config/config.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication type
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Intervention HttpAuth supports "basic" and "digest" authentication
|
||||
| implementations. "Basic" is the simplest technique, while "Digest" applies
|
||||
| hash functions to the password before sending it over the network.
|
||||
|
|
||||
| Supported: "basic", "digest"
|
||||
|
|
||||
*/
|
||||
'type' => 'basic',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Name of secured resource. Clients must authentificate to each named realm.
|
||||
|
|
||||
*/
|
||||
'realm' => 'Secured',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Username to access the secured realm in combination with a password.
|
||||
|
|
||||
*/
|
||||
'username' => 'admin',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Password to access the secured realm in combination with the username.
|
||||
|
|
||||
*/
|
||||
'password' => '1234'
|
||||
|
||||
];
|
||||
661
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/LICENSE
vendored
Normal file
661
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/LICENSE
vendored
Normal file
@@ -0,0 +1,661 @@
|
||||
For ease of distribution, lesserphp is under a dual license.
|
||||
You are free to pick which one suits your needs.
|
||||
|
||||
|
||||
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2013 - 2015 Leaf Corcoran, http://leafo.net/lessphp
|
||||
Copyright (c) 2016 - Marcus Schwarz, https://www.maswaba.de
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
||||
GPL VERSION 3
|
||||
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
4019
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/lessc.inc.php
vendored
Normal file
4019
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/lessc.inc.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
447
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/lessify.inc.php
vendored
Normal file
447
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/lessify.inc.php
vendored
Normal file
@@ -0,0 +1,447 @@
|
||||
<?php
|
||||
/**
|
||||
* lessify
|
||||
* Convert a css file into a less file
|
||||
* http://leafo.net/lessphp
|
||||
* Copyright 2010, leaf corcoran <leafot@gmail.com>
|
||||
*
|
||||
* WARNING: THIS DOES NOT WORK ANYMORE. NEEDS TO BE UPDATED FOR
|
||||
* LATEST VERSION OF LESSPHP.
|
||||
*
|
||||
*/
|
||||
|
||||
require "lessc.inc.php";
|
||||
|
||||
//
|
||||
// check if the merge during mixin is overwriting values. should or should it not?
|
||||
//
|
||||
|
||||
//
|
||||
// 1. split apart class tags
|
||||
//
|
||||
|
||||
class easyparse {
|
||||
var $buffer;
|
||||
var $count;
|
||||
|
||||
function __construct($str) {
|
||||
$this->count = 0;
|
||||
$this->buffer = trim($str);
|
||||
}
|
||||
|
||||
function seek($where = null) {
|
||||
if ($where === null) return $this->count;
|
||||
else $this->count = $where;
|
||||
return true;
|
||||
}
|
||||
|
||||
function preg_quote($what) {
|
||||
return preg_quote($what, '/');
|
||||
}
|
||||
|
||||
function match($regex, &$out, $eatWhitespace = true) {
|
||||
$r = '/'.$regex.($eatWhitespace ? '\s*' : '').'/Ais';
|
||||
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
|
||||
$this->count += strlen($out[0]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function literal($what, $eatWhitespace = true) {
|
||||
// this is here mainly prevent notice from { } string accessor
|
||||
if ($this->count >= strlen($this->buffer)) return false;
|
||||
|
||||
// shortcut on single letter
|
||||
if (!$eatWhitespace and strlen($what) == 1) {
|
||||
if ($this->buffer{$this->count} == $what) {
|
||||
$this->count++;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
return $this->match($this->preg_quote($what), $m, $eatWhitespace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class tagparse extends easyparse {
|
||||
static private $combinators = null;
|
||||
static private $match_opts = null;
|
||||
|
||||
function parse() {
|
||||
if (empty(self::$combinators)) {
|
||||
self::$combinators = '('.implode('|', array_map(array($this, 'preg_quote'),
|
||||
array('+', '>', '~'))).')';
|
||||
self::$match_opts = '('.implode('|', array_map(array($this, 'preg_quote'),
|
||||
array('=', '~=', '|=', '$=', '*='))).')';
|
||||
}
|
||||
|
||||
// crush whitespace
|
||||
$this->buffer = preg_replace('/\s+/', ' ', $this->buffer).' ';
|
||||
|
||||
$tags = array();
|
||||
while ($this->tag($t)) $tags[] = $t;
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
static function compileString($string) {
|
||||
list(, $delim, $str) = $string;
|
||||
$str = str_replace($delim, "\\".$delim, $str);
|
||||
$str = str_replace("\n", "\\\n", $str);
|
||||
return $delim.$str.$delim;
|
||||
}
|
||||
|
||||
static function compilePaths($paths) {
|
||||
return implode(', ', array_map(array('self', 'compilePath'), $paths));
|
||||
}
|
||||
|
||||
// array of tags
|
||||
static function compilePath($path) {
|
||||
return implode(' ', array_map(array('self', 'compileTag'), $path));
|
||||
}
|
||||
|
||||
|
||||
static function compileTag($tag) {
|
||||
ob_start();
|
||||
if (isset($tag['comb'])) echo $tag['comb']." ";
|
||||
if (isset($tag['front'])) echo $tag['front'];
|
||||
if (isset($tag['attr'])) {
|
||||
echo '['.$tag['attr'];
|
||||
if (isset($tag['op'])) {
|
||||
echo $tag['op'].$tag['op_value'];
|
||||
}
|
||||
echo ']';
|
||||
}
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
function string(&$out) {
|
||||
$s = $this->seek();
|
||||
|
||||
if ($this->literal('"')) {
|
||||
$delim = '"';
|
||||
} elseif ($this->literal("'")) {
|
||||
$delim = "'";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
// step through letters looking for either end or escape
|
||||
$buff = "";
|
||||
$escapeNext = false;
|
||||
$finished = false;
|
||||
for ($i = $this->count; $i < strlen($this->buffer); $i++) {
|
||||
$char = $this->buffer[$i];
|
||||
switch ($char) {
|
||||
case $delim:
|
||||
if ($escapeNext) {
|
||||
$buff .= $char;
|
||||
$escapeNext = false;
|
||||
break;
|
||||
}
|
||||
$finished = true;
|
||||
break 2;
|
||||
case "\\":
|
||||
if ($escapeNext) {
|
||||
$buff .= $char;
|
||||
$escapeNext = false;
|
||||
} else {
|
||||
$escapeNext = true;
|
||||
}
|
||||
break;
|
||||
case "\n":
|
||||
if (!$escapeNext) {
|
||||
break 3;
|
||||
}
|
||||
|
||||
$buff .= $char;
|
||||
$escapeNext = false;
|
||||
break;
|
||||
default:
|
||||
if ($escapeNext) {
|
||||
$buff .= "\\";
|
||||
$escapeNext = false;
|
||||
}
|
||||
$buff .= $char;
|
||||
}
|
||||
}
|
||||
if (!$finished) break;
|
||||
$out = array('string', $delim, $buff);
|
||||
$this->seek($i+1);
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
function tag(&$out) {
|
||||
$s = $this->seek();
|
||||
$tag = array();
|
||||
if ($this->combinator($op)) $tag['comb'] = $op;
|
||||
|
||||
if (!$this->match('(.*?)( |$|\[|'.self::$combinators.')', $match)) {
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($match[3])) {
|
||||
// give back combinator
|
||||
$this->count-=strlen($match[3]);
|
||||
}
|
||||
|
||||
if (!empty($match[1])) $tag['front'] = $match[1];
|
||||
|
||||
if ($match[2] == '[') {
|
||||
if ($this->ident($i)) {
|
||||
$tag['attr'] = $i;
|
||||
|
||||
if ($this->match(self::$match_opts, $m) && $this->value($v)) {
|
||||
$tag['op'] = $m[1];
|
||||
$tag['op_value'] = $v;
|
||||
}
|
||||
|
||||
if ($this->literal(']')) {
|
||||
$out = $tag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} elseif (isset($tag['front'])) {
|
||||
$out = $tag;
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
function ident(&$out) {
|
||||
// [-]?{nmstart}{nmchar}*
|
||||
// nmstart: [_a-z]|{nonascii}|{escape}
|
||||
// nmchar: [_a-z0-9-]|{nonascii}|{escape}
|
||||
if ($this->match('(-?[_a-z][_\w]*)', $m)) {
|
||||
$out = $m[1];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function value(&$out) {
|
||||
if ($this->string($str)) {
|
||||
$out = $this->compileString($str);
|
||||
return true;
|
||||
} elseif ($this->ident($id)) {
|
||||
$out = $id;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function combinator(&$op) {
|
||||
if ($this->match(self::$combinators, $m)) {
|
||||
$op = $m[1];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class nodecounter {
|
||||
var $count = 0;
|
||||
var $children = array();
|
||||
|
||||
var $name;
|
||||
var $child_blocks;
|
||||
var $the_block;
|
||||
|
||||
function __construct($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
function dump($stack = null) {
|
||||
if (is_null($stack)) $stack = array();
|
||||
$stack[] = $this->getName();
|
||||
echo implode(' -> ', $stack)." ($this->count)\n";
|
||||
foreach ($this->children as $child) {
|
||||
$child->dump($stack);
|
||||
}
|
||||
}
|
||||
|
||||
static function compileProperties($c, $block) {
|
||||
foreach($block as $name => $value) {
|
||||
if ($c->isProperty($name, $value)) {
|
||||
echo $c->compileProperty($name, $value)."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function compile($c, $path = null) {
|
||||
if (is_null($path)) $path = array();
|
||||
$path[] = $this->name;
|
||||
|
||||
$isVisible = !is_null($this->the_block) || !is_null($this->child_blocks);
|
||||
|
||||
if ($isVisible) {
|
||||
echo $c->indent(implode(' ', $path).' {');
|
||||
$c->indentLevel++;
|
||||
$path = array();
|
||||
|
||||
if ($this->the_block) {
|
||||
$this->compileProperties($c, $this->the_block);
|
||||
}
|
||||
|
||||
if ($this->child_blocks) {
|
||||
foreach ($this->child_blocks as $block) {
|
||||
echo $c->indent(tagparse::compilePaths($block['__tags']).' {');
|
||||
$c->indentLevel++;
|
||||
$this->compileProperties($c, $block);
|
||||
$c->indentLevel--;
|
||||
echo $c->indent('}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// compile child nodes
|
||||
foreach($this->children as $node) {
|
||||
$node->compile($c, $path);
|
||||
}
|
||||
|
||||
if ($isVisible) {
|
||||
$c->indentLevel--;
|
||||
echo $c->indent('}');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getName() {
|
||||
if (is_null($this->name)) return "[root]";
|
||||
else return $this->name;
|
||||
}
|
||||
|
||||
function getNode($name) {
|
||||
if (!isset($this->children[$name])) {
|
||||
$this->children[$name] = new nodecounter($name);
|
||||
}
|
||||
|
||||
return $this->children[$name];
|
||||
}
|
||||
|
||||
function findNode($path) {
|
||||
$current = $this;
|
||||
for ($i = 0; $i < count($path); $i++) {
|
||||
$t = tagparse::compileTag($path[$i]);
|
||||
$current = $current->getNode($t);
|
||||
}
|
||||
|
||||
return $current;
|
||||
}
|
||||
|
||||
function addBlock($path, $block) {
|
||||
$node = $this->findNode($path);
|
||||
if (!is_null($node->the_block)) throw new exception("can this happen?");
|
||||
|
||||
unset($block['__tags']);
|
||||
$node->the_block = $block;
|
||||
}
|
||||
|
||||
function addToNode($path, $block) {
|
||||
$node = $this->findNode($path);
|
||||
$node->child_blocks[] = $block;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create a less file from a css file by combining blocks where appropriate
|
||||
*/
|
||||
class lessify extends lessc {
|
||||
public function dump() {
|
||||
print_r($this->env);
|
||||
}
|
||||
|
||||
public function parse($str = null) {
|
||||
$this->prepareParser($str ? $str : $this->buffer);
|
||||
while (false !== $this->parseChunk());
|
||||
|
||||
$root = new nodecounter(null);
|
||||
|
||||
// attempt to preserve some of the block order
|
||||
$order = array();
|
||||
|
||||
$visitedTags = array();
|
||||
foreach (end($this->env) as $name => $block) {
|
||||
if (!$this->isBlock($name, $block)) continue;
|
||||
if (isset($visitedTags[$name])) continue;
|
||||
|
||||
foreach ($block['__tags'] as $t) {
|
||||
$visitedTags[$t] = true;
|
||||
}
|
||||
|
||||
// skip those with more than 1
|
||||
if (count($block['__tags']) == 1) {
|
||||
$p = new tagparse(end($block['__tags']));
|
||||
$path = $p->parse();
|
||||
$root->addBlock($path, $block);
|
||||
$order[] = array('compressed', $path, $block);
|
||||
continue;
|
||||
} else {
|
||||
$common = null;
|
||||
$paths = array();
|
||||
foreach ($block['__tags'] as $rawtag) {
|
||||
$p = new tagparse($rawtag);
|
||||
$paths[] = $path = $p->parse();
|
||||
if (is_null($common)) $common = $path;
|
||||
else {
|
||||
$new_common = array();
|
||||
foreach ($path as $tag) {
|
||||
$head = array_shift($common);
|
||||
if ($tag == $head) {
|
||||
$new_common[] = $head;
|
||||
} else break;
|
||||
}
|
||||
$common = $new_common;
|
||||
if (empty($common)) {
|
||||
// nothing in common
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($common)) {
|
||||
$new_paths = array();
|
||||
foreach ($paths as $p) $new_paths[] = array_slice($p, count($common));
|
||||
$block['__tags'] = $new_paths;
|
||||
$root->addToNode($common, $block);
|
||||
$order[] = array('compressed', $common, $block);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$order[] = array('none', $block['__tags'], $block);
|
||||
}
|
||||
|
||||
|
||||
$compressed = $root->children;
|
||||
foreach ($order as $item) {
|
||||
list($type, $tags, $block) = $item;
|
||||
if ($type == 'compressed') {
|
||||
$top = tagparse::compileTag(reset($tags));
|
||||
if (isset($compressed[$top])) {
|
||||
$compressed[$top]->compile($this);
|
||||
unset($compressed[$top]);
|
||||
}
|
||||
} else {
|
||||
echo $this->indent(implode(', ', $tags).' {');
|
||||
$this->indentLevel++;
|
||||
nodecounter::compileProperties($this, $block);
|
||||
$this->indentLevel--;
|
||||
echo $this->indent('}');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/package.sh
vendored
Normal file
36
wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/package.sh
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
# creates tar.gz for current version
|
||||
|
||||
VERSION=`./plessc -v | sed -n 's/^v\(.*\)$/\1/p'`
|
||||
OUT_DIR="tmp/lessphp"
|
||||
TMP=`dirname $OUT_DIR`
|
||||
|
||||
mkdir -p $OUT_DIR
|
||||
tar -c `git ls-files` | tar -C $OUT_DIR -x
|
||||
|
||||
rm $OUT_DIR/.gitignore
|
||||
rm $OUT_DIR/package.sh
|
||||
rm $OUT_DIR/lessify
|
||||
rm $OUT_DIR/lessify.inc.php
|
||||
|
||||
OUT_NAME="lessphp-$VERSION.tar.gz"
|
||||
tar -czf $OUT_NAME -C $TMP lessphp/
|
||||
echo "Wrote $OUT_NAME"
|
||||
|
||||
rm -r $TMP
|
||||
|
||||
|
||||
echo
|
||||
echo "Don't forget to"
|
||||
echo "* Update the version in lessc.inc.php (two places)"
|
||||
echo "* Update the version in the README.md"
|
||||
echo "* Update the version in docs.md (two places)"
|
||||
echo "* Update the version in LICENSE"
|
||||
echo "* Update the version in the branch-alias in composer.json"
|
||||
echo "* Update @current_version in site.moon"
|
||||
echo "* Add entry to feed.moon for changelog"
|
||||
echo "* Update the -New- area on homepage with date and features"
|
||||
echo
|
||||
|
||||
|
||||
18
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/LICENSE
vendored
Normal file
18
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/LICENSE
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright (c) 2012 Matthias Mullie
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
154
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/README.md
vendored
Normal file
154
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/README.md
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
# Minify
|
||||
|
||||
[](https://travis-ci.org/matthiasmullie/minify)
|
||||
[](https://codecov.io/github/matthiasmullie/minify)
|
||||
[](https://scrutinizer-ci.com/g/matthiasmullie/minify)
|
||||
[](https://packagist.org/packages/matthiasmullie/minify)
|
||||
[](https://packagist.org/packages/matthiasmullie/minify)
|
||||
[](https://github.com/matthiasmullie/minify/blob/master/LICENSE)
|
||||
|
||||
|
||||
**[Donate/Support: ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=73CVYMBETDAP4)**
|
||||
|
||||
Removes whitespace, strips comments, combines files (incl. `@import` statements and small assets in CSS files), and optimizes/shortens a few common programming patterns, such as:
|
||||
|
||||
**JavaScript**
|
||||
* `object['property']` -> `object.property`
|
||||
* `true`, `false` -> `!0`, `!1`
|
||||
* `while(true)` -> `for(;;)`
|
||||
|
||||
**CSS**
|
||||
* `@import url("http://path")` -> `@import "http://path"`
|
||||
* `#ff0000`, `#ff00ff` -> `red`, `#f0f`
|
||||
* `-0px`, `50.00px` -> `0`, `50px`
|
||||
* `bold` -> `700`
|
||||
* `p {}` -> removed
|
||||
|
||||
And it comes with a huge test suite.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### CSS
|
||||
|
||||
```php
|
||||
use MatthiasMullie\Minify;
|
||||
|
||||
$sourcePath = '/path/to/source/css/file.css';
|
||||
$minifier = new Minify\CSS($sourcePath);
|
||||
|
||||
// we can even add another file, they'll then be
|
||||
// joined in 1 output file
|
||||
$sourcePath2 = '/path/to/second/source/css/file.css';
|
||||
$minifier->add($sourcePath2);
|
||||
|
||||
// or we can just add plain CSS
|
||||
$css = 'body { color: #000000; }';
|
||||
$minifier->add($css);
|
||||
|
||||
// save minified file to disk
|
||||
$minifiedPath = '/path/to/minified/css/file.css';
|
||||
$minifier->minify($minifiedPath);
|
||||
|
||||
// or just output the content
|
||||
echo $minifier->minify();
|
||||
```
|
||||
|
||||
### JS
|
||||
|
||||
```php
|
||||
// just look at the CSS example; it's exactly the same, but with the JS class & JS files :)
|
||||
```
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
Available methods, for both CSS & JS minifier, are:
|
||||
|
||||
### __construct(/* overload paths */)
|
||||
|
||||
The object constructor accepts 0, 1 or multiple paths of files, or even complete CSS/JS content, that should be minified.
|
||||
All CSS/JS passed along, will be combined into 1 minified file.
|
||||
|
||||
```php
|
||||
use MatthiasMullie\Minify;
|
||||
$minifier = new Minify\JS($path1, $path2);
|
||||
```
|
||||
|
||||
### add($path, /* overload paths */)
|
||||
|
||||
This is roughly equivalent to the constructor.
|
||||
|
||||
```php
|
||||
$minifier->add($path3);
|
||||
$minifier->add($js);
|
||||
```
|
||||
|
||||
### minify($path)
|
||||
|
||||
This will minify the files' content, save the result to $path and return the resulting content.
|
||||
If the $path parameter is omitted, the result will not be written anywhere.
|
||||
|
||||
*CAUTION: If you have CSS with relative paths (to imports, images, ...), you should always specify a target path! Then those relative paths will be adjusted in accordance with the new path.*
|
||||
|
||||
```php
|
||||
$minifier->minify('/target/path.js');
|
||||
```
|
||||
|
||||
### gzip($path, $level)
|
||||
|
||||
Minifies and optionally saves to a file, just like `minify()`, but it also `gzencode()`s the minified content.
|
||||
|
||||
```php
|
||||
$minifier->gzip('/target/path.js');
|
||||
```
|
||||
|
||||
### setMaxImportSize($size) *(CSS only)*
|
||||
|
||||
The CSS minifier will automatically embed referenced files (like images, fonts, ...) into the minified CSS, so they don't have to be fetched over multiple connections.
|
||||
|
||||
However, for really large files, it's likely better to load them separately (as it would increase the CSS load time if they were included.)
|
||||
|
||||
This method allows the max size of files to import into the minified CSS to be set (in kB). The default size is 5.
|
||||
|
||||
```php
|
||||
$minifier->setMaxImportSize(10);
|
||||
```
|
||||
|
||||
### setImportExtensions($extensions) *(CSS only)*
|
||||
|
||||
The CSS minifier will automatically embed referenced files (like images, fonts, ...) into minified CSS, so they don't have to be fetched over multiple connections.
|
||||
|
||||
This methods allows the type of files to be specified, along with their data:mime type.
|
||||
|
||||
The default embedded file types are gif, png, jpg, jpeg, svg, apng, avif, webp, woff and woff2.
|
||||
|
||||
```php
|
||||
$extensions = array(
|
||||
'gif' => 'data:image/gif',
|
||||
'png' => 'data:image/png',
|
||||
);
|
||||
|
||||
$minifier->setImportExtensions($extensions);
|
||||
```
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Simply add a dependency on matthiasmullie/minify to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:
|
||||
|
||||
```sh
|
||||
composer require matthiasmullie/minify
|
||||
```
|
||||
|
||||
Although it's recommended to use Composer, you can actually [include these files](https://github.com/matthiasmullie/minify/issues/83) anyway you want.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Minify is [MIT](http://opensource.org/licenses/MIT) licensed.
|
||||
|
||||
|
||||
## Challenges
|
||||
|
||||
If you're interested in learning some of the harder technical challenges I've encountered building this, you probably want to take a look at [what I wrote about it](http://www.mullie.eu/dont-build-your-own-minifier/) on my blog.
|
||||
31
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/appveyor.yml
vendored
Normal file
31
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/appveyor.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
build: false
|
||||
|
||||
shallow_clone: false
|
||||
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
cache:
|
||||
- C:\Program Files\OpenSSL -> appveyor.yml
|
||||
- C:\tools\php -> appveyor.yml
|
||||
- vendor -> composer.json
|
||||
|
||||
init:
|
||||
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
|
||||
|
||||
install:
|
||||
# install ssl
|
||||
- IF NOT EXIST "C:\Program Files\OpenSSL" (cinst -y OpenSSL.Light)
|
||||
# install php
|
||||
- ps: Set-Service wuauserv -StartupType Manual # http://help.appveyor.com/discussions/problems/5616-not-able-to-build-due-to-problem-in-chocolateyinstallps1
|
||||
- IF NOT EXIST C:\tools\php (cinst --params '""/InstallDir:C:\tools\php""' -y php)
|
||||
- echo extension_dir=ext > C:\tools\php\php.ini
|
||||
- echo extension=php_openssl.dll >> C:\tools\php\php.ini
|
||||
- echo extension=php_mbstring.dll >> C:\tools\php\php.ini
|
||||
# install composer
|
||||
- IF NOT EXIST vendor (php -r "readfile('https://getcomposer.org/installer');" | php & php composer.phar --prefer-source install)
|
||||
- tests\convert_symlinks_to_windows_style.sh
|
||||
|
||||
test_script:
|
||||
- vendor\bin\phpunit
|
||||
7
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_after.txt
vendored
Normal file
7
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_after.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
in
|
||||
public
|
||||
extends
|
||||
private
|
||||
protected
|
||||
implements
|
||||
instanceof
|
||||
26
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_before.txt
vendored
Normal file
26
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_before.txt
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
do
|
||||
in
|
||||
let
|
||||
new
|
||||
var
|
||||
case
|
||||
else
|
||||
enum
|
||||
void
|
||||
with
|
||||
class
|
||||
const
|
||||
yield
|
||||
delete
|
||||
export
|
||||
import
|
||||
public
|
||||
static
|
||||
typeof
|
||||
extends
|
||||
package
|
||||
private
|
||||
function
|
||||
protected
|
||||
implements
|
||||
instanceof
|
||||
63
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt
vendored
Normal file
63
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
do
|
||||
if
|
||||
in
|
||||
for
|
||||
let
|
||||
new
|
||||
try
|
||||
var
|
||||
case
|
||||
else
|
||||
enum
|
||||
eval
|
||||
null
|
||||
this
|
||||
true
|
||||
void
|
||||
with
|
||||
break
|
||||
catch
|
||||
class
|
||||
const
|
||||
false
|
||||
super
|
||||
throw
|
||||
while
|
||||
yield
|
||||
delete
|
||||
export
|
||||
import
|
||||
public
|
||||
return
|
||||
static
|
||||
switch
|
||||
typeof
|
||||
default
|
||||
extends
|
||||
finally
|
||||
package
|
||||
private
|
||||
continue
|
||||
debugger
|
||||
function
|
||||
arguments
|
||||
interface
|
||||
protected
|
||||
implements
|
||||
instanceof
|
||||
abstract
|
||||
boolean
|
||||
byte
|
||||
char
|
||||
double
|
||||
final
|
||||
float
|
||||
goto
|
||||
int
|
||||
long
|
||||
native
|
||||
short
|
||||
synchronized
|
||||
throws
|
||||
transient
|
||||
volatile
|
||||
46
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators.txt
vendored
Normal file
46
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators.txt
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
+
|
||||
-
|
||||
*
|
||||
/
|
||||
%
|
||||
=
|
||||
+=
|
||||
-=
|
||||
*=
|
||||
/=
|
||||
%=
|
||||
<<=
|
||||
>>=
|
||||
>>>=
|
||||
&=
|
||||
^=
|
||||
|=
|
||||
&
|
||||
|
|
||||
^
|
||||
~
|
||||
<<
|
||||
>>
|
||||
>>>
|
||||
==
|
||||
===
|
||||
!=
|
||||
!==
|
||||
>
|
||||
<
|
||||
>=
|
||||
<=
|
||||
&&
|
||||
||
|
||||
!
|
||||
.
|
||||
[
|
||||
]
|
||||
?
|
||||
:
|
||||
,
|
||||
;
|
||||
(
|
||||
)
|
||||
{
|
||||
}
|
||||
43
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators_after.txt
vendored
Normal file
43
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators_after.txt
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
+
|
||||
-
|
||||
*
|
||||
/
|
||||
%
|
||||
=
|
||||
+=
|
||||
-=
|
||||
*=
|
||||
/=
|
||||
%=
|
||||
<<=
|
||||
>>=
|
||||
>>>=
|
||||
&=
|
||||
^=
|
||||
|=
|
||||
&
|
||||
|
|
||||
^
|
||||
<<
|
||||
>>
|
||||
>>>
|
||||
==
|
||||
===
|
||||
!=
|
||||
!==
|
||||
>
|
||||
<
|
||||
>=
|
||||
<=
|
||||
&&
|
||||
||
|
||||
.
|
||||
[
|
||||
]
|
||||
?
|
||||
:
|
||||
,
|
||||
;
|
||||
(
|
||||
)
|
||||
}
|
||||
43
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators_before.txt
vendored
Normal file
43
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/data/js/operators_before.txt
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
+
|
||||
-
|
||||
*
|
||||
/
|
||||
%
|
||||
=
|
||||
+=
|
||||
-=
|
||||
*=
|
||||
/=
|
||||
%=
|
||||
<<=
|
||||
>>=
|
||||
>>>=
|
||||
&=
|
||||
^=
|
||||
|=
|
||||
&
|
||||
|
|
||||
^
|
||||
~
|
||||
<<
|
||||
>>
|
||||
>>>
|
||||
==
|
||||
===
|
||||
!=
|
||||
!==
|
||||
>
|
||||
<
|
||||
>=
|
||||
<=
|
||||
&&
|
||||
||
|
||||
!
|
||||
.
|
||||
[
|
||||
?
|
||||
:
|
||||
,
|
||||
;
|
||||
(
|
||||
{
|
||||
46
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/docker-compose.yml
vendored
Normal file
46
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/docker-compose.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./src:/var/www/src
|
||||
- ./data:/var/www/data
|
||||
- ./tests:/var/www/tests
|
||||
- ./phpunit.xml.dist:/var/www/phpunit.xml.dist
|
||||
'8.0':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 8.0-cli
|
||||
'7.4':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 7.4-cli
|
||||
'7.3':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 7.3-cli
|
||||
'7.2':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 7.2-cli
|
||||
'7.1':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 7.1-cli
|
||||
'7.0':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 7.0-cli
|
||||
'5.6':
|
||||
extends: php
|
||||
build:
|
||||
args:
|
||||
version: 5.6-cli
|
||||
23
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/makefile
vendored
Normal file
23
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/makefile
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
PHP ?= '7.2'
|
||||
UP ?= 1
|
||||
DOWN ?= 1
|
||||
|
||||
docs:
|
||||
wget http://apigen.org/apigen.phar
|
||||
chmod +x apigen.phar
|
||||
php apigen.phar generate --source=src --destination=docs --template-theme=bootstrap
|
||||
rm apigen.phar
|
||||
|
||||
image:
|
||||
docker build -t matthiasmullie/minify .
|
||||
|
||||
up:
|
||||
docker-compose up -d $(PHP)
|
||||
|
||||
down:
|
||||
docker-compose stop -t0 $(PHP)
|
||||
|
||||
test:
|
||||
[ $(UP) -eq 1 ] && make up || true
|
||||
$(eval cmd='docker-compose run $(PHP) vendor/bin/phpunit')
|
||||
eval $(cmd); status=$$?; [ $(DOWN) -eq 1 ] && make down; exit $$status
|
||||
12
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/phpunit.xml.dist
vendored
Normal file
12
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit colors="true" bootstrap="tests/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="Minify test suite">
|
||||
<directory suffix="Test.php">tests/css</directory>
|
||||
<directory suffix="Test.php">tests/js</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<logging>
|
||||
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
794
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/CSS.php
vendored
Normal file
794
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/CSS.php
vendored
Normal file
@@ -0,0 +1,794 @@
|
||||
<?php
|
||||
/**
|
||||
* CSS Minifier
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
namespace MatthiasMullie\Minify;
|
||||
|
||||
use MatthiasMullie\Minify\Exceptions\FileImportException;
|
||||
use MatthiasMullie\PathConverter\ConverterInterface;
|
||||
use MatthiasMullie\PathConverter\Converter;
|
||||
|
||||
/**
|
||||
* CSS minifier
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @package Minify
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @author Tijs Verkoyen <minify@verkoyen.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
class CSS extends Minify
|
||||
{
|
||||
/**
|
||||
* @var int maximum inport size in kB
|
||||
*/
|
||||
protected $maxImportSize = 5;
|
||||
|
||||
/**
|
||||
* @var string[] valid import extensions
|
||||
*/
|
||||
protected $importExtensions = array(
|
||||
'gif' => 'data:image/gif',
|
||||
'png' => 'data:image/png',
|
||||
'jpe' => 'data:image/jpeg',
|
||||
'jpg' => 'data:image/jpeg',
|
||||
'jpeg' => 'data:image/jpeg',
|
||||
'svg' => 'data:image/svg+xml',
|
||||
'woff' => 'data:application/x-font-woff',
|
||||
'woff2' => 'data:application/x-font-woff2',
|
||||
'avif' => 'data:image/avif',
|
||||
'apng' => 'data:image/apng',
|
||||
'webp' => 'data:image/webp',
|
||||
'tif' => 'image/tiff',
|
||||
'tiff' => 'image/tiff',
|
||||
'xbm' => 'image/x-xbitmap',
|
||||
);
|
||||
|
||||
/**
|
||||
* Set the maximum size if files to be imported.
|
||||
*
|
||||
* Files larger than this size (in kB) will not be imported into the CSS.
|
||||
* Importing files into the CSS as data-uri will save you some connections,
|
||||
* but we should only import relatively small decorative images so that our
|
||||
* CSS file doesn't get too bulky.
|
||||
*
|
||||
* @param int $size Size in kB
|
||||
*/
|
||||
public function setMaxImportSize($size)
|
||||
{
|
||||
$this->maxImportSize = $size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the type of extensions to be imported into the CSS (to save network
|
||||
* connections).
|
||||
* Keys of the array should be the file extensions & respective values
|
||||
* should be the data type.
|
||||
*
|
||||
* @param string[] $extensions Array of file extensions
|
||||
*/
|
||||
public function setImportExtensions(array $extensions)
|
||||
{
|
||||
$this->importExtensions = $extensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move any import statements to the top.
|
||||
*
|
||||
* @param string $content Nearly finished CSS content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function moveImportsToTop($content)
|
||||
{
|
||||
if (preg_match_all('/(;?)(@import (?<url>url\()?(?P<quotes>["\']?).+?(?P=quotes)(?(url)\)));?/', $content, $matches)) {
|
||||
// remove from content
|
||||
foreach ($matches[0] as $import) {
|
||||
$content = str_replace($import, '', $content);
|
||||
}
|
||||
|
||||
// add to top
|
||||
$content = implode(';', $matches[2]).';'.trim($content, ';');
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combine CSS from import statements.
|
||||
*
|
||||
* @import's will be loaded and their content merged into the original file,
|
||||
* to save HTTP requests.
|
||||
*
|
||||
* @param string $source The file to combine imports for
|
||||
* @param string $content The CSS content to combine imports for
|
||||
* @param string[] $parents Parent paths, for circular reference checks
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws FileImportException
|
||||
*/
|
||||
protected function combineImports($source, $content, $parents)
|
||||
{
|
||||
$importRegexes = array(
|
||||
// @import url(xxx)
|
||||
'/
|
||||
# import statement
|
||||
@import
|
||||
|
||||
# whitespace
|
||||
\s+
|
||||
|
||||
# open url()
|
||||
url\(
|
||||
|
||||
# (optional) open path enclosure
|
||||
(?P<quotes>["\']?)
|
||||
|
||||
# fetch path
|
||||
(?P<path>.+?)
|
||||
|
||||
# (optional) close path enclosure
|
||||
(?P=quotes)
|
||||
|
||||
# close url()
|
||||
\)
|
||||
|
||||
# (optional) trailing whitespace
|
||||
\s*
|
||||
|
||||
# (optional) media statement(s)
|
||||
(?P<media>[^;]*)
|
||||
|
||||
# (optional) trailing whitespace
|
||||
\s*
|
||||
|
||||
# (optional) closing semi-colon
|
||||
;?
|
||||
|
||||
/ix',
|
||||
|
||||
// @import 'xxx'
|
||||
'/
|
||||
|
||||
# import statement
|
||||
@import
|
||||
|
||||
# whitespace
|
||||
\s+
|
||||
|
||||
# open path enclosure
|
||||
(?P<quotes>["\'])
|
||||
|
||||
# fetch path
|
||||
(?P<path>.+?)
|
||||
|
||||
# close path enclosure
|
||||
(?P=quotes)
|
||||
|
||||
# (optional) trailing whitespace
|
||||
\s*
|
||||
|
||||
# (optional) media statement(s)
|
||||
(?P<media>[^;]*)
|
||||
|
||||
# (optional) trailing whitespace
|
||||
\s*
|
||||
|
||||
# (optional) closing semi-colon
|
||||
;?
|
||||
|
||||
/ix',
|
||||
);
|
||||
|
||||
// find all relative imports in css
|
||||
$matches = array();
|
||||
foreach ($importRegexes as $importRegex) {
|
||||
if (preg_match_all($importRegex, $content, $regexMatches, PREG_SET_ORDER)) {
|
||||
$matches = array_merge($matches, $regexMatches);
|
||||
}
|
||||
}
|
||||
|
||||
$search = array();
|
||||
$replace = array();
|
||||
|
||||
// loop the matches
|
||||
foreach ($matches as $match) {
|
||||
// get the path for the file that will be imported
|
||||
$importPath = dirname($source).'/'.$match['path'];
|
||||
|
||||
// only replace the import with the content if we can grab the
|
||||
// content of the file
|
||||
if (!$this->canImportByPath($match['path']) || !$this->canImportFile($importPath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if current file was not imported previously in the same
|
||||
// import chain.
|
||||
if (in_array($importPath, $parents)) {
|
||||
throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.');
|
||||
}
|
||||
|
||||
// grab referenced file & minify it (which may include importing
|
||||
// yet other @import statements recursively)
|
||||
$minifier = new self($importPath);
|
||||
$minifier->setMaxImportSize($this->maxImportSize);
|
||||
$minifier->setImportExtensions($this->importExtensions);
|
||||
$importContent = $minifier->execute($source, $parents);
|
||||
|
||||
// check if this is only valid for certain media
|
||||
if (!empty($match['media'])) {
|
||||
$importContent = '@media '.$match['media'].'{'.$importContent.'}';
|
||||
}
|
||||
|
||||
// add to replacement array
|
||||
$search[] = $match[0];
|
||||
$replace[] = $importContent;
|
||||
}
|
||||
|
||||
// replace the import statements
|
||||
return str_replace($search, $replace, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import files into the CSS, base64-ized.
|
||||
*
|
||||
* @url(image.jpg) images will be loaded and their content merged into the
|
||||
* original file, to save HTTP requests.
|
||||
*
|
||||
* @param string $source The file to import files for
|
||||
* @param string $content The CSS content to import files for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function importFiles($source, $content)
|
||||
{
|
||||
$regex = '/url\((["\']?)(.+?)\\1\)/i';
|
||||
if ($this->importExtensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) {
|
||||
$search = array();
|
||||
$replace = array();
|
||||
|
||||
// loop the matches
|
||||
foreach ($matches as $match) {
|
||||
$extension = substr(strrchr($match[2], '.'), 1);
|
||||
if ($extension && !array_key_exists($extension, $this->importExtensions)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// get the path for the file that will be imported
|
||||
$path = $match[2];
|
||||
$path = dirname($source).'/'.$path;
|
||||
|
||||
// only replace the import with the content if we're able to get
|
||||
// the content of the file, and it's relatively small
|
||||
if ($this->canImportFile($path) && $this->canImportBySize($path)) {
|
||||
// grab content && base64-ize
|
||||
$importContent = $this->load($path);
|
||||
$importContent = base64_encode($importContent);
|
||||
|
||||
// build replacement
|
||||
$search[] = $match[0];
|
||||
$replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')';
|
||||
}
|
||||
}
|
||||
|
||||
// replace the import statements
|
||||
$content = str_replace($search, $replace, $content);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify the data.
|
||||
* Perform CSS optimizations.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to
|
||||
* @param string[] $parents Parent paths, for circular reference checks
|
||||
*
|
||||
* @return string The minified data
|
||||
*/
|
||||
public function execute($path = null, $parents = array())
|
||||
{
|
||||
$content = '';
|
||||
|
||||
// loop CSS data (raw data and files)
|
||||
foreach ($this->data as $source => $css) {
|
||||
/*
|
||||
* Let's first take out strings & comments, since we can't just
|
||||
* remove whitespace anywhere. If whitespace occurs inside a string,
|
||||
* we should leave it alone. E.g.:
|
||||
* p { content: "a test" }
|
||||
*/
|
||||
$this->extractStrings();
|
||||
$this->stripComments();
|
||||
$this->extractMath();
|
||||
$this->extractCustomProperties();
|
||||
$css = $this->replace($css);
|
||||
|
||||
$css = $this->stripWhitespace($css);
|
||||
$css = $this->shortenColors($css);
|
||||
$css = $this->shortenZeroes($css);
|
||||
$css = $this->shortenFontWeights($css);
|
||||
$css = $this->stripEmptyTags($css);
|
||||
|
||||
// restore the string we've extracted earlier
|
||||
$css = $this->restoreExtractedData($css);
|
||||
|
||||
$source = is_int($source) ? '' : $source;
|
||||
$parents = $source ? array_merge($parents, array($source)) : $parents;
|
||||
$css = $this->combineImports($source, $css, $parents);
|
||||
$css = $this->importFiles($source, $css);
|
||||
|
||||
/*
|
||||
* If we'll save to a new path, we'll have to fix the relative paths
|
||||
* to be relative no longer to the source file, but to the new path.
|
||||
* If we don't write to a file, fall back to same path so no
|
||||
* conversion happens (because we still want it to go through most
|
||||
* of the move code, which also addresses url() & @import syntax...)
|
||||
*/
|
||||
$converter = $this->getPathConverter($source, $path ?: $source);
|
||||
$css = $this->move($converter, $css);
|
||||
|
||||
// combine css
|
||||
$content .= $css;
|
||||
}
|
||||
|
||||
$content = $this->moveImportsToTop($content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moving a css file should update all relative urls.
|
||||
* Relative references (e.g. ../images/image.gif) in a certain css file,
|
||||
* will have to be updated when a file is being saved at another location
|
||||
* (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper).
|
||||
*
|
||||
* @param ConverterInterface $converter Relative path converter
|
||||
* @param string $content The CSS content to update relative urls for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function move(ConverterInterface $converter, $content)
|
||||
{
|
||||
/*
|
||||
* Relative path references will usually be enclosed by url(). @import
|
||||
* is an exception, where url() is not necessary around the path (but is
|
||||
* allowed).
|
||||
* This *could* be 1 regular expression, where both regular expressions
|
||||
* in this array are on different sides of a |. But we're using named
|
||||
* patterns in both regexes, the same name on both regexes. This is only
|
||||
* possible with a (?J) modifier, but that only works after a fairly
|
||||
* recent PCRE version. That's why I'm doing 2 separate regular
|
||||
* expressions & combining the matches after executing of both.
|
||||
*/
|
||||
$relativeRegexes = array(
|
||||
// url(xxx)
|
||||
'/
|
||||
# open url()
|
||||
url\(
|
||||
|
||||
\s*
|
||||
|
||||
# open path enclosure
|
||||
(?P<quotes>["\'])?
|
||||
|
||||
# fetch path
|
||||
(?P<path>.+?)
|
||||
|
||||
# close path enclosure
|
||||
(?(quotes)(?P=quotes))
|
||||
|
||||
\s*
|
||||
|
||||
# close url()
|
||||
\)
|
||||
|
||||
/ix',
|
||||
|
||||
// @import "xxx"
|
||||
'/
|
||||
# import statement
|
||||
@import
|
||||
|
||||
# whitespace
|
||||
\s+
|
||||
|
||||
# we don\'t have to check for @import url(), because the
|
||||
# condition above will already catch these
|
||||
|
||||
# open path enclosure
|
||||
(?P<quotes>["\'])
|
||||
|
||||
# fetch path
|
||||
(?P<path>.+?)
|
||||
|
||||
# close path enclosure
|
||||
(?P=quotes)
|
||||
|
||||
/ix',
|
||||
);
|
||||
|
||||
// find all relative urls in css
|
||||
$matches = array();
|
||||
foreach ($relativeRegexes as $relativeRegex) {
|
||||
if (preg_match_all($relativeRegex, $content, $regexMatches, PREG_SET_ORDER)) {
|
||||
$matches = array_merge($matches, $regexMatches);
|
||||
}
|
||||
}
|
||||
|
||||
$search = array();
|
||||
$replace = array();
|
||||
|
||||
// loop all urls
|
||||
foreach ($matches as $match) {
|
||||
// determine if it's a url() or an @import match
|
||||
$type = (strpos($match[0], '@import') === 0 ? 'import' : 'url');
|
||||
|
||||
$url = $match['path'];
|
||||
if ($this->canImportByPath($url)) {
|
||||
// attempting to interpret GET-params makes no sense, so let's discard them for awhile
|
||||
$params = strrchr($url, '?');
|
||||
$url = $params ? substr($url, 0, -strlen($params)) : $url;
|
||||
|
||||
// fix relative url
|
||||
$url = $converter->convert($url);
|
||||
|
||||
// now that the path has been converted, re-apply GET-params
|
||||
$url .= $params;
|
||||
}
|
||||
|
||||
/*
|
||||
* Urls with control characters above 0x7e should be quoted.
|
||||
* According to Mozilla's parser, whitespace is only allowed at the
|
||||
* end of unquoted urls.
|
||||
* Urls with `)` (as could happen with data: uris) should also be
|
||||
* quoted to avoid being confused for the url() closing parentheses.
|
||||
* And urls with a # have also been reported to cause issues.
|
||||
* Urls with quotes inside should also remain escaped.
|
||||
*
|
||||
* @see https://developer.mozilla.org/nl/docs/Web/CSS/url#The_url()_functional_notation
|
||||
* @see https://hg.mozilla.org/mozilla-central/rev/14abca4e7378
|
||||
* @see https://github.com/matthiasmullie/minify/issues/193
|
||||
*/
|
||||
$url = trim($url);
|
||||
if (preg_match('/[\s\)\'"#\x{7f}-\x{9f}]/u', $url)) {
|
||||
$url = $match['quotes'] . $url . $match['quotes'];
|
||||
}
|
||||
|
||||
// build replacement
|
||||
$search[] = $match[0];
|
||||
if ($type === 'url') {
|
||||
$replace[] = 'url('.$url.')';
|
||||
} elseif ($type === 'import') {
|
||||
$replace[] = '@import "'.$url.'"';
|
||||
}
|
||||
}
|
||||
|
||||
// replace urls
|
||||
return str_replace($search, $replace, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand hex color codes.
|
||||
* #FF0000 -> #F00.
|
||||
*
|
||||
* @param string $content The CSS content to shorten the hex color codes for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function shortenColors($content)
|
||||
{
|
||||
$content = preg_replace('/(?<=[: ])#([0-9a-z])\\1([0-9a-z])\\2([0-9a-z])\\3(?:([0-9a-z])\\4)?(?=[; }])/i', '#$1$2$3$4', $content);
|
||||
|
||||
// remove alpha channel if it's pointless...
|
||||
$content = preg_replace('/(?<=[: ])#([0-9a-z]{6})ff?(?=[; }])/i', '#$1', $content);
|
||||
$content = preg_replace('/(?<=[: ])#([0-9a-z]{3})f?(?=[; }])/i', '#$1', $content);
|
||||
|
||||
$colors = array(
|
||||
// we can shorten some even more by replacing them with their color name
|
||||
'#F0FFFF' => 'azure',
|
||||
'#F5F5DC' => 'beige',
|
||||
'#A52A2A' => 'brown',
|
||||
'#FF7F50' => 'coral',
|
||||
'#FFD700' => 'gold',
|
||||
'#808080' => 'gray',
|
||||
'#008000' => 'green',
|
||||
'#4B0082' => 'indigo',
|
||||
'#FFFFF0' => 'ivory',
|
||||
'#F0E68C' => 'khaki',
|
||||
'#FAF0E6' => 'linen',
|
||||
'#800000' => 'maroon',
|
||||
'#000080' => 'navy',
|
||||
'#808000' => 'olive',
|
||||
'#CD853F' => 'peru',
|
||||
'#FFC0CB' => 'pink',
|
||||
'#DDA0DD' => 'plum',
|
||||
'#800080' => 'purple',
|
||||
'#F00' => 'red',
|
||||
'#FA8072' => 'salmon',
|
||||
'#A0522D' => 'sienna',
|
||||
'#C0C0C0' => 'silver',
|
||||
'#FFFAFA' => 'snow',
|
||||
'#D2B48C' => 'tan',
|
||||
'#FF6347' => 'tomato',
|
||||
'#EE82EE' => 'violet',
|
||||
'#F5DEB3' => 'wheat',
|
||||
// or the other way around
|
||||
'WHITE' => '#fff',
|
||||
'BLACK' => '#000',
|
||||
);
|
||||
|
||||
return preg_replace_callback(
|
||||
'/(?<=[: ])('.implode('|', array_keys($colors)).')(?=[; }])/i',
|
||||
function ($match) use ($colors) {
|
||||
return $colors[strtoupper($match[0])];
|
||||
},
|
||||
$content
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorten CSS font weights.
|
||||
*
|
||||
* @param string $content The CSS content to shorten the font weights for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function shortenFontWeights($content)
|
||||
{
|
||||
$weights = array(
|
||||
'normal' => 400,
|
||||
'bold' => 700,
|
||||
);
|
||||
|
||||
$callback = function ($match) use ($weights) {
|
||||
return $match[1].$weights[$match[2]];
|
||||
};
|
||||
|
||||
return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand 0 values to plain 0, instead of e.g. -0em.
|
||||
*
|
||||
* @param string $content The CSS content to shorten the zero values for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function shortenZeroes($content)
|
||||
{
|
||||
// we don't want to strip units in `calc()` expressions:
|
||||
// `5px - 0px` is valid, but `5px - 0` is not
|
||||
// `10px * 0` is valid (equates to 0), and so is `10 * 0px`, but
|
||||
// `10 * 0` is invalid
|
||||
// we've extracted calcs earlier, so we don't need to worry about this
|
||||
|
||||
// reusable bits of code throughout these regexes:
|
||||
// before & after are used to make sure we don't match lose unintended
|
||||
// 0-like values (e.g. in #000, or in http://url/1.0)
|
||||
// units can be stripped from 0 values, or used to recognize non 0
|
||||
// values (where wa may be able to strip a .0 suffix)
|
||||
$before = '(?<=[:(, ])';
|
||||
$after = '(?=[ ,);}])';
|
||||
$units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)';
|
||||
|
||||
// strip units after zeroes (0px -> 0)
|
||||
// NOTE: it should be safe to remove all units for a 0 value, but in
|
||||
// practice, Webkit (especially Safari) seems to stumble over at least
|
||||
// 0%, potentially other units as well. Only stripping 'px' for now.
|
||||
// @see https://github.com/matthiasmullie/minify/issues/60
|
||||
$content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content);
|
||||
|
||||
// strip 0-digits (.0 -> 0)
|
||||
$content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content);
|
||||
// strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px
|
||||
$content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content);
|
||||
// strip trailing 0: 50.00 -> 50, 50.00px -> 50px
|
||||
$content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content);
|
||||
// strip leading 0: 0.1 -> .1, 01.1 -> 1.1
|
||||
$content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content);
|
||||
|
||||
// strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0)
|
||||
$content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content);
|
||||
|
||||
// IE doesn't seem to understand a unitless flex-basis value (correct -
|
||||
// it goes against the spec), so let's add it in again (make it `%`,
|
||||
// which is only 1 char: 0%, 0px, 0 anything, it's all just the same)
|
||||
// @see https://developer.mozilla.org/nl/docs/Web/CSS/flex
|
||||
$content = preg_replace('/flex:([0-9]+\s[0-9]+\s)0([;\}])/', 'flex:${1}0%${2}', $content);
|
||||
$content = preg_replace('/flex-basis:0([;\}])/', 'flex-basis:0%${1}', $content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip empty tags from source code.
|
||||
*
|
||||
* @param string $content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function stripEmptyTags($content)
|
||||
{
|
||||
$content = preg_replace('/(?<=^)[^\{\};]+\{\s*\}/', '', $content);
|
||||
$content = preg_replace('/(?<=(\}|;))[^\{\};]+\{\s*\}/', '', $content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip comments from source code.
|
||||
*/
|
||||
protected function stripComments()
|
||||
{
|
||||
// PHP only supports $this inside anonymous functions since 5.4
|
||||
$minifier = $this;
|
||||
$callback = function ($match) use ($minifier) {
|
||||
$count = count($minifier->extracted);
|
||||
$placeholder = '/*'.$count.'*/';
|
||||
$minifier->extracted[$placeholder] = $match[0];
|
||||
|
||||
return $placeholder;
|
||||
};
|
||||
$this->registerPattern('/\n?\/\*(!|.*?@license|.*?@preserve).*?\*\/\n?/s', $callback);
|
||||
|
||||
$this->registerPattern('/\/\*.*?\*\//s', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip whitespace.
|
||||
*
|
||||
* @param string $content The CSS content to strip the whitespace for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function stripWhitespace($content)
|
||||
{
|
||||
// remove leading & trailing whitespace
|
||||
$content = preg_replace('/^\s*/m', '', $content);
|
||||
$content = preg_replace('/\s*$/m', '', $content);
|
||||
|
||||
// replace newlines with a single space
|
||||
$content = preg_replace('/\s+/', ' ', $content);
|
||||
|
||||
// remove whitespace around meta characters
|
||||
// inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex
|
||||
$content = preg_replace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
|
||||
$content = preg_replace('/([\[(:>\+])\s+/', '$1', $content);
|
||||
$content = preg_replace('/\s+([\]\)>\+])/', '$1', $content);
|
||||
$content = preg_replace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
|
||||
|
||||
// whitespace around + and - can only be stripped inside some pseudo-
|
||||
// classes, like `:nth-child(3+2n)`
|
||||
// not in things like `calc(3px + 2px)`, shorthands like `3px -2px`, or
|
||||
// selectors like `div.weird- p`
|
||||
$pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type');
|
||||
$content = preg_replace('/:('.implode('|', $pseudos).')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
|
||||
|
||||
// remove semicolon/whitespace followed by closing bracket
|
||||
$content = str_replace(';}', '}', $content);
|
||||
|
||||
return trim($content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all occurrences of functions that may contain math, where
|
||||
* whitespace around operators needs to be preserved (e.g. calc, clamp)
|
||||
*/
|
||||
protected function extractMath()
|
||||
{
|
||||
$functions = array('calc', 'clamp', 'min', 'max');
|
||||
$pattern = '/\b('. implode('|', $functions) .')(\(.+?)(?=$|;|})/m';
|
||||
|
||||
// PHP only supports $this inside anonymous functions since 5.4
|
||||
$minifier = $this;
|
||||
$callback = function ($match) use ($minifier, $pattern, &$callback) {
|
||||
$function = $match[1];
|
||||
$length = strlen($match[2]);
|
||||
$expr = '';
|
||||
$opened = 0;
|
||||
|
||||
// the regular expression for extracting math has 1 significant problem:
|
||||
// it can't determine the correct closing parenthesis...
|
||||
// instead, it'll match a larger portion of code to where it's certain that
|
||||
// the calc() musts have ended, and we'll figure out which is the correct
|
||||
// closing parenthesis here, by counting how many have opened
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$char = $match[2][$i];
|
||||
$expr .= $char;
|
||||
if ($char === '(') {
|
||||
$opened++;
|
||||
} elseif ($char === ')' && --$opened === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// now that we've figured out where the calc() starts and ends, extract it
|
||||
$count = count($minifier->extracted);
|
||||
$placeholder = 'math('.$count.')';
|
||||
$minifier->extracted[$placeholder] = $function.'('.trim(substr($expr, 1, -1)).')';
|
||||
|
||||
// and since we've captured more code than required, we may have some leftover
|
||||
// calc() in here too - go recursive on the remaining but of code to go figure
|
||||
// that out and extract what is needed
|
||||
$rest = "";
|
||||
$pos = strpos($match[0], $function.$expr);
|
||||
if ($pos !== false) {
|
||||
$rest = substr_replace($match[0], '', $pos, strlen($function.$expr));
|
||||
}
|
||||
$rest = preg_replace_callback($pattern, $callback, $rest);
|
||||
|
||||
return $placeholder.$rest;
|
||||
};
|
||||
|
||||
$this->registerPattern($pattern, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace custom properties, whose values may be used in scenarios where
|
||||
* we wouldn't want them to be minified (e.g. inside calc)
|
||||
*/
|
||||
protected function extractCustomProperties()
|
||||
{
|
||||
// PHP only supports $this inside anonymous functions since 5.4
|
||||
$minifier = $this;
|
||||
$this->registerPattern(
|
||||
'/(?<=^|[;}])(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m',
|
||||
function ($match) use ($minifier) {
|
||||
$placeholder = '--custom-'. count($minifier->extracted) . ':0';
|
||||
$minifier->extracted[$placeholder] = $match[1] .':'. trim($match[2]);
|
||||
return $placeholder;
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if file is small enough to be imported.
|
||||
*
|
||||
* @param string $path The path to the file
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function canImportBySize($path)
|
||||
{
|
||||
return ($size = @filesize($path)) && $size <= $this->maxImportSize * 1024;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if file a file can be imported, going by the path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function canImportByPath($path)
|
||||
{
|
||||
return preg_match('/^(data:|https?:|\\/)/', $path) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a converter to update relative paths to be relative to the new
|
||||
* destination.
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $target
|
||||
*
|
||||
* @return ConverterInterface
|
||||
*/
|
||||
protected function getPathConverter($source, $target)
|
||||
{
|
||||
return new Converter($source, $target);
|
||||
}
|
||||
}
|
||||
20
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exception.php
vendored
Normal file
20
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exception.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Base Exception
|
||||
*
|
||||
* @deprecated Use Exceptions\BasicException instead
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
*/
|
||||
namespace MatthiasMullie\Minify;
|
||||
|
||||
/**
|
||||
* Base Exception Class
|
||||
* @deprecated Use Exceptions\BasicException instead
|
||||
*
|
||||
* @package Minify
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
*/
|
||||
abstract class Exception extends \Exception
|
||||
{
|
||||
}
|
||||
23
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php
vendored
Normal file
23
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Basic exception
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
namespace MatthiasMullie\Minify\Exceptions;
|
||||
|
||||
use MatthiasMullie\Minify\Exception;
|
||||
|
||||
/**
|
||||
* Basic Exception Class
|
||||
*
|
||||
* @package Minify\Exception
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
*/
|
||||
abstract class BasicException extends Exception
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* File Import Exception
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
namespace MatthiasMullie\Minify\Exceptions;
|
||||
|
||||
/**
|
||||
* File Import Exception Class
|
||||
*
|
||||
* @package Minify\Exception
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
*/
|
||||
class FileImportException extends BasicException
|
||||
{
|
||||
}
|
||||
21
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exceptions/IOException.php
vendored
Normal file
21
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exceptions/IOException.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* IO Exception
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
namespace MatthiasMullie\Minify\Exceptions;
|
||||
|
||||
/**
|
||||
* IO Exception Class
|
||||
*
|
||||
* @package Minify\Exception
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
*/
|
||||
class IOException extends BasicException
|
||||
{
|
||||
}
|
||||
622
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/JS.php
vendored
Normal file
622
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/JS.php
vendored
Normal file
File diff suppressed because one or more lines are too long
497
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Minify.php
vendored
Normal file
497
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Minify.php
vendored
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
/**
|
||||
* Abstract minifier class
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
namespace MatthiasMullie\Minify;
|
||||
|
||||
use MatthiasMullie\Minify\Exceptions\IOException;
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
|
||||
/**
|
||||
* Abstract minifier class.
|
||||
*
|
||||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @package Minify
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
abstract class Minify
|
||||
{
|
||||
/**
|
||||
* The data to be minified.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $data = array();
|
||||
|
||||
/**
|
||||
* Array of patterns to match.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $patterns = array();
|
||||
|
||||
/**
|
||||
* This array will hold content of strings and regular expressions that have
|
||||
* been extracted from the JS source code, so we can reliably match "code",
|
||||
* without having to worry about potential "code-like" characters inside.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $extracted = array();
|
||||
|
||||
/**
|
||||
* Init the minify class - optionally, code may be passed along already.
|
||||
*/
|
||||
public function __construct(/* $data = null, ... */)
|
||||
{
|
||||
// it's possible to add the source through the constructor as well ;)
|
||||
if (func_num_args()) {
|
||||
call_user_func_array(array($this, 'add'), func_get_args());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file or straight-up code to be minified.
|
||||
*
|
||||
* @param string|string[] $data
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function add($data /* $data = null, ... */)
|
||||
{
|
||||
// bogus "usage" of parameter $data: scrutinizer warns this variable is
|
||||
// not used (we're using func_get_args instead to support overloading),
|
||||
// but it still needs to be defined because it makes no sense to have
|
||||
// this function without argument :)
|
||||
$args = array($data) + func_get_args();
|
||||
|
||||
// this method can be overloaded
|
||||
foreach ($args as $data) {
|
||||
if (is_array($data)) {
|
||||
call_user_func_array(array($this, 'add'), $data);
|
||||
continue;
|
||||
}
|
||||
|
||||
// redefine var
|
||||
$data = (string) $data;
|
||||
|
||||
// load data
|
||||
$value = $this->load($data);
|
||||
$key = ($data != $value) ? $data : count($this->data);
|
||||
|
||||
// replace CR linefeeds etc.
|
||||
// @see https://github.com/matthiasmullie/minify/pull/139
|
||||
$value = str_replace(array("\r\n", "\r"), "\n", $value);
|
||||
|
||||
// store data
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file to be minified.
|
||||
*
|
||||
* @param string|string[] $data
|
||||
*
|
||||
* @return static
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public function addFile($data /* $data = null, ... */)
|
||||
{
|
||||
// bogus "usage" of parameter $data: scrutinizer warns this variable is
|
||||
// not used (we're using func_get_args instead to support overloading),
|
||||
// but it still needs to be defined because it makes no sense to have
|
||||
// this function without argument :)
|
||||
$args = array($data) + func_get_args();
|
||||
|
||||
// this method can be overloaded
|
||||
foreach ($args as $path) {
|
||||
if (is_array($path)) {
|
||||
call_user_func_array(array($this, 'addFile'), $path);
|
||||
continue;
|
||||
}
|
||||
|
||||
// redefine var
|
||||
$path = (string) $path;
|
||||
|
||||
// check if we can read the file
|
||||
if (!$this->canImportFile($path)) {
|
||||
throw new IOException('The file "'.$path.'" could not be opened for reading. Check if PHP has enough permissions.');
|
||||
}
|
||||
|
||||
$this->add($path);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify the data & (optionally) saves it to a file.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to
|
||||
*
|
||||
* @return string The minified data
|
||||
*/
|
||||
public function minify($path = null)
|
||||
{
|
||||
$content = $this->execute($path);
|
||||
|
||||
// save to path
|
||||
if ($path !== null) {
|
||||
$this->save($content, $path);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify & gzip the data & (optionally) saves it to a file.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to
|
||||
* @param int[optional] $level Compression level, from 0 to 9
|
||||
*
|
||||
* @return string The minified & gzipped data
|
||||
*/
|
||||
public function gzip($path = null, $level = 9)
|
||||
{
|
||||
$content = $this->execute($path);
|
||||
$content = gzencode($content, $level, FORCE_GZIP);
|
||||
|
||||
// save to path
|
||||
if ($path !== null) {
|
||||
$this->save($content, $path);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify the data & write it to a CacheItemInterface object.
|
||||
*
|
||||
* @param CacheItemInterface $item Cache item to write the data to
|
||||
*
|
||||
* @return CacheItemInterface Cache item with the minifier data
|
||||
*/
|
||||
public function cache(CacheItemInterface $item)
|
||||
{
|
||||
$content = $this->execute();
|
||||
$item->set($content);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify the data.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to
|
||||
*
|
||||
* @return string The minified data
|
||||
*/
|
||||
abstract public function execute($path = null);
|
||||
|
||||
/**
|
||||
* Load data.
|
||||
*
|
||||
* @param string $data Either a path to a file or the content itself
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function load($data)
|
||||
{
|
||||
// check if the data is a file
|
||||
if ($this->canImportFile($data)) {
|
||||
$data = file_get_contents($data);
|
||||
|
||||
// strip BOM, if any
|
||||
if (substr($data, 0, 3) == "\xef\xbb\xbf") {
|
||||
$data = substr($data, 3);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save to file.
|
||||
*
|
||||
* @param string $content The minified data
|
||||
* @param string $path The path to save the minified data to
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
protected function save($content, $path)
|
||||
{
|
||||
$handler = $this->openFileForWriting($path);
|
||||
|
||||
$this->writeToFile($handler, $content);
|
||||
|
||||
@fclose($handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a pattern to execute against the source content.
|
||||
*
|
||||
* If $replacement is a string, it must be plain text. Placeholders like $1 or \2 don't work.
|
||||
* If you need that functionality, use a callback instead.
|
||||
*
|
||||
* @param string $pattern PCRE pattern
|
||||
* @param string|callable $replacement Replacement value for matched pattern
|
||||
*/
|
||||
protected function registerPattern($pattern, $replacement = '')
|
||||
{
|
||||
// study the pattern, we'll execute it more than once
|
||||
$pattern .= 'S';
|
||||
|
||||
$this->patterns[] = array($pattern, $replacement);
|
||||
}
|
||||
|
||||
/**
|
||||
* We can't "just" run some regular expressions against JavaScript: it's a
|
||||
* complex language. E.g. having an occurrence of // xyz would be a comment,
|
||||
* unless it's used within a string. Of you could have something that looks
|
||||
* like a 'string', but inside a comment.
|
||||
* The only way to accurately replace these pieces is to traverse the JS one
|
||||
* character at a time and try to find whatever starts first.
|
||||
*
|
||||
* @param string $content The content to replace patterns in
|
||||
*
|
||||
* @return string The (manipulated) content
|
||||
*/
|
||||
protected function replace($content)
|
||||
{
|
||||
$contentLength = strlen($content);
|
||||
$output = '';
|
||||
$processedOffset = 0;
|
||||
$positions = array_fill(0, count($this->patterns), -1);
|
||||
$matches = array();
|
||||
|
||||
while ($processedOffset < $contentLength) {
|
||||
// find first match for all patterns
|
||||
foreach ($this->patterns as $i => $pattern) {
|
||||
list($pattern, $replacement) = $pattern;
|
||||
|
||||
// we can safely ignore patterns for positions we've unset earlier,
|
||||
// because we know these won't show up anymore
|
||||
if (array_key_exists($i, $positions) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// no need to re-run matches that are still in the part of the
|
||||
// content that hasn't been processed
|
||||
if ($positions[$i] >= $processedOffset) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$match = null;
|
||||
if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset)) {
|
||||
$matches[$i] = $match;
|
||||
|
||||
// we'll store the match position as well; that way, we
|
||||
// don't have to redo all preg_matches after changing only
|
||||
// the first (we'll still know where those others are)
|
||||
$positions[$i] = $match[0][1];
|
||||
} else {
|
||||
// if the pattern couldn't be matched, there's no point in
|
||||
// executing it again in later runs on this same content;
|
||||
// ignore this one until we reach end of content
|
||||
unset($matches[$i], $positions[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// no more matches to find: everything's been processed, break out
|
||||
if (!$matches) {
|
||||
// output the remaining content
|
||||
$output .= substr($content, $processedOffset);
|
||||
break;
|
||||
}
|
||||
|
||||
// see which of the patterns actually found the first thing (we'll
|
||||
// only want to execute that one, since we're unsure if what the
|
||||
// other found was not inside what the first found)
|
||||
$matchOffset = min($positions);
|
||||
$firstPattern = array_search($matchOffset, $positions);
|
||||
$match = $matches[$firstPattern];
|
||||
|
||||
// execute the pattern that matches earliest in the content string
|
||||
list(, $replacement) = $this->patterns[$firstPattern];
|
||||
|
||||
// add the part of the input between $processedOffset and the first match;
|
||||
// that content wasn't matched by anything
|
||||
$output .= substr($content, $processedOffset, $matchOffset - $processedOffset);
|
||||
// add the replacement for the match
|
||||
$output .= $this->executeReplacement($replacement, $match);
|
||||
// advance $processedOffset past the match
|
||||
$processedOffset = $matchOffset + strlen($match[0][0]);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* If $replacement is a callback, execute it, passing in the match data.
|
||||
* If it's a string, just pass it through.
|
||||
*
|
||||
* @param string|callable $replacement Replacement value
|
||||
* @param array $match Match data, in PREG_OFFSET_CAPTURE form
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function executeReplacement($replacement, $match)
|
||||
{
|
||||
if (!is_callable($replacement)) {
|
||||
return $replacement;
|
||||
}
|
||||
// convert $match from the PREG_OFFSET_CAPTURE form to the form the callback expects
|
||||
foreach ($match as &$matchItem) {
|
||||
$matchItem = $matchItem[0];
|
||||
}
|
||||
return $replacement($match);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strings are a pattern we need to match, in order to ignore potential
|
||||
* code-like content inside them, but we just want all of the string
|
||||
* content to remain untouched.
|
||||
*
|
||||
* This method will replace all string content with simple STRING#
|
||||
* placeholder text, so we've rid all strings from characters that may be
|
||||
* misinterpreted. Original string content will be saved in $this->extracted
|
||||
* and after doing all other minifying, we can restore the original content
|
||||
* via restoreStrings().
|
||||
*
|
||||
* @param string[optional] $chars
|
||||
* @param string[optional] $placeholderPrefix
|
||||
*/
|
||||
protected function extractStrings($chars = '\'"', $placeholderPrefix = '')
|
||||
{
|
||||
// PHP only supports $this inside anonymous functions since 5.4
|
||||
$minifier = $this;
|
||||
$callback = function ($match) use ($minifier, $placeholderPrefix) {
|
||||
// check the second index here, because the first always contains a quote
|
||||
if ($match[2] === '') {
|
||||
/*
|
||||
* Empty strings need no placeholder; they can't be confused for
|
||||
* anything else anyway.
|
||||
* But we still needed to match them, for the extraction routine
|
||||
* to skip over this particular string.
|
||||
*/
|
||||
return $match[0];
|
||||
}
|
||||
|
||||
$count = count($minifier->extracted);
|
||||
$placeholder = $match[1].$placeholderPrefix.$count.$match[1];
|
||||
$minifier->extracted[$placeholder] = $match[1].$match[2].$match[1];
|
||||
|
||||
return $placeholder;
|
||||
};
|
||||
|
||||
/*
|
||||
* The \\ messiness explained:
|
||||
* * Don't count ' or " as end-of-string if it's escaped (has backslash
|
||||
* in front of it)
|
||||
* * Unless... that backslash itself is escaped (another leading slash),
|
||||
* in which case it's no longer escaping the ' or "
|
||||
* * So there can be either no backslash, or an even number
|
||||
* * multiply all of that times 4, to account for the escaping that has
|
||||
* to be done to pass the backslash into the PHP string without it being
|
||||
* considered as escape-char (times 2) and to get it in the regex,
|
||||
* escaped (times 2)
|
||||
*/
|
||||
$this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will restore all extracted data (strings, regexes) that were
|
||||
* replaced with placeholder text in extract*(). The original content was
|
||||
* saved in $this->extracted.
|
||||
*
|
||||
* @param string $content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function restoreExtractedData($content)
|
||||
{
|
||||
if (!$this->extracted) {
|
||||
// nothing was extracted, nothing to restore
|
||||
return $content;
|
||||
}
|
||||
|
||||
$content = strtr($content, $this->extracted);
|
||||
|
||||
$this->extracted = array();
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the path is a regular file and can be read.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function canImportFile($path)
|
||||
{
|
||||
$parsed = parse_url($path);
|
||||
if (
|
||||
// file is elsewhere
|
||||
isset($parsed['host']) ||
|
||||
// file responds to queries (may change, or need to bypass cache)
|
||||
isset($parsed['query'])
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to open file specified by $path for writing.
|
||||
*
|
||||
* @param string $path The path to the file
|
||||
*
|
||||
* @return resource Specifier for the target file
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
protected function openFileForWriting($path)
|
||||
{
|
||||
if ($path === '' || ($handler = @fopen($path, 'w')) === false) {
|
||||
throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.');
|
||||
}
|
||||
|
||||
return $handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
|
||||
*
|
||||
* @param resource $handler The resource to write to
|
||||
* @param string $content The content to write
|
||||
* @param string $path The path to the file (for exception printing only)
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
protected function writeToFile($handler, $content, $path = '')
|
||||
{
|
||||
if (
|
||||
!is_resource($handler) ||
|
||||
($result = @fwrite($handler, $content)) === false ||
|
||||
($result < strlen($content))
|
||||
) {
|
||||
throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.');
|
||||
}
|
||||
}
|
||||
}
|
||||
16
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/bootstrap.php
vendored
Normal file
16
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/bootstrap.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace {
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
}
|
||||
|
||||
namespace PHPUnit\Framework
|
||||
{
|
||||
// compatibility for when these tests are run with PHPUnit<6.0 (which we
|
||||
// still do because PHPUnit=6.0 stopped supporting a lot of PHP versions)
|
||||
if (!class_exists('PHPUnit\Framework\TestCase')) {
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# http://stackoverflow.com/questions/5917249/git-symlinks-in-windows
|
||||
|
||||
git config --global alias.rm-symlink '!__git_rm_symlink(){
|
||||
git checkout -- "$1"
|
||||
link=$(echo "$1")
|
||||
POS=$'\''/'\''
|
||||
DOS=$'\''\\\\'\''
|
||||
doslink=${link//$POS/$DOS}
|
||||
dest=$(dirname "$link")/$(cat "$link")
|
||||
dosdest=${dest//$POS/$DOS}
|
||||
if [ -f "$dest" ]; then
|
||||
rm -f "$link"
|
||||
cmd //C mklink //H "$doslink" "$dosdest"
|
||||
elif [ -d "$dest" ]; then
|
||||
rm -f "$link"
|
||||
cmd //C mklink //J "$doslink" "$dosdest"
|
||||
else
|
||||
echo "ERROR: Something went wrong when processing $1 . . ."
|
||||
echo " $dest may not actually exist as a valid target."
|
||||
fi
|
||||
}; __git_rm_symlink "$1"'
|
||||
|
||||
git config --global alias.rm-symlinks '!__git_rm_symlinks(){
|
||||
for symlink in $(git ls-files -s | egrep "^120000" | cut -f2); do
|
||||
git rm-symlink "$symlink"
|
||||
git update-index --assume-unchanged "$symlink"
|
||||
done
|
||||
}; __git_rm_symlinks'
|
||||
|
||||
git rm-symlinks
|
||||
1059
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/CSSTest.php
vendored
Normal file
1059
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/CSSTest.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/bom/bom.css
vendored
Normal file
3
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/bom/bom.css
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@import url(import.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import 'import.css';
|
||||
@@ -0,0 +1,2 @@
|
||||
@import url(import.css);
|
||||
@import 'import.css';
|
||||
@@ -0,0 +1,2 @@
|
||||
@import url(import.css) only screen;
|
||||
@import 'import.css' only screen;
|
||||
@@ -0,0 +1,2 @@
|
||||
@import url(import.css);
|
||||
@import 'import.css';
|
||||
@@ -0,0 +1 @@
|
||||
@import url(index6b.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import url(import.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import "/absolute/path/to/stylesheet.css";
|
||||
@@ -0,0 +1 @@
|
||||
@import url(http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900|Droid+Sans:400,700);
|
||||
@@ -0,0 +1 @@
|
||||
@import url(some-file.css?some=param);
|
||||
@@ -0,0 +1 @@
|
||||
@import url( 'http://myurl.de');
|
||||
@@ -0,0 +1,10 @@
|
||||
@font-face {
|
||||
font-family: 'blackcat';
|
||||
src:url('../webfont/blackcat.eot');
|
||||
src:url('../webfont/blackcat.eot?#iefix') format('embedded-opentype'),
|
||||
url('../webfont/blackcat.svg#blackcat') format('svg'),
|
||||
url('../webfont/blackcat.woff') format('woff'),
|
||||
url('../webfont/blackcat.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@import url(../relative.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import url(../target/stylesheet.css);
|
||||
@@ -0,0 +1,3 @@
|
||||
body {
|
||||
background: green;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
@import "file.css";
|
||||
@import url(http://localhost/file.css);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
BIN
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/import_files/file.png
vendored
Normal file
BIN
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/import_files/file.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
@@ -0,0 +1 @@
|
||||
body { background: url(file.png); }
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
@@ -0,0 +1,3 @@
|
||||
.social-btn a[href*="facebook"] { background-image: url(facebook.png) } /* encode skipped */
|
||||
.social-btn a[href*="vimeo"] { background-image: url(vimeo.png) }
|
||||
.social-btn a[href*="instagram"] { background-image: url(instagram.png) }
|
||||
BIN
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/import_files/vimeo.png
vendored
Normal file
BIN
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/import_files/vimeo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
@@ -0,0 +1 @@
|
||||
/* set p color*/
|
||||
@@ -0,0 +1 @@
|
||||
/* import some file */
|
||||
@@ -0,0 +1 @@
|
||||
/* set p color*/
|
||||
@@ -0,0 +1,7 @@
|
||||
/* import some file */
|
||||
@import "import.css";
|
||||
|
||||
/* set body color */
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/* set p color*/
|
||||
p {
|
||||
color: green;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/* import some file */
|
||||
@import "import.css";
|
||||
|
||||
/* set body color */
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
1
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/loop/first.css
vendored
Normal file
1
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/loop/first.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import url(second.css);
|
||||
1
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/loop/second.css
vendored
Normal file
1
wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/tests/css/sample/loop/second.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import url(first.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import url(imports/symlink.css);
|
||||
@@ -0,0 +1 @@
|
||||
@import url(imports_symlink/import.css);
|
||||
@@ -0,0 +1 @@
|
||||
body{background-url:url(assets/symlink.bmp)}
|
||||
@@ -0,0 +1 @@
|
||||
body{background-url:url(assets_symlink/asset.bmp)}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user