1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-29 16:49:47 +02:00

Apply php-cs-fixer new rules

This commit is contained in:
Elan Ruusamäe
2019-12-11 17:00:16 +02:00
parent f9d3d54e62
commit eff278193b
88 changed files with 1225 additions and 1213 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php
$app = (require __DIR__ . '/../bootstrap.php');
/* @var \Minify\App $app */
@@ -7,15 +7,15 @@ $config = $app->config;
// recommend $min_symlinks setting for Apache UserDir
$symlinkOption = '';
if (0 === strpos($app->env->server("SERVER_SOFTWARE"), 'Apache/')
if (strpos($app->env->server('SERVER_SOFTWARE'), 'Apache/') === 0
&& preg_match('@^/\\~(\\w+)/@', $app->env->server('REQUEST_URI'), $m)
) {
$userDir = DIRECTORY_SEPARATOR . $m[1] . DIRECTORY_SEPARATOR;
if (false !== strpos(__FILE__, $userDir)) {
if (strpos(__FILE__, $userDir) !== false) {
$sm = array();
$sm["//~{$m[1]}"] = dirname(__DIR__);
$array = str_replace('array (', 'array(', var_export($sm, 1));
$symlinkOption = "\$min_symlinks = $array;";
$symlinkOption = "\$min_symlinks = ${array};";
}
}
@@ -28,8 +28,8 @@ if ($config->builderPassword && $config->builderPassword !== '') {
$auth = new Intervention\Httpauth\Httpauth(array(
'username' => 'admin',
'password' => $config->builderPassword,
'type' => 'digest',
'realm' => 'Minify Builder',
'type' => 'digest',
'realm' => 'Minify Builder',
));
$auth->secure();
}
@@ -60,13 +60,13 @@ b {color:#c00}
#jsDidntLoad {display:none;}
</style>
<body>
<?php if ($symlinkOption): ?>
<?php if ($symlinkOption) { ?>
<div class=topNote><strong>Note:</strong> It looks like you're running Minify in a user
directory. You may need the following option in /min/config.php to have URIs
correctly rewritten in CSS output:
<br><textarea id=symlinkOpt rows=3 cols=80 readonly><?php echo htmlspecialchars($symlinkOption); ?></textarea>
</div>
<?php endif; ?>
<?php } ?>
<p class=topWarning id=jsDidntLoad><strong>Uh Oh.</strong> Minify was unable to
serve Javascript for this app. To troubleshoot this,
@@ -209,8 +209,8 @@ $content = ob_get_clean();
$controller = new Minify_Controller_Page($app->env, $app->sourceFactory);
$minify = $app->minify->serve($controller, array(
'content' => $content,
'id' => __FILE__,
'content' => $content,
'id' => __FILE__,
'lastModifiedTime' => max(
// regenerate cache if any of these change
filemtime(__FILE__),

View File

@@ -1,15 +1,12 @@
<?php
/**
* AJAX checks for zlib.output_compression
*
* @package Minify
*/
$app = (require __DIR__ . '/../bootstrap.php');
/* @var \Minify\App $app */
$_oc = ini_get('zlib.output_compression');
// allow access only if builder is enabled
if (!$app->config->enableBuilder) {
header('Location: /');
@@ -18,20 +15,19 @@ if (!$app->config->enableBuilder) {
if ($app->env->get('hello')) {
// echo 'World!'
// try to prevent double encoding (may not have an effect)
ini_set('zlib.output_compression', '0');
HTTP_Encoder::$encodeToIe6 = true; // just in case
HTTP_Encoder::$encodeToIe6 = true; // just in case
$he = new HTTP_Encoder(array(
'content' => str_repeat('0123456789', 500),
'method' => 'deflate',
'method' => 'deflate',
));
$he->encode();
$he->sendAll();
} else {
// echo status "0" or "1"
header('Content-Type: text/plain');
echo (int)$_oc;
echo (int) $_oc;
}

View File

@@ -37,7 +37,7 @@ if (isset($_GET['oc'])) {
echo "<p class=topNote><strong>\$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] is set.</strong> "
. "You may need to set \$min_documentRoot to this in config.php</p>";
}
}
//*/
//*/