mirror of
https://github.com/mrclay/minify.git
synced 2025-08-20 12:51:52 +02:00
add checkAllowDirs to sourceFactoryOptions
needed to be able to specify the option via config
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
namespace Minify;
|
namespace Minify;
|
||||||
|
|
||||||
use Props\Container;
|
use Props\Container;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property \Minify_CacheInterface $cache
|
* @property \Minify_CacheInterface $cache
|
||||||
@@ -104,12 +103,14 @@ class App extends Container {
|
|||||||
if (empty($config->documentRoot)) {
|
if (empty($config->documentRoot)) {
|
||||||
return $app->env->getDocRoot();
|
return $app->env->getDocRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app->env->normalizePath($config->documentRoot);
|
return $app->env->normalizePath($config->documentRoot);
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->env = function (App $app) {
|
$this->env = function (App $app) {
|
||||||
$config = $app->config;
|
$config = $app->config;
|
||||||
$envArgs = empty($config->envArgs) ? array() : $config->envArgs;
|
$envArgs = empty($config->envArgs) ? array() : $config->envArgs;
|
||||||
|
|
||||||
return new \Minify_Env($envArgs);
|
return new \Minify_Env($envArgs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -117,6 +118,7 @@ class App extends Container {
|
|||||||
$format = "%channel%.%level_name%: %message% %context% %extra%";
|
$format = "%channel%.%level_name%: %message% %context% %extra%";
|
||||||
$handler = new \Monolog\Handler\ErrorLogHandler();
|
$handler = new \Monolog\Handler\ErrorLogHandler();
|
||||||
$handler->setFormatter(new \Monolog\Formatter\LineFormatter($format));
|
$handler->setFormatter(new \Monolog\Formatter\LineFormatter($format));
|
||||||
|
|
||||||
return $handler;
|
return $handler;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,11 +144,13 @@ class App extends Container {
|
|||||||
if ($value === true || $value instanceof \FirePHP) {
|
if ($value === true || $value instanceof \FirePHP) {
|
||||||
$logger->pushHandler($app->errorLogHandler);
|
$logger->pushHandler($app->errorLogHandler);
|
||||||
$logger->pushHandler(new \Monolog\Handler\FirePHPHandler());
|
$logger->pushHandler(new \Monolog\Handler\FirePHPHandler());
|
||||||
|
|
||||||
return $logger;
|
return $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value instanceof \Monolog\Handler\HandlerInterface) {
|
if ($value instanceof \Monolog\Handler\HandlerInterface) {
|
||||||
$logger->pushHandler($value);
|
$logger->pushHandler($value);
|
||||||
|
|
||||||
return $logger;
|
return $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,6 +158,7 @@ class App extends Container {
|
|||||||
if (is_object($value) && is_callable(array($value, 'log'))) {
|
if (is_object($value) && is_callable(array($value, 'log'))) {
|
||||||
$handler = new \Minify\Logger\LegacyHandler($value);
|
$handler = new \Minify\Logger\LegacyHandler($value);
|
||||||
$logger->pushHandler($handler);
|
$logger->pushHandler($handler);
|
||||||
|
|
||||||
return $logger;
|
return $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,6 +237,10 @@ class App extends Container {
|
|||||||
$ret['allowDirs'] = $serveOptions['minApp']['allowDirs'];
|
$ret['allowDirs'] = $serveOptions['minApp']['allowDirs'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($serveOptions['checkAllowDirs'])) {
|
||||||
|
$ret['checkAllowDirs'] = $serveOptions['checkAllowDirs'];
|
||||||
|
}
|
||||||
|
|
||||||
if (is_numeric($app->config->uploaderHoursBehind)) {
|
if (is_numeric($app->config->uploaderHoursBehind)) {
|
||||||
$ret['uploaderHoursBehind'] = $app->config->uploaderHoursBehind;
|
$ret['uploaderHoursBehind'] = $app->config->uploaderHoursBehind;
|
||||||
}
|
}
|
||||||
@@ -258,6 +267,7 @@ class App extends Container {
|
|||||||
*/
|
*/
|
||||||
private function typeOf($var) {
|
private function typeOf($var) {
|
||||||
$type = gettype($var);
|
$type = gettype($var);
|
||||||
|
|
||||||
return $type === 'object' ? get_class($var) : $type;
|
return $type === 'object' ? get_class($var) : $type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user