This commit is contained in:
Olusesan Ameye
2022-10-02 00:26:03 +00:00
parent f8b7061089
commit b4604e02b5
17 changed files with 69 additions and 44 deletions
+2
View File
@@ -18,3 +18,5 @@
[Mon Sep 19 16:43:39.019361 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully [Mon Sep 19 16:43:39.019361 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 19 16:43:42.408390 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.30 configured -- resuming normal operations [Mon Sep 19 16:43:42.408390 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.30 configured -- resuming normal operations
[Mon Sep 19 16:43:42.412232 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' [Mon Sep 19 16:43:42.412232 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sun Oct 02 00:02:19.402632 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.52 (Debian) PHP/7.4.28 configured -- resuming normal operations
[Sun Oct 02 00:02:19.409774 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
+9
View File
@@ -1750,3 +1750,12 @@ www.chiefsoft.net:80 172.26.0.1 - - [21/Sep/2022:11:02:00 +0000] "-" 408 0 "-" "
www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:00:43:49 +0000] "GET / HTTP/1.1" 200 5736 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:00:43:49 +0000] "GET / HTTP/1.1" 200 5736 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:00:44:41 +0000] "-" 408 0 "-" "-" www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:00:44:41 +0000] "-" 408 0 "-" "-"
www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:22:53:06 +0000] "-" 408 0 "-" "-" www.chiefsoft.net:80 172.26.0.1 - - [22/Sep/2022:22:53:06 +0000] "-" 408 0 "-" "-"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:04:18 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:04:19 +0000] "GET /favicon.ico HTTP/1.1" 200 5732 "http://10.10.10.100:7072/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:09:46 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:10:30 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:19:15 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:19:16 +0000] "GET /favicon.ico HTTP/1.1" 304 250 "http://10.10.10.100:7072/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:21:43 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:21:46 +0000] "GET / HTTP/1.1" 500 3752 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
www.chiefsoft.net:80 10.10.33.13 - - [02/Oct/2022:00:22:37 +0000] "-" 408 0 "-" "-"
+2
View File
@@ -49,5 +49,7 @@ ARG uid=1000
RUN useradd -G www-data,root -u $uid -d /home/devuser devuser RUN useradd -G www-data,root -u $uid -d /home/devuser devuser
RUN mkdir -p /home/devuser/.composer && \ RUN mkdir -p /home/devuser/.composer && \
chown -R devuser:devuser /home/devuser chown -R devuser:devuser /home/devuser
RUN cd /var/www/html && composer install
RUN chmod -R a+w /var/www/writable
EXPOSE 80 EXPOSE 80
+10 -20
View File
@@ -6,10 +6,8 @@ namespace Laminas\Escaper;
use function bin2hex; use function bin2hex;
use function ctype_digit; use function ctype_digit;
use function function_exists;
use function hexdec; use function hexdec;
use function htmlspecialchars; use function htmlspecialchars;
use function iconv;
use function in_array; use function in_array;
use function mb_convert_encoding; use function mb_convert_encoding;
use function ord; use function ord;
@@ -38,7 +36,7 @@ class Escaper
* entities that XML supports. Using HTML entities would result in this error: * entities that XML supports. Using HTML entities would result in this error:
* XML Parsing Error: undefined entity * XML Parsing Error: undefined entity
* *
* @var array * @var array<int, string>
*/ */
protected static $htmlNamedEntityMap = [ protected static $htmlNamedEntityMap = [
34 => 'quot', // quotation mark 34 => 'quot', // quotation mark
@@ -67,6 +65,7 @@ class Escaper
* Static Matcher which escapes characters for HTML Attribute contexts * Static Matcher which escapes characters for HTML Attribute contexts
* *
* @var callable * @var callable
* @psalm-var callable(array<array-key, string>):string
*/ */
protected $htmlAttrMatcher; protected $htmlAttrMatcher;
@@ -74,6 +73,7 @@ class Escaper
* Static Matcher which escapes characters for Javascript contexts * Static Matcher which escapes characters for Javascript contexts
* *
* @var callable * @var callable
* @psalm-var callable(array<array-key, string>):string
*/ */
protected $jsMatcher; protected $jsMatcher;
@@ -81,6 +81,7 @@ class Escaper
* Static Matcher which escapes characters for CSS Attribute contexts * Static Matcher which escapes characters for CSS Attribute contexts
* *
* @var callable * @var callable
* @psalm-var callable(array<array-key, string>):string
*/ */
protected $cssMatcher; protected $cssMatcher;
@@ -255,7 +256,7 @@ class Escaper
* Callback function for preg_replace_callback that applies HTML Attribute * Callback function for preg_replace_callback that applies HTML Attribute
* escaping to all matches. * escaping to all matches.
* *
* @param array $matches * @param array<array-key, string> $matches
* @return string * @return string
*/ */
protected function htmlAttrMatcher($matches) protected function htmlAttrMatcher($matches)
@@ -302,7 +303,7 @@ class Escaper
* Callback function for preg_replace_callback that applies Javascript * Callback function for preg_replace_callback that applies Javascript
* escaping to all matches. * escaping to all matches.
* *
* @param array $matches * @param array<array-key, string> $matches
* @return string * @return string
*/ */
protected function jsMatcher($matches) protected function jsMatcher($matches)
@@ -325,7 +326,7 @@ class Escaper
* Callback function for preg_replace_callback that applies CSS * Callback function for preg_replace_callback that applies CSS
* escaping to all matches. * escaping to all matches.
* *
* @param array $matches * @param array<array-key, string> $matches
* @return string * @return string
*/ */
protected function cssMatcher($matches) protected function cssMatcher($matches)
@@ -391,32 +392,21 @@ class Escaper
} }
/** /**
* Encoding conversion helper which wraps iconv and mbstring where they exist or throws * Encoding conversion helper which wraps mb_convert_encoding
* and exception where neither is available.
* *
* @param string $string * @param string $string
* @param string $to * @param string $to
* @param array|string $from * @param array|string $from
* @throws Exception\RuntimeException
* @return string * @return string
*/ */
protected function convertEncoding($string, $to, $from) protected function convertEncoding($string, $to, $from)
{ {
if (function_exists('iconv')) { $result = mb_convert_encoding($string, $to, $from);
$result = iconv($from, $to, $string);
} elseif (function_exists('mb_convert_encoding')) {
$result = mb_convert_encoding($string, $to, $from);
} else {
throw new Exception\RuntimeException(
static::class
. ' requires either the iconv or mbstring extension to be installed'
. ' when escaping for non UTF-8 strings.'
);
}
if ($result === false) { if ($result === false) {
return ''; // return non-fatal blank string on encoding errors from users return ''; // return non-fatal blank string on encoding errors from users
} }
return $result; return $result;
} }
} }
+5 -4
View File
@@ -150,6 +150,7 @@ class Kint
'Kint\\Parser\\ClosurePlugin', 'Kint\\Parser\\ClosurePlugin',
'Kint\\Parser\\ColorPlugin', 'Kint\\Parser\\ColorPlugin',
'Kint\\Parser\\DateTimePlugin', 'Kint\\Parser\\DateTimePlugin',
'Kint\\Parser\\EnumPlugin',
'Kint\\Parser\\FsPathPlugin', 'Kint\\Parser\\FsPathPlugin',
'Kint\\Parser\\IteratorPlugin', 'Kint\\Parser\\IteratorPlugin',
'Kint\\Parser\\JsonPlugin', 'Kint\\Parser\\JsonPlugin',
@@ -548,9 +549,11 @@ class Kint
* *
* Functionally equivalent to Kint::dump(1) or Kint::dump(debug_backtrace()) * Functionally equivalent to Kint::dump(1) or Kint::dump(debug_backtrace())
* *
* @param mixed ...$args
*
* @return int|string * @return int|string
*/ */
public static function dump() public static function dump(...$args)
{ {
if (false === static::$enabled_mode) { if (false === static::$enabled_mode) {
return 0; return 0;
@@ -558,8 +561,6 @@ class Kint
Utils::normalizeAliases(static::$aliases); Utils::normalizeAliases(static::$aliases);
$args = \func_get_args();
$call_info = static::getCallInfo(static::$aliases, \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), \count($args)); $call_info = static::getCallInfo(static::$aliases, \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), \count($args));
$statics = static::getStatics(); $statics = static::getStatics();
@@ -587,7 +588,7 @@ class Kint
isset($call_info['params']) ? $call_info['params'] : [], isset($call_info['params']) ? $call_info['params'] : [],
\count($args) \count($args)
); );
$output = $kintstance->dumpAll($args, $bases); $output = $kintstance->dumpAll(\array_values($args), $bases);
if (static::$return || \in_array('@', $call_info['modifiers'], true)) { if (static::$return || \in_array('@', $call_info['modifiers'], true)) {
return $output; return $output;
+6
View File
@@ -30,6 +30,7 @@ use Kint\Zval\Representation\Representation;
use Kint\Zval\Value; use Kint\Zval\Value;
use ReflectionClass; use ReflectionClass;
use ReflectionProperty; use ReflectionProperty;
use UnitEnum;
class ClassStaticsPlugin extends Plugin class ClassStaticsPlugin extends Plugin
{ {
@@ -56,6 +57,11 @@ class ClassStaticsPlugin extends Plugin
$consts = []; $consts = [];
foreach ($reflection->getConstants() as $name => $val) { foreach ($reflection->getConstants() as $name => $val) {
// Skip enum constants
if ($var instanceof UnitEnum && $val instanceof UnitEnum && $o->classname == \get_class($val)) {
continue;
}
$const = Value::blank($name, '\\'.$class.'::'.$name); $const = Value::blank($name, '\\'.$class.'::'.$name);
$const->const = true; $const->const = true;
$const->depth = $o->depth + 1; $const->depth = $o->depth + 1;
+11 -2
View File
@@ -34,6 +34,7 @@ use Kint\Zval\ResourceValue;
use Kint\Zval\Value; use Kint\Zval\Value;
use ReflectionObject; use ReflectionObject;
use stdClass; use stdClass;
use TypeError;
class Parser class Parser
{ {
@@ -191,6 +192,10 @@ class Parser
public function childHasPath(InstanceValue $parent, Value $child) public function childHasPath(InstanceValue $parent, Value $child)
{ {
if ('__PHP_Incomplete_Class' === $parent->classname) {
return false;
}
if ('object' === $parent->type && (null !== $parent->access_path || $child->static || $child->const)) { if ('object' === $parent->type && (null !== $parent->access_path || $child->static || $child->const)) {
if (Value::ACCESS_PUBLIC === $child->access) { if (Value::ACCESS_PUBLIC === $child->access) {
return true; return true;
@@ -434,7 +439,7 @@ class Parser
$rep = new Representation('Properties'); $rep = new Representation('Properties');
if (KINT_PHP74) { if (KINT_PHP74 && '__PHP_Incomplete_Class' != $object->classname) {
$rprops = $reflector->getProperties(); $rprops = $reflector->getProperties();
foreach ($rprops as $rprop) { foreach ($rprops as $rprop) {
@@ -524,7 +529,11 @@ class Parser
} }
$stash = $val; $stash = $val;
$copy[$i] = $refmarker; try {
$copy[$i] = $refmarker;
} catch (TypeError $e) {
$child->reference = true;
}
if ($val === $refmarker) { if ($val === $refmarker) {
$child->reference = true; $child->reference = true;
$val = $stash; $val = $stash;
+4
View File
@@ -52,6 +52,10 @@ class TimestampPlugin extends Plugin
return; return;
} }
if ($var < 0) {
return;
}
if (\in_array($var, self::$blacklist, true)) { if (\in_array($var, self::$blacklist, true)) {
return; return;
} }
+1 -1
View File
@@ -32,7 +32,7 @@ use Throwable;
class CliRenderer extends TextRenderer class CliRenderer extends TextRenderer
{ {
/** /**
* @var bool enable colors when Kint is run in *UNIX* command line * @var bool enable colors
*/ */
public static $cli_colors = true; public static $cli_colors = true;
+2
View File
@@ -42,6 +42,7 @@ class TextRenderer extends Renderer
'microtime' => 'Kint\\Renderer\\Text\\MicrotimePlugin', 'microtime' => 'Kint\\Renderer\\Text\\MicrotimePlugin',
'recursion' => 'Kint\\Renderer\\Text\\RecursionPlugin', 'recursion' => 'Kint\\Renderer\\Text\\RecursionPlugin',
'trace' => 'Kint\\Renderer\\Text\\TracePlugin', 'trace' => 'Kint\\Renderer\\Text\\TracePlugin',
'enum' => 'Kint\\Renderer\\Text\\EnumPlugin',
]; ];
/** /**
@@ -55,6 +56,7 @@ class TextRenderer extends Renderer
'Kint\\Parser\\MicrotimePlugin', 'Kint\\Parser\\MicrotimePlugin',
'Kint\\Parser\\StreamPlugin', 'Kint\\Parser\\StreamPlugin',
'Kint\\Parser\\TracePlugin', 'Kint\\Parser\\TracePlugin',
'Kint\\Parser\\EnumPlugin',
]; ];
/** /**
+4
View File
@@ -109,6 +109,10 @@ final class Utils
if (\file_exists($installed) && \is_readable($installed)) { if (\file_exists($installed) && \is_readable($installed)) {
$packages = \json_decode(\file_get_contents($installed), true); $packages = \json_decode(\file_get_contents($installed), true);
if (!\is_array($packages)) {
continue;
}
foreach ($packages as $package) { foreach ($packages as $package) {
if (isset($package['extra'][$key]) && \is_array($package['extra'][$key])) { if (isset($package['extra'][$key]) && \is_array($package['extra'][$key])) {
$extras = \array_replace($extras, $package['extra'][$key]); $extras = \array_replace($extras, $package['extra'][$key]);
+8 -12
View File
@@ -30,13 +30,13 @@ if (!\function_exists('d')) {
/** /**
* Alias of Kint::dump(). * Alias of Kint::dump().
* *
* @param mixed ...$args
*
* @return int|string * @return int|string
*/ */
function d() function d(...$args)
{ {
$args = \func_get_args(); return Kint::dump(...$args);
return \call_user_func_array(['Kint', 'dump'], $args);
} }
Kint::$aliases[] = 'd'; Kint::$aliases[] = 'd';
@@ -49,16 +49,13 @@ if (!\function_exists('s')) {
* Alias of Kint::dump(), however the output is in plain htmlescaped text * Alias of Kint::dump(), however the output is in plain htmlescaped text
* with some minor visibility enhancements added. * with some minor visibility enhancements added.
* *
* If run in CLI mode, output is not escaped. * If run in CLI colors are disabled
* *
* To force rendering mode without autodetecting anything: * @param mixed ...$args
*
* Kint::$enabled_mode = Kint::MODE_PLAIN;
* Kint::dump( $variable );
* *
* @return int|string * @return int|string
*/ */
function s() function s(...$args)
{ {
if (false === Kint::$enabled_mode) { if (false === Kint::$enabled_mode) {
return 0; return 0;
@@ -77,8 +74,7 @@ if (!\function_exists('s')) {
CliRenderer::$cli_colors = false; CliRenderer::$cli_colors = false;
$args = \func_get_args(); $out = Kint::dump(...$args);
$out = \call_user_func_array(['Kint', 'dump'], $args);
Kint::$enabled_mode = $kstash; Kint::$enabled_mode = $kstash;
CliRenderer::$cli_colors = $cstash; CliRenderer::$cli_colors = $cstash;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long