AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/wwwroot/mifepriston.org/vendor/tubalmartin/cssmin/tests/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/wwwroot/mifepriston.org/vendor/tubalmartin/cssmin/tests/bin/runner
#!/usr/bin/env php
<?php

require __DIR__ . '/../../vendor/autoload.php';

use tubalmartin\CssMin\Minifier;
use tubalmartin\CssMin\Tests\FineDiff\Render\Cli as CliRenderer;
use cogpowered\FineDiff\Diff;

$opts = getopt(
    't:f:',
    array('keep-sourcemap', 'keep-sourcemap-comment', 'remove-important-comments', 'linebreak-position:')
);

if (empty($opts['t'])) {
    fwrite(
        STDERR,
        'You need to provide -t argument to run the specified test i.e. "php ./tests/bin/runner -t mui"' . PHP_EOL
    );
    die(1);
}

$expectation = $opts['t'];
$fixture = $expectation;

if (!empty($opts['f'])) {
    $fixture = $opts['f'];
}

$fixtureFile = __DIR__ .'/../fixtures/'. $fixture .'.css';
$expectationFile = __DIR__ .'/../expectations/'. $expectation .'.css';

if (!is_readable($fixtureFile) || !is_readable($expectationFile)) {
    fwrite(
        STDERR,
        'Either test fixture or expectation is missing or not readable' . PHP_EOL
    );
    die(1);
}

$minifier = new Minifier;

if (isset($opts['keep-sourcemap']) || isset($opts['keep-sourcemap-comment'])) {
    $minifier->keepSourceMapComment();
}

if (isset($opts['remove-important-comments'])) {
    $minifier->removeImportantComments();
}

if (!empty($opts['linebreak-position'])) {
    $minifier->setLineBreakPosition($opts['linebreak-position']);
}

$fixture = file_get_contents($fixtureFile);
$expectation = file_get_contents($expectationFile);
$output = $minifier->run($fixture);

if (strcmp($output, $expectation) === 0) {
    fwrite(
        STDOUT,
        "\x1b[30m\x1b[42m OK \x1b[0m" . PHP_EOL
    );
    die(0);
} else {
    $diff = new Diff;
    $cliRenderer = new CliRenderer;
    $diffString = $cliRenderer->process($expectation, $diff->getOpcodes($expectation, $output));
    fwrite(
        STDERR,
        "\x1b[37m\x1b[41m FAILURE \x1b[0m" . PHP_EOL .
        '---' . PHP_EOL .
        $diffString . PHP_EOL .
        '---' . PHP_EOL
    );
    die(1);
}

Anon7 - 2022
AnonSec Team