Skip to content

Commit

Permalink
Merge pull request #2506 from ibrahim-kardi/ibrahim
Browse files Browse the repository at this point in the history
Tested latest compatibility with php8, WordPress 6.2.2 & copyright text and year updated
  • Loading branch information
kawshar authored Jun 6, 2023
2 parents 21ec5af + 130353f commit a9d7f45
Show file tree
Hide file tree
Showing 128 changed files with 251 additions and 494 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at aristath@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@themeum.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Ari Stathopoulos (@aristath)
Copyright (c) 2023 Themeum

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
**Contributors:** [davidvongries](https://profiles.wordpress.org/davidvongries), [aristath](https://profiles.wordpress.org/aristath), [dannycooper](https://profiles.wordpress.org/dannycooper), [wplemon](https://profiles.wordpress.org/wplemon), [igmoweb](https://profiles.wordpress.org/igmoweb)
**Tags:** customizer, options framework, theme, mods, toolkit, gutenberg
**Requires at least:** 5.2
**Tested up to:** 6
**Stable tag:** 4.1.1
**Tested up to:** 6.2.2
**Stable tag:** 4.2.0
**License:** MIT
**License URI:** https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kirki-framework/kirki",
"type": "library",
"version": "4.1.1",
"version": "4.2.0",
"keywords": [
"WordPress",
"Customizer"
Expand Down
4 changes: 2 additions & 2 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @package Kirki
* @category Core
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @author Themeum
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
* @since 3.0.12
*/
Expand Down
40 changes: 26 additions & 14 deletions kirki-composer/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
class ClassLoader
{
/** @var \Closure(string):void */
private $includeFile;
private static $includeFile;

/** @var ?string */
private $vendorDir;
Expand Down Expand Up @@ -109,18 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;

/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
$this->includeFile = static function($file) {
include $file;
};
self::initializeIncludeClosure();
}

/**
Expand Down Expand Up @@ -440,7 +429,8 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
($this->includeFile)($file);
$includeFile = self::$includeFile;
$includeFile($file);

return true;
}
Expand Down Expand Up @@ -570,4 +560,26 @@ private function findFileWithExtension($class, $ext)

return false;
}

/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}

/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}
17 changes: 12 additions & 5 deletions kirki-composer/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}

Expand All @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));

return $provided->matches($constraint);
Expand Down Expand Up @@ -328,7 +328,9 @@ private static function getInstalled()
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
/** @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[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
Expand All @@ -340,12 +342,17 @@ private static function getInstalled()
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
/** @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[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;

if (self::$installed !== array()) {
$installed[] = self::$installed;
}

return $installed;
}
Expand Down
8 changes: 4 additions & 4 deletions kirki-composer/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'kirki-framework/kirki',
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'pretty_version' => '4.2.0',
'version' => '4.2.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
Expand All @@ -29,8 +29,8 @@
'dev_requirement' => true,
),
'kirki-framework/kirki' => array(
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'pretty_version' => '4.2.0',
'version' => '4.2.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
Expand Down
4 changes: 2 additions & 2 deletions kirki-packages/compatibility/src/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @package Kirki
* @category Core
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2020, David Vongries
* @author Themeum
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
* @since 0.1
*/
Expand Down
4 changes: 2 additions & 2 deletions kirki-packages/compatibility/src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @package Kirki
* @category Compatibility
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2020, David Vongries
* @author Themeum
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions kirki-packages/compatibility/src/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @package Kirki
* @category Core
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2020, David Vongries
* @author Themeum
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions kirki-packages/compatibility/src/Deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @package Kirki
* @category Core
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2020, David Vongries
* @author Themeum
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/
Expand Down
Loading

0 comments on commit a9d7f45

Please sign in to comment.