403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/d2m/sofident_cz/wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/d2m/sofident_cz/wp-content/plugins/wp-optimize/vendor/marcusschwarz/lesserphp/tests/sort.php
<?php
error_reporting(E_ALL);

require realpath(dirname(__FILE__)).'/../lessc.inc.php';

// sorts the selectors in stylesheet in order to normalize it for comparison

$exe = array_shift($argv); // remove filename

if (!$fname = array_shift($argv)) {
	$fname = "php://stdin";
}

class lesscNormalized extends lessc {
	public $numberPrecision = 3;

	public function compileValue($value) {
		if ($value[0] == "raw_color") {
			$value = $this->coerceColor($value);
		}

		return parent::compileValue($value);
	}
}

class SortingFormatter extends lessc_formatter_lessjs {
	function sortKey($block) {
		if (!isset($block->sortKey)) {
			sort($block->selectors, SORT_STRING);
			$block->sortKey = implode(",", $block->selectors);
		}

		return $block->sortKey;
	}

	function sortBlock($block) {
		usort($block->children, function($a, $b) {
			$sort = strcmp($this->sortKey($a), $this->sortKey($b));
			if ($sort == 0) {
				// TODO
			}
			return $sort;
		});

	}

	function block($block) {
		$this->sortBlock($block);
		return parent::block($block);
	}

}

$less = new lesscNormalized();
$less->setFormatter(new SortingFormatter);
echo $less->parse(file_get_contents($fname));


Youez - 2016 - github.com/yon3zu
LinuXploit