Skip to content

Commit

Permalink
Update klogger to be compatible with PHP 8.1
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
bvdputte committed Aug 8, 2022
1 parent bb0497f commit 942827b
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 59 deletions.
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"description": "Logging utility for Kirby 3 - based on katzgrau/KLogger",
"license": "MIT",
"type": "kirby-plugin",
"version": "2.1.0",
"version": "2.2.0",
"authors": [
{
"name": "Bart Vandeputte",
"email": "[email protected]"
"email": "[email protected]"
}
],
"require": {
Expand All @@ -22,6 +22,9 @@
},
"config": {
"optimize-autoloader": true,
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"getkirby/composer-installer": true
}
}
}
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit9dfc62fa15f5312aa86488031097cc96::getLoader();
2 changes: 1 addition & 1 deletion vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4()

/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
* @psalm-return array<string, string>
*/
public function getClassMap()
{
Expand Down
16 changes: 9 additions & 7 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;

Expand All @@ -37,7 +39,7 @@ class InstalledVersions

/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();

Expand Down Expand Up @@ -241,7 +243,7 @@ public static function getInstallPath($packageName)

/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
Expand All @@ -255,7 +257,7 @@ public static function getRootPackage()
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
Expand All @@ -278,7 +280,7 @@ public static function getRawData()
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
Expand All @@ -301,7 +303,7 @@ public static function getAllRawData()
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
Expand All @@ -311,7 +313,7 @@ public static function reload($data)

/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_namespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
Expand Down
25 changes: 3 additions & 22 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,11 @@ public static function getLoader()
require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit9dfc62fa15f5312aa86488031097cc96', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit9dfc62fa15f5312aa86488031097cc96', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit9dfc62fa15f5312aa86488031097cc96::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}

$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}

$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit9dfc62fa15f5312aa86488031097cc96::getInitializer($loader));

$loader->register(true);

Expand Down
26 changes: 13 additions & 13 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
<?php return array(
'root' => array(
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'name' => 'bvdputte/kirby-log',
'pretty_version' => '2.1.0',
'version' => '2.1.0.0',
'reference' => NULL,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'name' => 'bvdputte/kirby-log',
'dev' => true,
),
'versions' => array(
'bvdputte/kirby-log' => array(
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'pretty_version' => '2.1.0',
'version' => '2.1.0.0',
'reference' => NULL,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'dev_requirement' => false,
),
'getkirby/composer-installer' => array(
'pretty_version' => '1.2.1',
'version' => '1.2.1.0',
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/../getkirby/composer-installer',
'aliases' => array(),
'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d',
'dev_requirement' => false,
),
'katzgrau/klogger' => array(
'pretty_version' => '1.2.1',
'version' => '1.2.1.0',
'pretty_version' => '1.2.2',
'version' => '1.2.2.0',
'reference' => '36481c69db9305169a2ceadead25c2acaabd567c',
'type' => 'library',
'install_path' => __DIR__ . '/../katzgrau/klogger',
'aliases' => array(),
'reference' => 'a4ed373fa8a214aa4ae7aa4f221fe2c6ce862ef1',
'dev_requirement' => false,
),
'psr/log' => array(
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'dev_requirement' => false,
),
'studio24/rotate' => array(
'pretty_version' => 'v1.0.1',
'version' => '1.0.1.0',
'reference' => '9d99d364bcf619bd9dd48f09ccf292f077c492e8',
'type' => 'library',
'install_path' => __DIR__ . '/../studio24/rotate',
'aliases' => array(),
'reference' => '9d99d364bcf619bd9dd48f09ccf292f077c492e8',
'dev_requirement' => false,
),
),
Expand Down
1 change: 1 addition & 0 deletions vendor/katzgrau/klogger/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Special thanks to all contributors:
* [Tim Kinnane](http://twitter.com/etherealtim)
* [Onno Vos](https://github.com/onno-vos-dev)
* [Cameron Will](https://github.com/cwill747)
* [Kamil Wylegała](https://github.com/kamilwylegala)

## License

Expand Down
2 changes: 1 addition & 1 deletion vendor/katzgrau/klogger/src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private function getTimestamp()
{
$originalTime = microtime(true);
$micro = sprintf("%06d", ($originalTime - floor($originalTime)) * 1000000);
$date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));
$date = new DateTime(date('Y-m-d H:i:s.'.$micro, (int)$originalTime));

return $date->format($this->options['dateFormat']);
}
Expand Down

0 comments on commit 942827b

Please sign in to comment.