composer.lock 0000644 00000056346 14717721153 0007273 0 ustar 00 {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "943677dd40de26b4cb25b4422817645b",
"packages": [],
"packages-dev": [
{
"name": "composer/installers",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
"reference": "c29dc4b93137acb82734f672c37e029dfbd95b35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35",
"reference": "c29dc4b93137acb82734f672c37e029dfbd95b35",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"composer/composer": "1.6.* || ^2.0",
"composer/semver": "^1 || ^3",
"phpstan/phpstan": "^0.12.55",
"phpstan/phpstan-phpunit": "^0.12.16",
"symfony/phpunit-bridge": "^5.3",
"symfony/process": "^5"
},
"type": "composer-plugin",
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-main": "2.x-dev"
},
"plugin-modifies-install-path": true
},
"autoload": {
"psr-4": {
"Composer\\Installers\\": "src/Composer/Installers"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"description": "A multi-framework Composer library installer",
"homepage": "https://composer.github.io/installers/",
"keywords": [
"Dolibarr",
"Eliasis",
"Hurad",
"ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo",
"MantisBT",
"Mautic",
"Maya",
"OXID",
"Plentymarkets",
"Porto",
"RadPHP",
"SMF",
"Starbug",
"Thelia",
"Whmcs",
"WolfCMS",
"agl",
"annotatecms",
"attogram",
"bitrix",
"cakephp",
"chef",
"cockpit",
"codeigniter",
"concrete5",
"croogo",
"dokuwiki",
"drupal",
"eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
"grav",
"installer",
"itop",
"known",
"kohana",
"laravel",
"lavalite",
"lithium",
"magento",
"majima",
"mako",
"matomo",
"mediawiki",
"miaoxing",
"modulework",
"modx",
"moodle",
"osclass",
"pantheon",
"phpbb",
"piwik",
"ppi",
"processwire",
"puppet",
"pxcms",
"reindex",
"roundcube",
"shopware",
"silverstripe",
"sydes",
"sylius",
"tastyigniter",
"wordpress",
"yawik",
"zend",
"zikula"
],
"support": {
"issues": "https://github.com/composer/installers/issues",
"source": "https://github.com/composer/installers/tree/v2.2.0"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2022-08-20T06:45:11+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/composer-installer.git",
"reference": "4be43904336affa5c2f70744a348312336afd0da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da",
"reference": "4be43904336affa5c2f70744a348312336afd0da",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.4",
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
"ext-json": "*",
"ext-zip": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "^9.0",
"yoast/phpunit-polyfills": "^1.0"
},
"type": "composer-plugin",
"extra": {
"class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"autoload": {
"psr-4": {
"PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Franck Nijhof",
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
"homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
"code quality",
"codesniffer",
"composer",
"installer",
"phpcbf",
"phpcs",
"plugin",
"qa",
"quality",
"standard",
"standards",
"style guide",
"stylecheck",
"tests"
],
"support": {
"issues": "https://github.com/PHPCSStandards/composer-installer/issues",
"source": "https://github.com/PHPCSStandards/composer-installer"
},
"time": "2023-01-05T11:28:13+00:00"
},
{
"name": "phpcompatibility/php-compatibility",
"version": "9.3.5",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
"shasum": ""
},
"require": {
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
},
"conflict": {
"squizlabs/php_codesniffer": "2.6.2"
},
"require-dev": {
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"homepage": "https://github.com/wimg",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
}
],
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
"keywords": [
"compatibility",
"phpcs",
"standards"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibility"
},
"time": "2019-12-27T09:44:58+00:00"
},
{
"name": "phpcompatibility/phpcompatibility-paragonie",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
"reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
"reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
"shasum": ""
},
"require": {
"phpcompatibility/php-compatibility": "^9.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"paragonie/random_compat": "dev-master",
"paragonie/sodium_compat": "dev-master"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"role": "lead"
}
],
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
"homepage": "http://phpcompatibility.com/",
"keywords": [
"compatibility",
"paragonie",
"phpcs",
"polyfill",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
},
"time": "2022-10-25T01:46:02+00:00"
},
{
"name": "phpcompatibility/phpcompatibility-wp",
"version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
"reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
"reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
"shasum": ""
},
"require": {
"phpcompatibility/php-compatibility": "^9.0",
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"role": "lead"
}
],
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
"homepage": "http://phpcompatibility.com/",
"keywords": [
"compatibility",
"phpcs",
"standards",
"static analysis",
"wordpress"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
},
"time": "2022-10-24T09:00:36+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.7.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2023-02-22T23:07:41+00:00"
},
{
"name": "wp-coding-standards/wpcs",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
"reference": "7da1894633f168fe244afc6de00d141f27517b62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
"reference": "7da1894633f168fe244afc6de00d141f27517b62",
"shasum": ""
},
"require": {
"php": ">=5.4",
"squizlabs/php_codesniffer": "^3.3.1"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Contributors",
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
"keywords": [
"phpcs",
"standards",
"wordpress"
],
"support": {
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
},
"time": "2020-05-13T23:57:56+00:00"
},
{
"name": "wptrt/wpthemereview",
"version": "dev-develop",
"source": {
"type": "git",
"url": "https://github.com/WPTT/WPThemeReview.git",
"reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WPTT/WPThemeReview/zipball/15684d0852fe90d807c2ae7746dea1302b74b4bd",
"reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd",
"shasum": ""
},
"require": {
"php": ">=5.4",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"squizlabs/php_codesniffer": "^3.3.1",
"wp-coding-standards/wpcs": "^2.2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-parallel-lint/php-console-highlighter": "^0.5",
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0",
"roave/security-advisories": "dev-master"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"default-branch": true,
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Theme Review Team",
"homepage": "https://make.wordpress.org/themes/handbook/",
"role": "Strategy and rule setting"
},
{
"name": "Ulrich Pogson",
"homepage": "https://github.com/grappler",
"role": "Lead developer"
},
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "Lead developer"
},
{
"name": "Denis Žoljom",
"homepage": "https://github.com/dingo-d",
"role": "Plugin integration lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org",
"homepage": "https://make.wordpress.org/themes/handbook/review/",
"keywords": [
"phpcs",
"standards",
"themes",
"wordpress"
],
"support": {
"issues": "https://github.com/WPTRT/WPThemeReview/issues",
"source": "https://github.com/WPTRT/WPThemeReview"
},
"time": "2021-06-22T06:10:49+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"wptrt/wpthemereview": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=7.0"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
}
LICENSE 0000644 00000002062 14717721153 0005561 0 ustar 00 The MIT License (MIT)
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
upgrade-notifications.php 0000644 00000002713 14717721153 0011566 0 ustar 00 upgrade_notice ) && strlen( trim( $response->upgrade_notice ) ) > 0 ) : ?>
upgrade_notice ); ?>
modules = new Modules();
// Instantiate classes.
new Kirki();
new L10n( 'kirki', __DIR__ . '/languages' );
new \Kirki\Settings\SetupSettings();
// ? Bagus: Do we really need to-reinclude this file? It was included above.
// Include the ariColor library.
require_once wp_normalize_path( dirname( __FILE__ ) . '/lib/class-aricolor.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
// Add an empty config for global fields.
Kirki::add_config( '' ); // ? Bagus: what is this for? Adding empty config.
// ? Bagus: Do we really need this line? custom-config.php here is supposed to inside this plugin. Or is this just in case we need it in the future?
$custom_config_path = dirname( __FILE__ ) . '/custom-config.php';
$custom_config_path = wp_normalize_path( $custom_config_path );
if ( file_exists( $custom_config_path ) ) {
require_once $custom_config_path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
}
// Add upgrade notifications.
require_once wp_normalize_path( dirname( __FILE__ ) . '/upgrade-notifications.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
/**
* To enable tests, add this line to your wp-config.php file (or anywhere alse):
* define( 'KIRKI_TEST', true );
*
* Please note that the example.php file is not included in the wordpress.org distribution
* and will only be included in dev versions of the plugin in the github repository.
*/
if ( defined( 'KIRKI_TEST' ) && true === KIRKI_TEST && file_exists( dirname( __FILE__ ) . '/example.php' ) ) {
include_once dirname( __FILE__ ) . '/example.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
}
require_once __DIR__ . '/pro-src/pro-index.php'; kirki-composer/autoload.php 0000644 00000001403 14717721153 0012031 0 ustar 00 > $GITHUB_ENV"
- name: "Install latest dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }}"
- name: "Run tests"
run: "vendor/bin/simple-phpunit --verbose"
kirki-composer/composer/installers/.github/workflows/lint.yml 0000644 00000001051 14717721153 0020604 0 ustar 00 name: "PHP Lint"
on:
- push
- pull_request
jobs:
tests:
name: "Lint"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "7.2"
- "latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Lint PHP files"
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
kirki-composer/composer/installers/phpstan.neon.dist 0000644 00000000440 14717721153 0017017 0 ustar 00 parameters:
level: 8
paths:
- src
- tests
excludes_analyse:
- tests/Composer/Installers/Test/PolyfillTestCase.php
ignoreErrors:
- '~Test::[a-zA-Z0-9]+Provider\(\) return type~'
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
kirki-composer/composer/installers/LICENSE 0000644 00000002046 14717721153 0014530 0 ustar 00 Copyright (c) 2012 Kyle Robinson Young
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. kirki-composer/composer/installers/src/Composer/Installers/LavaLiteInstaller.php 0000644 00000000413 14717721153 0024305 0 ustar 00 */
protected $locations = array(
'package' => 'packages/{$vendor}/{$name}/',
'theme' => 'public/themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/WolfCMSInstaller.php 0000644 00000000324 14717721153 0024057 0 ustar 00 */
protected $locations = array(
'plugin' => 'wolf/plugins/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php 0000644 00000004555 14717721153 0025245 0 ustar 00 */
protected $locations = [
'module' => 'app/{$name}/',
'extension' => 'extensions/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/',
];
/**
* Format package name.
*
* Cut off leading 'ti-ext-' or 'ti-theme-' if present.
* Strip vendor name of characters that is not alphanumeric or an underscore
*
*/
public function inflectPackageVars(array $vars): array
{
$extra = $this->package->getExtra();
if ($vars['type'] === 'tastyigniter-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'tastyigniter-extension') {
return $this->inflectExtensionVars($vars, $extra);
}
if ($vars['type'] === 'tastyigniter-theme') {
return $this->inflectThemeVars($vars, $extra);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^ti-module-/', '', $vars['name']);
return $vars;
}
/**
* @param array $vars
* @param array $extra
* @return array
*/
protected function inflectExtensionVars(array $vars, array $extra): array
{
if (!empty($extra['tastyigniter-extension']['code'])) {
$parts = explode('.', $extra['tastyigniter-extension']['code']);
$vars['vendor'] = (string)$parts[0];
$vars['name'] = (string)($parts[1] ?? '');
}
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
$vars['name'] = $this->pregReplace('/^ti-ext-/', '', $vars['name']);
return $vars;
}
/**
* @param array $vars
* @param array $extra
* @return array
*/
protected function inflectThemeVars(array $vars, array $extra): array
{
if (!empty($extra['tastyigniter-theme']['code'])) {
$vars['name'] = $extra['tastyigniter-theme']['code'];
}
$vars['name'] = $this->pregReplace('/^ti-theme-/', '', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/WordPressInstaller.php 0000644 00000000573 14717721153 0024543 0 ustar 00 */
protected $locations = array(
'plugin' => 'wp-content/plugins/{$name}/',
'theme' => 'wp-content/themes/{$name}/',
'muplugin' => 'wp-content/mu-plugins/{$name}/',
'dropin' => 'wp-content/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/BitrixInstaller.php 0000644 00000010344 14717721153 0024051 0 ustar 00 .`.
* - `bitrix-d7-component` — copy the component to directory `bitrix/components//`.
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/_`.
*
* You can set custom path to directory with Bitrix kernel in `composer.json`:
*
* ```json
* {
* "extra": {
* "bitrix-dir": "s1/bitrix"
* }
* }
* ```
*
* @author Nik Samokhvalov
* @author Denis Kulichkin
*/
class BitrixInstaller extends BaseInstaller
{
/** @var array */
protected $locations = array(
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
);
/**
* @var string[] Storage for informations about duplicates at all the time of installation packages.
*/
private static $checkedDuplicates = array();
public function inflectPackageVars(array $vars): array
{
/** @phpstan-ignore-next-line */
if ($this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();
if (isset($extra['bitrix-dir'])) {
$vars['bitrix_dir'] = $extra['bitrix-dir'];
}
}
if (!isset($vars['bitrix_dir'])) {
$vars['bitrix_dir'] = 'bitrix';
}
return parent::inflectPackageVars($vars);
}
/**
* {@inheritdoc}
*/
protected function templatePath(string $path, array $vars = array()): string
{
$templatePath = parent::templatePath($path, $vars);
$this->checkDuplicates($templatePath, $vars);
return $templatePath;
}
/**
* Duplicates search packages.
*
* @param array $vars
*/
protected function checkDuplicates(string $path, array $vars = array()): void
{
$packageType = substr($vars['type'], strlen('bitrix') + 1);
$localDir = explode('/', $vars['bitrix_dir']);
array_pop($localDir);
$localDir[] = 'local';
$localDir = implode('/', $localDir);
$oldPath = str_replace(
array('{$bitrix_dir}', '{$name}'),
array($localDir, $vars['name']),
$this->locations[$packageType]
);
if (in_array($oldPath, static::$checkedDuplicates)) {
return;
}
if ($oldPath !== $path && file_exists($oldPath) && $this->io->isInteractive()) {
$this->io->writeError(' Duplication of packages:');
$this->io->writeError(' Package ' . $oldPath . ' will be called instead package ' . $path . '');
while (true) {
switch ($this->io->ask(' Delete ' . $oldPath . ' [y,n,?]? ', '?')) {
case 'y':
$fs = new Filesystem();
$fs->removeDirectory($oldPath);
break 2;
case 'n':
break 2;
case '?':
default:
$this->io->writeError(array(
' y - delete package ' . $oldPath . ' and to continue with the installation',
' n - don\'t delete and to continue with the installation',
));
$this->io->writeError(' ? - print help');
break;
}
}
}
static::$checkedDuplicates[] = $oldPath;
}
}
kirki-composer/composer/installers/src/Composer/Installers/ItopInstaller.php 0000644 00000000325 14717721153 0023521 0 ustar 00 */
protected $locations = array(
'extension' => 'extensions/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/TaoInstaller.php 0000644 00000001507 14717721153 0023334 0 ustar 00 */
protected $locations = array(
'extension' => '{$name}'
);
public function inflectPackageVars(array $vars): array
{
$extra = $this->package->getExtra();
if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
$vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
return $vars;
}
$vars['name'] = str_replace('extension-', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/DframeInstaller.php 0000644 00000000331 14717721153 0024001 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$vendor}/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ZikulaInstaller.php 0000644 00000000410 14717721153 0024040 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$vendor}-{$name}/',
'theme' => 'themes/{$vendor}-{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/MediaWikiInstaller.php 0000644 00000003041 14717721153 0024447 0 ustar 00 */
protected $locations = array(
'core' => 'core/',
'extension' => 'extensions/{$name}/',
'skin' => 'skins/{$name}/',
);
/**
* Format package name.
*
* For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
* to CamelCase keeping existing uppercase chars.
*
* For package type mediawiki-skin, cut off a trailing '-skin' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'mediawiki-extension') {
return $this->inflectExtensionVars($vars);
}
if ($vars['type'] === 'mediawiki-skin') {
return $this->inflectSkinVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectExtensionVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-extension$/', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectSkinVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-skin$/', '', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/FuelphpInstaller.php 0000644 00000000326 14717721153 0024212 0 ustar 00 */
protected $locations = array(
'component' => 'components/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ChefInstaller.php 0000644 00000000404 14717721153 0023451 0 ustar 00 */
protected $locations = array(
'cookbook' => 'Chef/{$vendor}/{$name}/',
'role' => 'Chef/roles/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/RoundcubeInstaller.php 0000644 00000000706 14717721153 0024537 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Lowercase name and changes the name to a underscores
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/VanillaInstaller.php 0000644 00000000374 14717721153 0024200 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/OctoberInstaller.php 0000644 00000003034 14717721153 0024203 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$vendor}-{$name}/'
);
/**
* Format package name.
*
* For package type october-plugin, cut off a trailing '-plugin' if present.
*
* For package type october-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'october-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'october-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^oc-|-plugin$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^oc-|-theme$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/LaravelInstaller.php 0000644 00000000322 14717721153 0024171 0 ustar 00 */
protected $locations = array(
'library' => 'libraries/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ProcessWireInstaller.php 0000644 00000001144 14717721153 0025053 0 ustar 00 */
protected $locations = array(
'module' => 'site/modules/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/OntoWikiInstaller.php 0000644 00000001432 14717721153 0024351 0 ustar 00 */
protected $locations = array(
'extension' => 'extensions/{$name}/',
'theme' => 'extensions/themes/{$name}/',
'translation' => 'extensions/translations/{$name}/',
);
/**
* Format package name to lower case and remove ".ontowiki" suffix
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($vars['name']);
$vars['name'] = $this->pregReplace('/.ontowiki$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/-translation$/', '', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PhpBBInstaller.php 0000644 00000000454 14717721153 0023544 0 ustar 00 */
protected $locations = array(
'extension' => 'ext/{$vendor}/{$name}/',
'language' => 'language/{$name}/',
'style' => 'styles/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/OsclassInstaller.php 0000644 00000000507 14717721153 0024217 0 ustar 00 */
protected $locations = array(
'plugin' => 'oc-content/plugins/{$name}/',
'theme' => 'oc-content/themes/{$name}/',
'language' => 'oc-content/languages/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/CroogoInstaller.php 0000644 00000001053 14717721153 0024035 0 ustar 00 */
protected $locations = array(
'plugin' => 'Plugin/{$name}/',
'theme' => 'View/Themed/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/HuradInstaller.php 0000644 00000001370 14717721153 0023652 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/SilverStripeInstaller.php 0000644 00000002030 14717721153 0025234 0 ustar 00 */
protected $locations = array(
'module' => '{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Return the install path based on package type.
*
* Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
* must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
*/
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
if (
$package->getName() == 'silverstripe/framework'
&& preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
&& version_compare($package->getVersion(), '2.999.999') < 0
) {
return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
}
return parent::getInstallPath($package, $frameworkType);
}
}
kirki-composer/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php 0000644 00000000534 14717721153 0025004 0 ustar 00 */
protected $locations = array(
'library' => 'application/libraries/{$name}/',
'third-party' => 'application/third_party/{$name}/',
'module' => 'application/modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/EliasisInstaller.php 0000644 00000000530 14717721153 0024175 0 ustar 00 */
protected $locations = array(
'component' => 'components/{$name}/',
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$name}/',
'template' => 'templates/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MagentoInstaller.php 0000644 00000000470 14717721153 0024201 0 ustar 00 */
protected $locations = array(
'theme' => 'app/design/frontend/{$name}/',
'skin' => 'skin/frontend/default/{$name}/',
'library' => 'lib/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/CakePHPInstaller.php 0000644 00000003621 14717721153 0024023 0 ustar 00 */
protected $locations = array(
'plugin' => 'Plugin/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
return $vars;
}
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
/**
* Change the default plugin location when cakephp >= 3.0
*/
public function getLocations(string $frameworkType): array
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
$this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
}
return $this->locations;
}
/**
* Check if CakePHP version matches against a version
*
* @phpstan-param Constraint::STR_OP_* $matcher
*/
protected function matchesCakeVersion(string $matcher, string $version): bool
{
$repositoryManager = $this->composer->getRepositoryManager();
/** @phpstan-ignore-next-line */
if (!$repositoryManager) {
return false;
}
$repos = $repositoryManager->getLocalRepository();
/** @phpstan-ignore-next-line */
if (!$repos) {
return false;
}
return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
}
}
kirki-composer/composer/installers/src/Composer/Installers/FuelInstaller.php 0000644 00000000466 14717721153 0023507 0 ustar 00 */
protected $locations = array(
'module' => 'fuel/app/modules/{$name}/',
'package' => 'fuel/packages/{$name}/',
'theme' => 'fuel/app/themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/SyDESInstaller.php 0000644 00000002660 14717721153 0023541 0 ustar 00 */
protected $locations = array(
'module' => 'app/modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format module name.
*
* Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'sydes-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'sydes-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
public function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/(^sydes-|-module$)/i', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/(^sydes-|-theme$)/', '', $vars['name']);
$vars['name'] = strtolower($vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/WinterInstaller.php 0000644 00000003507 14717721153 0024063 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type winter-plugin, cut off a trailing '-plugin' if present.
*
* For package type winter-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'winter-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'winter-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'winter-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-module$/', '', $vars['name']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-plugin$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-theme$/', '', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/UserFrostingInstaller.php 0000644 00000000334 14717721153 0025240 0 ustar 00 */
protected $locations = array(
'sprinkle' => 'app/sprinkles/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/YawikInstaller.php 0000644 00000001130 14717721153 0023665 0 ustar 00 */
protected $locations = array(
'module' => 'module/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/Installer.php 0000644 00000023457 14717721153 0022700 0 ustar 00
*/
private $supportedTypes = array(
'akaunting' => 'AkauntingInstaller',
'asgard' => 'AsgardInstaller',
'attogram' => 'AttogramInstaller',
'agl' => 'AglInstaller',
'annotatecms' => 'AnnotateCmsInstaller',
'bitrix' => 'BitrixInstaller',
'bonefish' => 'BonefishInstaller',
'cakephp' => 'CakePHPInstaller',
'chef' => 'ChefInstaller',
'civicrm' => 'CiviCrmInstaller',
'ccframework' => 'ClanCatsFrameworkInstaller',
'cockpit' => 'CockpitInstaller',
'codeigniter' => 'CodeIgniterInstaller',
'concrete5' => 'Concrete5Installer',
'croogo' => 'CroogoInstaller',
'dframe' => 'DframeInstaller',
'dokuwiki' => 'DokuWikiInstaller',
'dolibarr' => 'DolibarrInstaller',
'decibel' => 'DecibelInstaller',
'drupal' => 'DrupalInstaller',
'elgg' => 'ElggInstaller',
'eliasis' => 'EliasisInstaller',
'ee3' => 'ExpressionEngineInstaller',
'ee2' => 'ExpressionEngineInstaller',
'ezplatform' => 'EzPlatformInstaller',
'fuel' => 'FuelInstaller',
'fuelphp' => 'FuelphpInstaller',
'grav' => 'GravInstaller',
'hurad' => 'HuradInstaller',
'tastyigniter' => 'TastyIgniterInstaller',
'imagecms' => 'ImageCMSInstaller',
'itop' => 'ItopInstaller',
'kanboard' => 'KanboardInstaller',
'known' => 'KnownInstaller',
'kodicms' => 'KodiCMSInstaller',
'kohana' => 'KohanaInstaller',
'lms' => 'LanManagementSystemInstaller',
'laravel' => 'LaravelInstaller',
'lavalite' => 'LavaLiteInstaller',
'lithium' => 'LithiumInstaller',
'magento' => 'MagentoInstaller',
'majima' => 'MajimaInstaller',
'mantisbt' => 'MantisBTInstaller',
'mako' => 'MakoInstaller',
'matomo' => 'MatomoInstaller',
'maya' => 'MayaInstaller',
'mautic' => 'MauticInstaller',
'mediawiki' => 'MediaWikiInstaller',
'miaoxing' => 'MiaoxingInstaller',
'microweber' => 'MicroweberInstaller',
'modulework' => 'MODULEWorkInstaller',
'modx' => 'ModxInstaller',
'modxevo' => 'MODXEvoInstaller',
'moodle' => 'MoodleInstaller',
'october' => 'OctoberInstaller',
'ontowiki' => 'OntoWikiInstaller',
'oxid' => 'OxidInstaller',
'osclass' => 'OsclassInstaller',
'pxcms' => 'PxcmsInstaller',
'phpbb' => 'PhpBBInstaller',
'piwik' => 'PiwikInstaller',
'plentymarkets'=> 'PlentymarketsInstaller',
'ppi' => 'PPIInstaller',
'puppet' => 'PuppetInstaller',
'radphp' => 'RadPHPInstaller',
'phifty' => 'PhiftyInstaller',
'porto' => 'PortoInstaller',
'processwire' => 'ProcessWireInstaller',
'quicksilver' => 'PantheonInstaller',
'redaxo' => 'RedaxoInstaller',
'redaxo5' => 'Redaxo5Installer',
'reindex' => 'ReIndexInstaller',
'roundcube' => 'RoundcubeInstaller',
'shopware' => 'ShopwareInstaller',
'sitedirect' => 'SiteDirectInstaller',
'silverstripe' => 'SilverStripeInstaller',
'smf' => 'SMFInstaller',
'starbug' => 'StarbugInstaller',
'sydes' => 'SyDESInstaller',
'sylius' => 'SyliusInstaller',
'tao' => 'TaoInstaller',
'thelia' => 'TheliaInstaller',
'tusk' => 'TuskInstaller',
'userfrosting' => 'UserFrostingInstaller',
'vanilla' => 'VanillaInstaller',
'whmcs' => 'WHMCSInstaller',
'winter' => 'WinterInstaller',
'wolfcms' => 'WolfCMSInstaller',
'wordpress' => 'WordPressInstaller',
'yawik' => 'YawikInstaller',
'zend' => 'ZendInstaller',
'zikula' => 'ZikulaInstaller',
'prestashop' => 'PrestashopInstaller'
);
/**
* Disables installers specified in main composer extra installer-disable
* list
*/
public function __construct(
IOInterface $io,
Composer $composer,
string $type = 'library',
?Filesystem $filesystem = null,
?BinaryInstaller $binaryInstaller = null
) {
parent::__construct($io, $composer, $type, $filesystem, $binaryInstaller);
$this->removeDisabledInstallers();
}
/**
* {@inheritDoc}
*/
public function getInstallPath(PackageInterface $package)
{
$type = $package->getType();
$frameworkType = $this->findFrameworkType($type);
if ($frameworkType === false) {
throw new \InvalidArgumentException(
'Sorry the package type of this package is not yet supported.'
);
}
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
$installer = new $class($package, $this->composer, $this->getIO());
$path = $installer->getInstallPath($package, $frameworkType);
if (!$this->filesystem->isAbsolutePath($path)) {
$path = getcwd() . '/' . $path;
}
return $path;
}
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$installPath = $this->getPackageBasePath($package);
$io = $this->io;
$outputStatus = function () use ($io, $installPath) {
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? 'deleted' : 'not deleted'));
};
$promise = parent::uninstall($repo, $package);
// Composer v2 might return a promise here
if ($promise instanceof PromiseInterface) {
return $promise->then($outputStatus);
}
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
$outputStatus();
return null;
}
/**
* {@inheritDoc}
*/
public function supports($packageType)
{
$frameworkType = $this->findFrameworkType($packageType);
if ($frameworkType === false) {
return false;
}
$locationPattern = $this->getLocationPattern($frameworkType);
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
}
/**
* Finds a supported framework type if it exists and returns it
*
* @return string|false
*/
protected function findFrameworkType(string $type)
{
krsort($this->supportedTypes);
foreach ($this->supportedTypes as $key => $val) {
if ($key === substr($type, 0, strlen($key))) {
return substr($type, 0, strlen($key));
}
}
return false;
}
/**
* Get the second part of the regular expression to check for support of a
* package type
*/
protected function getLocationPattern(string $frameworkType): string
{
$pattern = null;
if (!empty($this->supportedTypes[$frameworkType])) {
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
/** @var BaseInstaller $framework */
$framework = new $frameworkClass(new Package('dummy/pkg', '1.0.0.0', '1.0.0'), $this->composer, $this->getIO());
$locations = array_keys($framework->getLocations($frameworkType));
if ($locations) {
$pattern = '(' . implode('|', $locations) . ')';
}
}
return $pattern ?: '(\w+)';
}
private function getIO(): IOInterface
{
return $this->io;
}
/**
* Look for installers set to be disabled in composer's extra config and
* remove them from the list of supported installers.
*
* Globals:
* - true, "all", and "*" - disable all installers.
* - false - enable all installers (useful with
* wikimedia/composer-merge-plugin or similar)
*/
protected function removeDisabledInstallers(): void
{
$extra = $this->composer->getPackage()->getExtra();
if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
// No installers are disabled
return;
}
// Get installers to disable
$disable = $extra['installer-disable'];
// Ensure $disabled is an array
if (!is_array($disable)) {
$disable = array($disable);
}
// Check which installers should be disabled
$all = array(true, "all", "*");
$intersect = array_intersect($all, $disable);
if (!empty($intersect)) {
// Disable all installers
$this->supportedTypes = array();
return;
}
// Disable specified installers
foreach ($disable as $key => $installer) {
if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
unset($this->supportedTypes[$installer]);
}
}
}
}
kirki-composer/composer/installers/src/Composer/Installers/Plugin.php 0000644 00000001270 14717721153 0022166 0 ustar 00 installer = new Installer($io, $composer);
$composer->getInstallationManager()->addInstaller($this->installer);
}
public function deactivate(Composer $composer, IOInterface $io): void
{
$composer->getInstallationManager()->removeInstaller($this->installer);
}
public function uninstall(Composer $composer, IOInterface $io): void
{
}
}
kirki-composer/composer/installers/src/Composer/Installers/KanboardInstaller.php 0000644 00000000517 14717721153 0024332 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MakoInstaller.php 0000644 00000000322 14717721153 0023472 0 ustar 00 */
protected $locations = array(
'package' => 'app/packages/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php 0000644 00000000325 14717721153 0024436 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/SyliusInstaller.php 0000644 00000000314 14717721153 0024074 0 ustar 00 */
protected $locations = array(
'theme' => 'themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MauticInstaller.php 0000644 00000002217 14717721153 0024032 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
'core' => 'app/',
);
private function getDirectoryName(): string
{
$extra = $this->package->getExtra();
if (!empty($extra['install-directory-name'])) {
return $extra['install-directory-name'];
}
return $this->toCamelCase($this->package->getPrettyName());
}
private function toCamelCase(string $packageName): string
{
return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
}
/**
* Format package name of mautic-plugins to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
$directoryName = $this->getDirectoryName();
$vars['name'] = $directoryName;
}
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/AkauntingInstaller.php 0000644 00000001133 14717721153 0024525 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PuppetInstaller.php 0000644 00000000317 14717721153 0024064 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/PantheonInstaller.php 0000644 00000000446 14717721153 0024366 0 ustar 00 */
protected $locations = array(
'script' => 'web/private/scripts/quicksilver/{$name}',
'module' => 'web/private/scripts/quicksilver/{$name}',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MajimaInstaller.php 0000644 00000002147 14717721153 0024010 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Transforms the names
*
* @param array $vars
* @return array
*/
public function inflectPackageVars(array $vars): array
{
return $this->correctPluginName($vars);
}
/**
* Change hyphenated names to camelcase
*
* @param array $vars
* @return array
*/
private function correctPluginName(array $vars): array
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
if (null === $camelCasedName) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = ucfirst($camelCasedName);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PrestashopInstaller.php 0000644 00000000371 14717721153 0024737 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/RadPHPInstaller.php 0000644 00000001315 14717721153 0023664 0 ustar 00 */
protected $locations = array(
'bundle' => 'src/{$name}/'
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/AglInstaller.php 0000644 00000001242 14717721153 0023310 0 ustar 00 */
protected $locations = array(
'module' => 'More/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$name = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
return strtoupper($matches[1]);
}, $vars['name']);
if (null === $name) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = $name;
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/LithiumInstaller.php 0000644 00000000405 14717721153 0024220 0 ustar 00 */
protected $locations = array(
'library' => 'libraries/{$name}/',
'source' => 'libraries/_source/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ReIndexInstaller.php 0000644 00000000373 14717721153 0024147 0 ustar 00 */
protected $locations = array(
'theme' => 'themes/{$name}/',
'plugin' => 'plugins/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/Redaxo5Installer.php 0000644 00000000453 14717721153 0024117 0 ustar 00 */
protected $locations = array(
'addon' => 'redaxo/src/addons/{$name}/',
'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/EzPlatformInstaller.php 0000644 00000000423 14717721153 0024670 0 ustar 00 */
protected $locations = array(
'meta-assets' => 'web/assets/ezplatform/',
'assets' => 'web/assets/ezplatform/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MantisBTInstaller.php 0000644 00000001202 14717721153 0024262 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/TuskInstaller.php 0000644 00000000624 14717721153 0023536 0 ustar 00
*/
class TuskInstaller extends BaseInstaller
{
/** @var array */
protected $locations = array(
'task' => '.tusk/tasks/{$name}/',
'command' => '.tusk/commands/{$name}/',
'asset' => 'assets/tusk/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php 0000644 00000001416 14717721153 0026524 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'template' => 'templates/{$name}/',
'document-template' => 'documents/templates/{$name}/',
'userpanel-module' => 'userpanel/modules/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/MatomoInstaller.php 0000644 00000001235 14717721153 0024043 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/DrupalInstaller.php 0000644 00000001612 14717721153 0024035 0 ustar 00 */
protected $locations = array(
'core' => 'core/',
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
'library' => 'libraries/{$name}/',
'profile' => 'profiles/{$name}/',
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
'drush' => 'drush/{$name}/',
'custom-theme' => 'themes/custom/{$name}/',
'custom-module' => 'modules/custom/{$name}/',
'custom-profile' => 'profiles/custom/{$name}/',
'drupal-multisite' => 'sites/{$name}/',
'console' => 'console/{$name}/',
'console-language' => 'console/language/{$name}/',
'config' => 'config/sync/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/BonefishInstaller.php 0000644 00000000336 14717721153 0024345 0 ustar 00 */
protected $locations = array(
'package' => 'Packages/{$vendor}/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/ModxInstaller.php 0000644 00000000433 14717721153 0023515 0 ustar 00 */
protected $locations = array(
'extra' => 'core/packages/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/TheliaInstaller.php 0000644 00000000653 14717721153 0024020 0 ustar 00 */
protected $locations = array(
'module' => 'local/modules/{$name}/',
'frontoffice-template' => 'templates/frontOffice/{$name}/',
'backoffice-template' => 'templates/backOffice/{$name}/',
'email-template' => 'templates/email/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/BaseInstaller.php 0000644 00000010117 14717721153 0023460 0 ustar 00 */
protected $locations = array();
/** @var Composer */
protected $composer;
/** @var PackageInterface */
protected $package;
/** @var IOInterface */
protected $io;
/**
* Initializes base installer.
*/
public function __construct(PackageInterface $package, Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->package = $package;
$this->io = $io;
}
/**
* Return the install path based on package type.
*/
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
$type = $this->package->getType();
$prettyName = $this->package->getPrettyName();
if (strpos($prettyName, '/') !== false) {
list($vendor, $name) = explode('/', $prettyName);
} else {
$vendor = '';
$name = $prettyName;
}
$availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
$extra = $package->getExtra();
if (!empty($extra['installer-name'])) {
$availableVars['name'] = $extra['installer-name'];
}
$extra = $this->composer->getPackage()->getExtra();
if (!empty($extra['installer-paths'])) {
$customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
if ($customPath !== false) {
return $this->templatePath($customPath, $availableVars);
}
}
$packageType = substr($type, strlen($frameworkType) + 1);
$locations = $this->getLocations($frameworkType);
if (!isset($locations[$packageType])) {
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
}
return $this->templatePath($locations[$packageType], $availableVars);
}
/**
* For an installer to override to modify the vars per installer.
*
* @param array $vars This will normally receive array{name: string, vendor: string, type: string}
* @return array
*/
public function inflectPackageVars(array $vars): array
{
return $vars;
}
/**
* Gets the installer's locations
*
* @return array map of package types => install path
*/
public function getLocations(string $frameworkType)
{
return $this->locations;
}
/**
* Replace vars in a path
*
* @param array $vars
*/
protected function templatePath(string $path, array $vars = array()): string
{
if (strpos($path, '{') !== false) {
extract($vars);
preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
if (!empty($matches[1])) {
foreach ($matches[1] as $var) {
$path = str_replace('{$' . $var . '}', $$var, $path);
}
}
}
return $path;
}
/**
* Search through a passed paths array for a custom install path.
*
* @param array $paths
* @return string|false
*/
protected function mapCustomInstallPaths(array $paths, string $name, string $type, ?string $vendor = null)
{
foreach ($paths as $path => $names) {
$names = (array) $names;
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
return $path;
}
}
return false;
}
protected function pregReplace(string $pattern, string $replacement, string $subject): string
{
$result = preg_replace($pattern, $replacement, $subject);
if (null === $result) {
throw new \RuntimeException('Failed to run preg_replace with '.$pattern.': '.preg_last_error());
}
return $result;
}
}
kirki-composer/composer/installers/src/Composer/Installers/StarbugInstaller.php 0000644 00000000530 14717721153 0024213 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
'custom-module' => 'app/modules/{$name}/',
'custom-theme' => 'app/themes/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/AsgardInstaller.php 0000644 00000003077 14717721153 0024016 0 ustar 00 */
protected $locations = array(
'module' => 'Modules/{$name}/',
'theme' => 'Themes/{$name}/'
);
/**
* Format package name.
*
* For package type asgard-module, cut off a trailing '-plugin' if present.
*
* For package type asgard-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'asgard-module') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'asgard-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/CiviCrmInstaller.php 0000644 00000000312 14717721153 0024136 0 ustar 00 */
protected $locations = array(
'ext' => 'ext/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/ZendInstaller.php 0000644 00000000445 14717721153 0023511 0 ustar 00 */
protected $locations = array(
'library' => 'library/{$name}/',
'extra' => 'extras/library/{$name}/',
'module' => 'module/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/PhiftyInstaller.php 0000644 00000000447 14717721153 0024056 0 ustar 00 */
protected $locations = array(
'bundle' => 'bundles/{$name}/',
'library' => 'libraries/{$name}/',
'framework' => 'frameworks/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php 0000644 00000001435 14717721153 0026076 0 ustar 00 */
private $ee2Locations = array(
'addon' => 'system/expressionengine/third_party/{$name}/',
'theme' => 'themes/third_party/{$name}/',
);
/** @var array */
private $ee3Locations = array(
'addon' => 'system/user/addons/{$name}/',
'theme' => 'themes/user/{$name}/',
);
public function getLocations(string $frameworkType): array
{
if ($frameworkType === 'ee2') {
$this->locations = $this->ee2Locations;
} else {
$this->locations = $this->ee3Locations;
}
return $this->locations;
}
}
kirki-composer/composer/installers/src/Composer/Installers/ElggInstaller.php 0000644 00000000310 14717721153 0023456 0 ustar 00 */
protected $locations = array(
'plugin' => 'mod/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MODXEvoInstaller.php 0000644 00000001010 14717721153 0024017 0 ustar 00 */
protected $locations = array(
'snippet' => 'assets/snippets/{$name}/',
'plugin' => 'assets/plugins/{$name}/',
'module' => 'assets/modules/{$name}/',
'template' => 'assets/templates/{$name}/',
'lib' => 'assets/lib/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/MoodleInstaller.php 0000644 00000006673 14717721153 0024041 0 ustar 00 */
protected $locations = array(
'mod' => 'mod/{$name}/',
'admin_report' => 'admin/report/{$name}/',
'atto' => 'lib/editor/atto/plugins/{$name}/',
'tool' => 'admin/tool/{$name}/',
'assignment' => 'mod/assignment/type/{$name}/',
'assignsubmission' => 'mod/assign/submission/{$name}/',
'assignfeedback' => 'mod/assign/feedback/{$name}/',
'antivirus' => 'lib/antivirus/{$name}/',
'auth' => 'auth/{$name}/',
'availability' => 'availability/condition/{$name}/',
'block' => 'blocks/{$name}/',
'booktool' => 'mod/book/tool/{$name}/',
'cachestore' => 'cache/stores/{$name}/',
'cachelock' => 'cache/locks/{$name}/',
'calendartype' => 'calendar/type/{$name}/',
'customfield' => 'customfield/field/{$name}/',
'fileconverter' => 'files/converter/{$name}/',
'format' => 'course/format/{$name}/',
'coursereport' => 'course/report/{$name}/',
'contenttype' => 'contentbank/contenttype/{$name}/',
'customcertelement' => 'mod/customcert/element/{$name}/',
'datafield' => 'mod/data/field/{$name}/',
'dataformat' => 'dataformat/{$name}/',
'datapreset' => 'mod/data/preset/{$name}/',
'editor' => 'lib/editor/{$name}/',
'enrol' => 'enrol/{$name}/',
'filter' => 'filter/{$name}/',
'gradeexport' => 'grade/export/{$name}/',
'gradeimport' => 'grade/import/{$name}/',
'gradereport' => 'grade/report/{$name}/',
'gradingform' => 'grade/grading/form/{$name}/',
'local' => 'local/{$name}/',
'logstore' => 'admin/tool/log/store/{$name}/',
'ltisource' => 'mod/lti/source/{$name}/',
'ltiservice' => 'mod/lti/service/{$name}/',
'media' => 'media/player/{$name}/',
'message' => 'message/output/{$name}/',
'mnetservice' => 'mnet/service/{$name}/',
'paygw' => 'payment/gateway/{$name}/',
'plagiarism' => 'plagiarism/{$name}/',
'portfolio' => 'portfolio/{$name}/',
'qbehaviour' => 'question/behaviour/{$name}/',
'qformat' => 'question/format/{$name}/',
'qtype' => 'question/type/{$name}/',
'quizaccess' => 'mod/quiz/accessrule/{$name}/',
'quiz' => 'mod/quiz/report/{$name}/',
'report' => 'report/{$name}/',
'repository' => 'repository/{$name}/',
'scormreport' => 'mod/scorm/report/{$name}/',
'search' => 'search/engine/{$name}/',
'theme' => 'theme/{$name}/',
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
'profilefield' => 'user/profile/field/{$name}/',
'webservice' => 'webservice/{$name}/',
'workshopallocation' => 'mod/workshop/allocation/{$name}/',
'workshopeval' => 'mod/workshop/eval/{$name}/',
'workshopform' => 'mod/workshop/form/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/Concrete5Installer.php 0000644 00000000625 14717721153 0024440 0 ustar 00 */
protected $locations = array(
'core' => 'concrete/',
'block' => 'application/blocks/{$name}/',
'package' => 'packages/{$name}/',
'theme' => 'application/themes/{$name}/',
'update' => 'updates/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/CockpitInstaller.php 0000644 00000001443 14717721153 0024204 0 ustar 00 */
protected $locations = array(
'module' => 'cockpit/modules/addons/{$name}/',
);
/**
* Format module name.
*
* Strip `module-` prefix from package name.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'cockpit-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
public function inflectModuleVars(array $vars): array
{
$vars['name'] = ucfirst($this->pregReplace('/cockpit-/i', '', $vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php 0000644 00000000420 14717721153 0026150 0 ustar 00 */
protected $locations = array(
'ship' => 'CCF/orbit/{$name}/',
'theme' => 'CCF/app/themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/ImageCMSInstaller.php 0000644 00000000513 14717721153 0024172 0 ustar 00 */
protected $locations = array(
'template' => 'templates/{$name}/',
'module' => 'application/modules/{$name}/',
'library' => 'application/libraries/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/KodiCMSInstaller.php 0000644 00000000403 14717721153 0024034 0 ustar 00 */
protected $locations = array(
'plugin' => 'cms/plugins/{$name}/',
'media' => 'cms/media/vendor/{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/PxcmsInstaller.php 0000644 00000004154 14717721153 0023704 0 ustar 00 */
protected $locations = array(
'module' => 'app/Modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format package name.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'pxcms-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'pxcms-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* @param array $vars
* @return array
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']); // strip out -module
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']); // strip out -theme
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php 0000644 00000001246 14717721153 0025453 0 ustar 00 */
protected $locations = array(
'plugin' => '{$name}/'
);
/**
* Remove hyphen, "plugin" and format to camelcase
*/
public function inflectPackageVars(array $vars): array
{
$nameBits = explode("-", $vars['name']);
foreach ($nameBits as $key => $name) {
$nameBits[$key] = ucfirst($name);
if (strcasecmp($name, "Plugin") == 0) {
unset($nameBits[$key]);
}
}
$vars['name'] = implode('', $nameBits);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/KohanaInstaller.php 0000644 00000000316 14717721153 0024007 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php 0000644 00000000505 14717721153 0025022 0 ustar 00 */
protected $locations = array(
'module' => 'addons/modules/{$name}/',
'component' => 'addons/components/{$name}/',
'service' => 'addons/services/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/DokuWikiInstaller.php 0000644 00000003005 14717721153 0024332 0 ustar 00 */
protected $locations = array(
'plugin' => 'lib/plugins/{$name}/',
'template' => 'lib/tpl/{$name}/',
);
/**
* Format package name.
*
* For package type dokuwiki-plugin, cut off a trailing '-plugin',
* or leading dokuwiki_ if present.
*
* For package type dokuwiki-template, cut off a trailing '-template' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'dokuwiki-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'dokuwiki-template') {
return $this->inflectTemplateVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-plugin$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectTemplateVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-template$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/DecibelInstaller.php 0000644 00000000341 14717721153 0024133 0 ustar 00 */
protected $locations = array(
'app' => 'app/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/VgmcpInstaller.php 0000644 00000003107 14717721153 0023663 0 ustar 00 */
protected $locations = array(
'bundle' => 'src/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
*
* For package type vgmcp-theme, cut off a trailing '-theme' if present.
*
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'vgmcp-bundle') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'vgmcp-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-bundle$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/ShopwareInstaller.php 0000644 00000003547 14717721153 0024407 0 ustar 00 */
protected $locations = array(
'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
'theme' => 'templates/{$name}/',
'plugin' => 'custom/plugins/{$name}/',
'frontend-theme' => 'themes/Frontend/{$name}/',
);
/**
* Transforms the names
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'shopware-theme') {
return $this->correctThemeName($vars);
}
return $this->correctPluginName($vars);
}
/**
* Changes the name to a camelcased combination of vendor and name
*
* @param array $vars
* @return array
*/
private function correctPluginName(array $vars): array
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
if (null === $camelCasedName) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
return $vars;
}
/**
* Changes the name to a underscore separated name
*
* @param array $vars
* @return array
*/
private function correctThemeName(array $vars): array
{
$vars['name'] = str_replace('-', '_', $vars['name']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/DolibarrInstaller.php 0000644 00000000611 14717721153 0024342 0 ustar 00
*/
class DolibarrInstaller extends BaseInstaller
{
//TODO: Add support for scripts and themes
/** @var array */
protected $locations = array(
'module' => 'htdocs/custom/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/KnownInstaller.php 0000644 00000000460 14717721153 0023702 0 ustar 00 */
protected $locations = array(
'plugin' => 'IdnoPlugins/{$name}/',
'theme' => 'Themes/{$name}/',
'console' => 'ConsolePlugins/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/SMFInstaller.php 0000644 00000000361 14717721153 0023233 0 ustar 00 */
protected $locations = array(
'module' => 'Sources/{$name}/',
'theme' => 'Themes/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/OxidInstaller.php 0000644 00000002666 14717721153 0023523 0 ustar 00 .+)\/.+/';
/** @var array */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'application/views/{$name}/',
'out' => 'out/{$name}/',
);
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
$installPath = parent::getInstallPath($package, $frameworkType);
$type = $this->package->getType();
if ($type === 'oxid-module') {
$this->prepareVendorDirectory($installPath);
}
return $installPath;
}
/**
* Makes sure there is a vendormetadata.php file inside
* the vendor folder if there is a vendor folder.
*/
protected function prepareVendorDirectory(string $installPath): void
{
$matches = '';
$hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
if (!$hasVendorDirectory) {
return;
}
$vendorDirectory = $matches['vendor'];
$vendorPath = getcwd() . '/modules/' . $vendorDirectory;
if (!file_exists($vendorPath)) {
mkdir($vendorPath, 0755, true);
}
$vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
touch($vendorMetaDataPath);
}
}
kirki-composer/composer/installers/src/Composer/Installers/MiaoxingInstaller.php 0000644 00000000320 14717721153 0024354 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/GravInstaller.php 0000644 00000001306 14717721153 0023505 0 ustar 00 */
protected $locations = array(
'plugin' => 'user/plugins/{$name}/',
'theme' => 'user/themes/{$name}/',
);
/**
* Format package name
*/
public function inflectPackageVars(array $vars): array
{
$restrictedWords = implode('|', array_keys($this->locations));
$vars['name'] = strtolower($vars['name']);
$vars['name'] = $this->pregReplace(
'/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
'$1',
$vars['name']
);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/SiteDirectInstaller.php 0000644 00000001614 14717721153 0024647 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$vendor}/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/'
);
/**
* @param array $vars
* @return array
*/
public function inflectPackageVars(array $vars): array
{
return $this->parseVars($vars);
}
/**
* @param array $vars
* @return array
*/
protected function parseVars(array $vars): array
{
$vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/WHMCSInstaller.php 0000644 00000001554 14717721153 0023474 0 ustar 00 */
protected $locations = array(
'addons' => 'modules/addons/{$vendor}_{$name}/',
'fraud' => 'modules/fraud/{$vendor}_{$name}/',
'gateways' => 'modules/gateways/{$vendor}_{$name}/',
'notifications' => 'modules/notifications/{$vendor}_{$name}/',
'registrars' => 'modules/registrars/{$vendor}_{$name}/',
'reports' => 'modules/reports/{$vendor}_{$name}/',
'security' => 'modules/security/{$vendor}_{$name}/',
'servers' => 'modules/servers/{$vendor}_{$name}/',
'social' => 'modules/social/{$vendor}_{$name}/',
'support' => 'modules/support/{$vendor}_{$name}/',
'templates' => 'templates/{$vendor}_{$name}/',
'includes' => 'includes/{$vendor}_{$name}/'
);
}
kirki-composer/composer/installers/src/Composer/Installers/MayaInstaller.php 0000644 00000001666 14717721153 0023506 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
/**
* Format package name.
*
* For package type maya-module, cut off a trailing '-module' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'maya-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PortoInstaller.php 0000644 00000000327 14717721153 0023713 0 ustar 00 */
protected $locations = array(
'container' => 'app/Containers/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/MicroweberInstaller.php 0000644 00000012226 14717721153 0024707 0 ustar 00 */
protected $locations = array(
'module' => 'userfiles/modules/{$install_item_dir}/',
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
'template' => 'userfiles/templates/{$install_item_dir}/',
'element' => 'userfiles/elements/{$install_item_dir}/',
'vendor' => 'vendor/{$install_item_dir}/',
'components' => 'components/{$install_item_dir}/'
);
/**
* Format package name.
*
* For package type microweber-module, cut off a trailing '-module' if present
*
* For package type microweber-template, cut off a trailing '-template' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($this->package->getTargetDir() !== null && $this->package->getTargetDir() !== '') {
$vars['install_item_dir'] = $this->package->getTargetDir();
} else {
$vars['install_item_dir'] = $vars['name'];
if ($vars['type'] === 'microweber-template') {
return $this->inflectTemplateVars($vars);
}
if ($vars['type'] === 'microweber-templates') {
return $this->inflectTemplatesVars($vars);
}
if ($vars['type'] === 'microweber-core') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-adapter') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'microweber-modules') {
return $this->inflectModulesVars($vars);
}
if ($vars['type'] === 'microweber-skin') {
return $this->inflectSkinVars($vars);
}
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
return $this->inflectElementVars($vars);
}
}
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectTemplateVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-template$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/template-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectTemplatesVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-templates$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/templates-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectCoreVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-providers$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-provider$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-adapter$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectModuleVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-module$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/module-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectModulesVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-modules$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/modules-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectSkinVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-skin$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/skin-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array $vars
* @return array
*/
protected function inflectElementVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-elements$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/elements-$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-element$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/element-$/', '', $vars['install_item_dir']);
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/AttogramInstaller.php 0000644 00000000320 14717721153 0024357 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/PiwikInstaller.php 0000644 00000001233 14717721153 0023670 0 ustar 00 */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
kirki-composer/composer/installers/src/Composer/Installers/PPIInstaller.php 0000644 00000000313 14717721153 0023233 0 ustar 00 */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
kirki-composer/composer/installers/src/Composer/Installers/RedaxoInstaller.php 0000644 00000000462 14717721153 0024032 0 ustar 00 */
protected $locations = array(
'addon' => 'redaxo/include/addons/{$name}/',
'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
);
}
kirki-composer/composer/installers/src/bootstrap.php 0000644 00000001040 14717721153 0017031 0 ustar 00 array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'),
'Kirki\\Util\\' => array($baseDir . '/kirki-packages/util/src'),
'Kirki\\Settings\\' => array($baseDir . '/kirki-packages/settings/src'),
'Kirki\\Pro\\' => array($baseDir . '/pro-src'),
'Kirki\\Module\\' => array($baseDir . '/kirki-packages/module-css/src', $baseDir . '/kirki-packages/module-editor-styles/src', $baseDir . '/kirki-packages/module-field-dependencies/src', $baseDir . '/kirki-packages/module-postmessage/src', $baseDir . '/kirki-packages/module-preset/src', $baseDir . '/kirki-packages/module-section-icons/src', $baseDir . '/kirki-packages/module-selective-refresh/src', $baseDir . '/kirki-packages/module-tooltips/src', $baseDir . '/kirki-packages/module-webfonts/src'),
'Kirki\\Field\\' => array($baseDir . '/kirki-packages/field/src/Field', $baseDir . '/kirki-packages/field-background/src', $baseDir . '/kirki-packages/field-dimensions/src', $baseDir . '/kirki-packages/field-fontawesome/src', $baseDir . '/kirki-packages/field-multicolor/src/Field', $baseDir . '/kirki-packages/field-multicolor/src', $baseDir . '/kirki-packages/field-typography/src/Field', $baseDir . '/kirki-packages/field-typography/src'),
'Kirki\\Data\\' => array($baseDir . '/kirki-packages/data-option/src'),
'Kirki\\Compatibility\\' => array($baseDir . '/kirki-packages/compatibility/src'),
'Kirki\\' => array($baseDir . '/kirki-packages/control-base/src', $baseDir . '/kirki-packages/control-checkbox/src', $baseDir . '/kirki-packages/control-code/src', $baseDir . '/kirki-packages/control-color/src', $baseDir . '/kirki-packages/control-color-palette/src', $baseDir . '/kirki-packages/control-cropped-image/src', $baseDir . '/kirki-packages/control-custom/src', $baseDir . '/kirki-packages/control-dashicons/src', $baseDir . '/kirki-packages/control-date/src', $baseDir . '/kirki-packages/control-dimension/src', $baseDir . '/kirki-packages/control-editor/src', $baseDir . '/kirki-packages/control-generic/src', $baseDir . '/kirki-packages/control-image/src', $baseDir . '/kirki-packages/control-multicheck/src', $baseDir . '/kirki-packages/control-palette/src', $baseDir . '/kirki-packages/control-radio/src', $baseDir . '/kirki-packages/control-react-colorful/src', $baseDir . '/kirki-packages/control-react-select/src', $baseDir . '/kirki-packages/control-repeater/src', $baseDir . '/kirki-packages/control-select/src', $baseDir . '/kirki-packages/control-slider/src', $baseDir . '/kirki-packages/control-sortable/src', $baseDir . '/kirki-packages/control-upload/src', $baseDir . '/kirki-packages/field/src', $baseDir . '/kirki-packages/googlefonts/src', $baseDir . '/kirki-packages/l10n/src', $baseDir . '/kirki-packages/module-panels/src', $baseDir . '/kirki-packages/module-sections/src', $baseDir . '/kirki-packages/url-getter/src'),
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
);
kirki-composer/composer/include_paths.php 0000644 00000000261 14717721153 0014673 0 ustar 00 register(true);
return $loader;
}
}
kirki-composer/composer/platform_check.php 0000644 00000001635 14717721153 0015040 0 ustar 00 = 70000)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}
kirki-composer/composer/ClassLoader.php 0000644 00000040220 14717721153 0014244 0 ustar 00
* Jordi Boggiano
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier
* @author Jordi Boggiano
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array[]
* @psalm-return array>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-return array
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param string[] $classMap Class to filename map
* @psalm-param array $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
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);
}
}
kirki-composer/composer/autoload_classmap.php 0000644 00000000336 14717721153 0015547 0 ustar 00 $vendorDir . '/composer/InstalledVersions.php',
);
kirki-composer/composer/autoload_static.php 0000644 00000013764 14717721153 0015244 0 ustar 00
array (
'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 57,
),
'K' =>
array (
'Kirki\\Util\\' => 11,
'Kirki\\Settings\\' => 15,
'Kirki\\Pro\\' => 10,
'Kirki\\Module\\' => 13,
'Kirki\\Field\\' => 12,
'Kirki\\Data\\' => 11,
'Kirki\\Compatibility\\' => 20,
'Kirki\\' => 6,
),
'C' =>
array (
'Composer\\Installers\\' => 20,
),
);
public static $prefixDirsPsr4 = array (
'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' =>
array (
0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src',
),
'Kirki\\Util\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/util/src',
),
'Kirki\\Settings\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/settings/src',
),
'Kirki\\Pro\\' =>
array (
0 => __DIR__ . '/../..' . '/pro-src',
),
'Kirki\\Module\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/module-css/src',
1 => __DIR__ . '/../..' . '/kirki-packages/module-editor-styles/src',
2 => __DIR__ . '/../..' . '/kirki-packages/module-field-dependencies/src',
3 => __DIR__ . '/../..' . '/kirki-packages/module-postmessage/src',
4 => __DIR__ . '/../..' . '/kirki-packages/module-preset/src',
5 => __DIR__ . '/../..' . '/kirki-packages/module-section-icons/src',
6 => __DIR__ . '/../..' . '/kirki-packages/module-selective-refresh/src',
7 => __DIR__ . '/../..' . '/kirki-packages/module-tooltips/src',
8 => __DIR__ . '/../..' . '/kirki-packages/module-webfonts/src',
),
'Kirki\\Field\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/field/src/Field',
1 => __DIR__ . '/../..' . '/kirki-packages/field-background/src',
2 => __DIR__ . '/../..' . '/kirki-packages/field-dimensions/src',
3 => __DIR__ . '/../..' . '/kirki-packages/field-fontawesome/src',
4 => __DIR__ . '/../..' . '/kirki-packages/field-multicolor/src/Field',
5 => __DIR__ . '/../..' . '/kirki-packages/field-multicolor/src',
6 => __DIR__ . '/../..' . '/kirki-packages/field-typography/src/Field',
7 => __DIR__ . '/../..' . '/kirki-packages/field-typography/src',
),
'Kirki\\Data\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/data-option/src',
),
'Kirki\\Compatibility\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/compatibility/src',
),
'Kirki\\' =>
array (
0 => __DIR__ . '/../..' . '/kirki-packages/control-base/src',
1 => __DIR__ . '/../..' . '/kirki-packages/control-checkbox/src',
2 => __DIR__ . '/../..' . '/kirki-packages/control-code/src',
3 => __DIR__ . '/../..' . '/kirki-packages/control-color/src',
4 => __DIR__ . '/../..' . '/kirki-packages/control-color-palette/src',
5 => __DIR__ . '/../..' . '/kirki-packages/control-cropped-image/src',
6 => __DIR__ . '/../..' . '/kirki-packages/control-custom/src',
7 => __DIR__ . '/../..' . '/kirki-packages/control-dashicons/src',
8 => __DIR__ . '/../..' . '/kirki-packages/control-date/src',
9 => __DIR__ . '/../..' . '/kirki-packages/control-dimension/src',
10 => __DIR__ . '/../..' . '/kirki-packages/control-editor/src',
11 => __DIR__ . '/../..' . '/kirki-packages/control-generic/src',
12 => __DIR__ . '/../..' . '/kirki-packages/control-image/src',
13 => __DIR__ . '/../..' . '/kirki-packages/control-multicheck/src',
14 => __DIR__ . '/../..' . '/kirki-packages/control-palette/src',
15 => __DIR__ . '/../..' . '/kirki-packages/control-radio/src',
16 => __DIR__ . '/../..' . '/kirki-packages/control-react-colorful/src',
17 => __DIR__ . '/../..' . '/kirki-packages/control-react-select/src',
18 => __DIR__ . '/../..' . '/kirki-packages/control-repeater/src',
19 => __DIR__ . '/../..' . '/kirki-packages/control-select/src',
20 => __DIR__ . '/../..' . '/kirki-packages/control-slider/src',
21 => __DIR__ . '/../..' . '/kirki-packages/control-sortable/src',
22 => __DIR__ . '/../..' . '/kirki-packages/control-upload/src',
23 => __DIR__ . '/../..' . '/kirki-packages/field/src',
24 => __DIR__ . '/../..' . '/kirki-packages/googlefonts/src',
25 => __DIR__ . '/../..' . '/kirki-packages/l10n/src',
26 => __DIR__ . '/../..' . '/kirki-packages/module-panels/src',
27 => __DIR__ . '/../..' . '/kirki-packages/module-sections/src',
28 => __DIR__ . '/../..' . '/kirki-packages/url-getter/src',
),
'Composer\\Installers\\' =>
array (
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$classMap;
}, null, ClassLoader::class);
}
}
kirki-composer/composer/InstalledVersions.php 0000644 00000037417 14717721153 0015536 0 ustar 00
* Jordi Boggiano
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* 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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @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()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// 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 = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @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} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($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} $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];
}
}
}
}
if (null === self::$installed) {
// 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') {
/** @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} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}
}
kirki-composer/composer/installed.json 0000644 00000060317 14717721153 0014222 0 ustar 00 {
"packages": [
{
"name": "composer/installers",
"version": "v2.2.0",
"version_normalized": "2.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
"reference": "c29dc4b93137acb82734f672c37e029dfbd95b35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35",
"reference": "c29dc4b93137acb82734f672c37e029dfbd95b35",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"composer/composer": "1.6.* || ^2.0",
"composer/semver": "^1 || ^3",
"phpstan/phpstan": "^0.12.55",
"phpstan/phpstan-phpunit": "^0.12.16",
"symfony/phpunit-bridge": "^5.3",
"symfony/process": "^5"
},
"time": "2022-08-20T06:45:11+00:00",
"type": "composer-plugin",
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-main": "2.x-dev"
},
"plugin-modifies-install-path": true
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Composer\\Installers\\": "src/Composer/Installers"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"description": "A multi-framework Composer library installer",
"homepage": "https://composer.github.io/installers/",
"keywords": [
"Dolibarr",
"Eliasis",
"Hurad",
"ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo",
"MantisBT",
"Mautic",
"Maya",
"OXID",
"Plentymarkets",
"Porto",
"RadPHP",
"SMF",
"Starbug",
"Thelia",
"Whmcs",
"WolfCMS",
"agl",
"annotatecms",
"attogram",
"bitrix",
"cakephp",
"chef",
"cockpit",
"codeigniter",
"concrete5",
"croogo",
"dokuwiki",
"drupal",
"eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
"grav",
"installer",
"itop",
"known",
"kohana",
"laravel",
"lavalite",
"lithium",
"magento",
"majima",
"mako",
"matomo",
"mediawiki",
"miaoxing",
"modulework",
"modx",
"moodle",
"osclass",
"pantheon",
"phpbb",
"piwik",
"ppi",
"processwire",
"puppet",
"pxcms",
"reindex",
"roundcube",
"shopware",
"silverstripe",
"sydes",
"sylius",
"tastyigniter",
"wordpress",
"yawik",
"zend",
"zikula"
],
"support": {
"issues": "https://github.com/composer/installers/issues",
"source": "https://github.com/composer/installers/tree/v2.2.0"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"install-path": "./installers"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v1.0.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/composer-installer.git",
"reference": "4be43904336affa5c2f70744a348312336afd0da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da",
"reference": "4be43904336affa5c2f70744a348312336afd0da",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.4",
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
"ext-json": "*",
"ext-zip": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "^9.0",
"yoast/phpunit-polyfills": "^1.0"
},
"time": "2023-01-05T11:28:13+00:00",
"type": "composer-plugin",
"extra": {
"class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Franck Nijhof",
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
"homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
"code quality",
"codesniffer",
"composer",
"installer",
"phpcbf",
"phpcs",
"plugin",
"qa",
"quality",
"standard",
"standards",
"style guide",
"stylecheck",
"tests"
],
"support": {
"issues": "https://github.com/PHPCSStandards/composer-installer/issues",
"source": "https://github.com/PHPCSStandards/composer-installer"
},
"install-path": "../dealerdirect/phpcodesniffer-composer-installer"
},
{
"name": "phpcompatibility/php-compatibility",
"version": "9.3.5",
"version_normalized": "9.3.5.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
"shasum": ""
},
"require": {
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
},
"conflict": {
"squizlabs/php_codesniffer": "2.6.2"
},
"require-dev": {
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"time": "2019-12-27T09:44:58+00:00",
"type": "phpcodesniffer-standard",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"homepage": "https://github.com/wimg",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
}
],
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
"keywords": [
"compatibility",
"phpcs",
"standards"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibility"
},
"install-path": "../phpcompatibility/php-compatibility"
},
{
"name": "phpcompatibility/phpcompatibility-paragonie",
"version": "1.3.2",
"version_normalized": "1.3.2.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
"reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
"reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
"shasum": ""
},
"require": {
"phpcompatibility/php-compatibility": "^9.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"paragonie/random_compat": "dev-master",
"paragonie/sodium_compat": "dev-master"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"time": "2022-10-25T01:46:02+00:00",
"type": "phpcodesniffer-standard",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"role": "lead"
}
],
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
"homepage": "http://phpcompatibility.com/",
"keywords": [
"compatibility",
"paragonie",
"phpcs",
"polyfill",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
},
"install-path": "../phpcompatibility/phpcompatibility-paragonie"
},
{
"name": "phpcompatibility/phpcompatibility-wp",
"version": "2.1.4",
"version_normalized": "2.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
"reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
"reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
"shasum": ""
},
"require": {
"phpcompatibility/php-compatibility": "^9.0",
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"time": "2022-10-24T09:00:36+00:00",
"type": "phpcodesniffer-standard",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
},
{
"name": "Juliette Reinders Folmer",
"role": "lead"
}
],
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
"homepage": "http://phpcompatibility.com/",
"keywords": [
"compatibility",
"phpcs",
"standards",
"static analysis",
"wordpress"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
},
"install-path": "../phpcompatibility/phpcompatibility-wp"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.7.2",
"version_normalized": "3.7.2.0",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"time": "2023-02-22T23:07:41+00:00",
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"install-path": "../squizlabs/php_codesniffer"
},
{
"name": "wp-coding-standards/wpcs",
"version": "2.3.0",
"version_normalized": "2.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
"reference": "7da1894633f168fe244afc6de00d141f27517b62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
"reference": "7da1894633f168fe244afc6de00d141f27517b62",
"shasum": ""
},
"require": {
"php": ">=5.4",
"squizlabs/php_codesniffer": "^3.3.1"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"time": "2020-05-13T23:57:56+00:00",
"type": "phpcodesniffer-standard",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Contributors",
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
"keywords": [
"phpcs",
"standards",
"wordpress"
],
"support": {
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
},
"install-path": "../wp-coding-standards/wpcs"
},
{
"name": "wptrt/wpthemereview",
"version": "dev-develop",
"version_normalized": "dev-develop",
"source": {
"type": "git",
"url": "https://github.com/WPTT/WPThemeReview.git",
"reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WPTT/WPThemeReview/zipball/15684d0852fe90d807c2ae7746dea1302b74b4bd",
"reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd",
"shasum": ""
},
"require": {
"php": ">=5.4",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"squizlabs/php_codesniffer": "^3.3.1",
"wp-coding-standards/wpcs": "^2.2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-parallel-lint/php-console-highlighter": "^0.5",
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0",
"roave/security-advisories": "dev-master"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"time": "2021-06-22T06:10:49+00:00",
"default-branch": true,
"type": "phpcodesniffer-standard",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Theme Review Team",
"homepage": "https://make.wordpress.org/themes/handbook/",
"role": "Strategy and rule setting"
},
{
"name": "Ulrich Pogson",
"homepage": "https://github.com/grappler",
"role": "Lead developer"
},
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "Lead developer"
},
{
"name": "Denis Žoljom",
"homepage": "https://github.com/dingo-d",
"role": "Plugin integration lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org",
"homepage": "https://make.wordpress.org/themes/handbook/review/",
"keywords": [
"phpcs",
"standards",
"themes",
"wordpress"
],
"support": {
"issues": "https://github.com/WPTRT/WPThemeReview/issues",
"source": "https://github.com/WPTRT/WPThemeReview"
},
"install-path": "../wptrt/wpthemereview"
}
],
"dev": true,
"dev-package-names": [
"composer/installers",
"dealerdirect/phpcodesniffer-composer-installer",
"phpcompatibility/php-compatibility",
"phpcompatibility/phpcompatibility-paragonie",
"phpcompatibility/phpcompatibility-wp",
"squizlabs/php_codesniffer",
"wp-coding-standards/wpcs",
"wptrt/wpthemereview"
]
}
kirki-composer/composer/installed.php 0000644 00000007621 14717721153 0014037 0 ustar 00 array(
'name' => 'kirki-framework/kirki',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'composer/installers' => array(
'pretty_version' => 'v2.2.0',
'version' => '2.2.0.0',
'reference' => 'c29dc4b93137acb82734f672c37e029dfbd95b35',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/./installers',
'aliases' => array(),
'dev_requirement' => true,
),
'dealerdirect/phpcodesniffer-composer-installer' => array(
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'reference' => '4be43904336affa5c2f70744a348312336afd0da',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer',
'aliases' => array(),
'dev_requirement' => true,
),
'kirki-framework/kirki' => array(
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'phpcompatibility/php-compatibility' => array(
'pretty_version' => '9.3.5',
'version' => '9.3.5.0',
'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility',
'aliases' => array(),
'dev_requirement' => true,
),
'phpcompatibility/phpcompatibility-paragonie' => array(
'pretty_version' => '1.3.2',
'version' => '1.3.2.0',
'reference' => 'bba5a9dfec7fcfbd679cfaf611d86b4d3759da26',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie',
'aliases' => array(),
'dev_requirement' => true,
),
'phpcompatibility/phpcompatibility-wp' => array(
'pretty_version' => '2.1.4',
'version' => '2.1.4.0',
'reference' => 'b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp',
'aliases' => array(),
'dev_requirement' => true,
),
'squizlabs/php_codesniffer' => array(
'pretty_version' => '3.7.2',
'version' => '3.7.2.0',
'reference' => 'ed8e00df0a83aa96acf703f8c2979ff33341f879',
'type' => 'library',
'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
'aliases' => array(),
'dev_requirement' => true,
),
'wp-coding-standards/wpcs' => array(
'pretty_version' => '2.3.0',
'version' => '2.3.0.0',
'reference' => '7da1894633f168fe244afc6de00d141f27517b62',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
'aliases' => array(),
'dev_requirement' => true,
),
'wptrt/wpthemereview' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '15684d0852fe90d807c2ae7746dea1302b74b4bd',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../wptrt/wpthemereview',
'aliases' => array(
0 => '9999999-dev',
),
'dev_requirement' => true,
),
),
);
lib/class-aricolor.php 0000644 00000070056 14717721153 0010760 0 ustar 00 color = $color;
if ( is_array( $color ) && isset( $color['fallback'] ) ) {
$this->fallback = $color['fallback'];
$this->fallback_obj = self::newColor( $this->fallback );
}
if ( ! method_exists( $this, 'from_' . $mode ) ) {
$mode = $this->get_mode( $color );
}
$this->mode = $mode;
if ( ! $mode ) {
return;
}
$this->mode = $mode;
$method = 'from_' . $mode;
// Call the from_{$color_mode} method.
$this->$method();
}
/**
* Gets an instance for this color.
* We use a separate instance per color
* because there's no need to create a completely new instance each time we call this class.
* Instead using instances helps us improve performance & footprint.
*
* @static
* @access public
* @since 1.0.0
* @param string|array $color The color.
* @param string $mode Mode to be used.
* @return ariColor (object)
*/
public static function newColor( $color, $mode = 'auto' ) {
// Get an md5 for this color.
$color_md5 = ( is_array( $color ) ) ? md5( wp_json_encode( $color ) . $mode ) : md5( $color . $mode );
// Set the instance if it does not already exist.
if ( ! isset( self::$instances[ $color_md5 ] ) ) {
self::$instances[ $color_md5 ] = new self( $color, $mode );
}
return self::$instances[ $color_md5 ];
}
/**
* Alias of the newColor method.
*
* @static
* @access public
* @since 1.1
* @param string|array $color The color.
* @param string $mode Mode to be used.
* @return ariColor (object)
*/
public static function new_color( $color, $mode = 'auto' ) {
return self::newColor( $color, $mode );
}
/**
* Allows us to get a new instance by modifying a property of the existing one.
*
* @access public
* @since 1.0.0
* @param string $property Can be one of the following:
* red,
* green,
* blue,
* alpha,
* hue,
* saturation,
* lightness,
* brightness.
* @param int|float|string $value The new value.
* @return ariColor|null
*/
public function getNew( $property = '', $value = '' ) {
if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) {
// Check if we're changing any of the rgba values.
$value = max( 0, min( 255, $value ) );
if ( 'red' === $property ) {
return self::new_color( 'rgba(' . $value . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
} elseif ( 'green' === $property ) {
return self::new_color( 'rgba(' . $this->red . ',' . $value . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
} elseif ( 'blue' === $property ) {
return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $value . ',' . $this->alpha . ')', 'rgba' );
} elseif ( 'alpha' === $property ) {
return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $value . ')', 'rgba' );
}
} elseif ( in_array( $property, array( 'hue', 'saturation', 'lightness' ), true ) ) {
// Check if we're changing any of the hsl values.
$value = ( 'hue' === $property ) ? max( 0, min( 360, $value ) ) : max( 0, min( 100, $value ) );
if ( 'hue' === $property ) {
return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
} elseif ( 'saturation' === $property ) {
return self::new_color( 'hsla(' . $this->hue . ',' . $value . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
} elseif ( 'lightness' === $property ) {
return self::new_color( 'hsla(' . $this->hue . ',' . $this->saturation . '%,' . $value . '%,' . $this->alpha . ')', 'hsla' );
}
} elseif ( 'brightness' === $property ) {
// Check if we're changing the brightness.
if ( $value < $this->brightness['total'] ) {
$red = max( 0, min( 255, $this->red - ( $this->brightness['total'] - $value ) ) );
$green = max( 0, min( 255, $this->green - ( $this->brightness['total'] - $value ) ) );
$blue = max( 0, min( 255, $this->blue - ( $this->brightness['total'] - $value ) ) );
} elseif ( $value > $this->brightness['total'] ) {
$red = max( 0, min( 255, $this->red + ( $value - $this->brightness['total'] ) ) );
$green = max( 0, min( 255, $this->green + ( $value - $this->brightness['total'] ) ) );
$blue = max( 0, min( 255, $this->blue + ( $value - $this->brightness['total'] ) ) );
} else {
// If it's not smaller and it's not greater, then it's equal.
return $this;
}
return self::new_color( 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')', 'rgba' );
}
return null;
}
/**
* Allias for the getNew method.
*
* @access public
* @since 1.1.0
* @param string $property Can be one of the following:
* red,
* green,
* blue,
* alpha,
* hue,
* saturation,
* lightness,
* brightness.
* @param int|float|string $value The new value.
* @return ariColor|null
*/
public function get_new( $property = '', $value = '' ) {
return $this->getNew( $property, $value );
}
/**
* Figure out what mode we're using.
*
* @access public
* @since 1.0.0
* @param string|array $color The color we're querying.
* @return string
*/
public function get_mode( $color ) {
// Check if value is an array.
if ( is_array( $color ) ) {
// Does the array have an 'rgba' key?
if ( isset( $color['rgba'] ) ) {
$this->color = $color['rgba'];
return 'rgba';
} elseif ( isset( $color['color'] ) ) {
// Does the array have a 'color' key?
$this->color = $color['color'];
if ( is_string( $color['color'] ) && false !== strpos( $color['color'], 'rgba' ) ) {
return 'rgba';
}
return 'hex';
}
// Is this a simple array with 4 items?
if ( 4 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) && isset( $color[3] ) ) {
$this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',' . intval( $color[3] ) . ')';
return 'rgba';
} elseif ( 3 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) ) {
// Is this a simple array with 3 items?
$this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',1)';
return 'rgba';
}
// Check for other keys in the array and get values from there.
$finders_keepers = array(
'r' => 'red',
'g' => 'green',
'b' => 'blue',
'a' => 'alpha',
'red' => 'red',
'green' => 'green',
'blue' => 'blue',
'alpha' => 'alpha',
'opacity' => 'alpha',
);
$found = false;
foreach ( $finders_keepers as $finder => $keeper ) {
if ( isset( $color[ $finder ] ) ) {
$found = true;
$this->$keeper = $color[ $finder ];
}
}
// We failed, use fallback.
if ( ! $found ) {
$this->from_fallback();
return $this->mode;
}
// We did not fail, so use rgba values recovered above.
$this->color = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
return 'rgba';
}
// If a string and 3 or 6 characters long, add # since it's a hex.
if ( 3 === strlen( $this->color ) || 6 === strlen( $this->color ) && false === strpos( $this->color, '#' ) ) {
$this->color = '#' . $this->color;
$color = $this->color;
}
// If we got this far, it's not an array.
// Check for key identifiers in the value.
$finders_keepers = array(
'#' => 'hex',
'rgba' => 'rgba',
'rgb' => 'rgb',
'hsla' => 'hsla',
'hsl' => 'hsl',
);
foreach ( $finders_keepers as $finder => $keeper ) {
if ( false !== strrpos( $color, $finder ) ) {
// Make sure hex colors have 6 digits and not more.
if ( '#' === $finder && 7 < strlen( $color ) ) {
$this->color = substr( $color, 0, 7 );
}
return $keeper;
}
}
// Perhaps we're using a word like "orange"?
$wordcolors = $this->get_word_colors();
if ( is_string( $color ) && array_key_exists( $color, $wordcolors ) ) {
$this->color = '#' . $wordcolors[ $color ];
return 'hex';
}
// Fallback to hex.
$this->color = $this->fallback;
return 'hex';
}
/**
* Starts with a HEX color and calculates all other properties.
*
* @access protected
* @since 1.0.0
* @return null
*/
protected function from_hex() {
if ( ! function_exists( 'sanitize_hex_color' ) ) {
require_once wp_normalize_path( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
}
// Is this perhaps a word-color?
$word_colors = $this->get_word_colors();
if ( array_key_exists( $this->color, $word_colors ) ) {
$this->color = '#' . $word_colors[ $this->color ];
}
// Sanitize color.
$this->hex = sanitize_hex_color( maybe_hash_hex_color( $this->color ) );
$hex = ltrim( $this->hex, '#' );
// Fallback if needed.
if ( ! $hex || 3 > strlen( $hex ) ) {
$this->from_fallback();
return;
}
// Make sure we have 6 digits for the below calculations.
if ( 3 === strlen( $hex ) ) {
$hex = ltrim( $this->hex, '#' );
$hex = substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 2, 1 ) . substr( $hex, 2, 1 );
}
// Set red, green, blue.
$this->red = hexdec( substr( $hex, 0, 2 ) );
$this->green = hexdec( substr( $hex, 2, 2 ) );
$this->blue = hexdec( substr( $hex, 4, 2 ) );
$this->alpha = 1;
// Set other color properties.
$this->set_brightness();
$this->set_hsl();
$this->set_luminance();
}
/**
* Starts with an RGB color and calculates all other properties.
*
* @access protected
* @since 1.0.0
* @return null
*/
protected function from_rgb() {
$value = explode( ',', str_replace( array( ' ', 'rgb', '(', ')' ), '', $this->color ) );
// Set red, green, blue.
$this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
$this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
$this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
$this->alpha = 1;
// Set the hex.
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
// Set other color properties.
$this->set_brightness();
$this->set_hsl();
$this->set_luminance();
}
/**
* Starts with an RGBA color and calculates all other properties.
*
* @access protected
* @since 1.0.0
* @return null
*/
protected function from_rgba() {
// Set r, g, b, a properties.
$value = explode( ',', str_replace( array( ' ', 'rgba', '(', ')' ), '', $this->color ) );
$this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
$this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
$this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
$this->alpha = ( isset( $value[3] ) ) ? filter_var( $value[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1;
// Limit values in the range of 0 - 255.
$this->red = max( 0, min( 255, $this->red ) );
$this->green = max( 0, min( 255, $this->green ) );
$this->blue = max( 0, min( 255, $this->blue ) );
// Limit values 0 - 1.
$this->alpha = max( 0, min( 1, $this->alpha ) );
// Set hex.
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
// Set other color properties.
$this->set_brightness();
$this->set_hsl();
$this->set_luminance();
}
/**
* Starts with an HSL color and calculates all other properties.
*
* @access protected
* @since 1.0.0
* @return null
*/
protected function from_hsl() {
$value = explode( ',', str_replace( array( ' ', 'hsl', '(', ')', '%' ), '', $this->color ) );
$this->hue = $value[0];
$this->saturation = $value[1];
$this->lightness = $value[2];
$this->from_hsl_array();
}
/**
* Starts with an HSLA color and calculates all other properties.
*
* @access protected
* @since 1.0.0
* @return null
*/
protected function from_hsla() {
$value = explode( ',', str_replace( array( ' ', 'hsla', '(', ')', '%' ), '', $this->color ) );
$this->hue = $value[0];
$this->saturation = $value[1];
$this->lightness = $value[2];
$this->alpha = $value[3];
$this->from_hsl_array();
}
/**
* Generates the HEX value of a color given values for $red, $green, $blue.
*
* @access protected
* @since 1.0.0
* @param int|string $red The red value of this color.
* @param int|string $green The green value of this color.
* @param int|string $blue The blue value of this color.
* @return string
*/
protected function rgb_to_hex( $red, $green, $blue ) {
// Get hex values properly formatted.
$hex_red = $this->dexhex_double_digit( $red );
$hex_green = $this->dexhex_double_digit( $green );
$hex_blue = $this->dexhex_double_digit( $blue );
return '#' . $hex_red . $hex_green . $hex_blue;
}
/**
* Convert a decimal value to hex and make sure it's 2 characters.
*
* @access protected
* @since 1.0.0
* @param int|string $value The value to convert.
* @return string
*/
protected function dexhex_double_digit( $value ) {
$value = dechex( $value );
if ( 1 === strlen( $value ) ) {
$value = '0' . $value;
}
return $value;
}
/**
* Calculates the red, green, blue values of an HSL color.
*
* @access protected
* @since 1.0.0
* @see https://gist.github.com/brandonheyer/5254516
*/
protected function from_hsl_array() {
$h = $this->hue / 360;
$s = $this->saturation / 100;
$l = $this->lightness / 100;
$r = $l;
$g = $l;
$b = $l;
$v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );
if ( $v > 0 ) {
$m = $l + $l - $v;
$sv = ( $v - $m ) / $v;
$h *= 6.0;
$sextant = floor( $h );
$fract = $h - $sextant;
$vsf = $v * $sv * $fract;
$mid1 = $m + $vsf;
$mid2 = $v - $vsf;
switch ( $sextant ) {
case 0:
$r = $v;
$g = $mid1;
$b = $m;
break;
case 1:
$r = $mid2;
$g = $v;
$b = $m;
break;
case 2:
$r = $m;
$g = $v;
$b = $mid1;
break;
case 3:
$r = $m;
$g = $mid2;
$b = $v;
break;
case 4:
$r = $mid1;
$g = $m;
$b = $v;
break;
case 5:
$r = $v;
$g = $m;
$b = $mid2;
break;
}
}
$this->red = round( $r * 255, 0 );
$this->green = round( $g * 255, 0 );
$this->blue = round( $b * 255, 0 );
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
$this->set_luminance();
}
/**
* Returns a CSS-formatted value for colors.
*
* @access public
* @since 1.0.0
* @param string $mode The mode we're using.
* @return string
*/
public function toCSS( $mode = 'hex' ) {
$value = '';
switch ( $mode ) {
case 'hex':
$value = strtolower( $this->hex );
break;
case 'rgba':
$value = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
break;
case 'rgb':
$value = 'rgb(' . $this->red . ',' . $this->green . ',' . $this->blue . ')';
break;
case 'hsl':
$value = 'hsl(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%)';
break;
case 'hsla':
$value = 'hsla(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%,' . $this->alpha . ')';
break;
}
return $value;
}
/**
* Alias for the toCSS method.
*
* @access public
* @since 1.1
* @param string $mode The mode we're using.
* @return string
*/
public function to_css( $mode = 'hex' ) {
return $this->toCSS( $mode );
}
/**
* Sets the HSL values of a color based on the values of red, green, blue.
*
* @access public
* @since 1.0.0
*/
protected function set_hsl() {
$red = $this->red / 255;
$green = $this->green / 255;
$blue = $this->blue / 255;
$max = max( $red, $green, $blue );
$min = min( $red, $green, $blue );
$lightness = ( $max + $min ) / 2;
$difference = $max - $min;
if ( ! $difference ) {
$hue = $saturation = 0; // Achromatic.
} else {
$saturation = $difference / ( 1 - abs( 2 * $lightness - 1 ) );
switch ( $max ) {
case $red:
$hue = 60 * fmod( ( ( $green - $blue ) / $difference ), 6 );
if ( $blue > $green ) {
$hue += 360;
}
break;
case $green:
$hue = 60 * ( ( $blue - $red ) / $difference + 2 );
break;
case $blue:
$hue = 60 * ( ( $red - $green ) / $difference + 4 );
break;
}
}
$this->hue = round( $hue );
$this->saturation = round( $saturation * 100 );
$this->lightness = round( $lightness * 100 );
}
/**
* Sets the brightness of a color based on the values of red, green, blue.
*
* @access protected
* @since 1.0.0
*/
protected function set_brightness() {
$this->brightness = array(
'red' => round( $this->red * .299 ),
'green' => round( $this->green * .587 ),
'blue' => round( $this->blue * .114 ),
'total' => intval( ( $this->red * .299 ) + ( $this->green * .587 ) + ( $this->blue * .114 ) ),
);
}
/**
* Sets the luminance of a color (range:0-255) based on the values of red, green, blue.
*
* @access protected
* @since 1.0.0
*/
protected function set_luminance() {
$lum = ( 0.2126 * $this->red ) + ( 0.7152 * $this->green ) + ( 0.0722 * $this->blue );
$this->luminance = round( $lum );
}
/**
* Gets an array of all the wordcolors.
*
* @access protected
* @since 1.0.0
* @return array
*/
protected function get_word_colors() {
return array(
'aliceblue' => 'F0F8FF',
'antiquewhite' => 'FAEBD7',
'aqua' => '00FFFF',
'aquamarine' => '7FFFD4',
'azure' => 'F0FFFF',
'beige' => 'F5F5DC',
'bisque' => 'FFE4C4',
'black' => '000000',
'blanchedalmond' => 'FFEBCD',
'blue' => '0000FF',
'blueviolet' => '8A2BE2',
'brown' => 'A52A2A',
'burlywood' => 'DEB887',
'cadetblue' => '5F9EA0',
'chartreuse' => '7FFF00',
'chocolate' => 'D2691E',
'coral' => 'FF7F50',
'cornflowerblue' => '6495ED',
'cornsilk' => 'FFF8DC',
'crimson' => 'DC143C',
'cyan' => '00FFFF',
'darkblue' => '00008B',
'darkcyan' => '008B8B',
'darkgoldenrod' => 'B8860B',
'darkgray' => 'A9A9A9',
'darkgreen' => '006400',
'darkgrey' => 'A9A9A9',
'darkkhaki' => 'BDB76B',
'darkmagenta' => '8B008B',
'darkolivegreen' => '556B2F',
'darkorange' => 'FF8C00',
'darkorchid' => '9932CC',
'darkred' => '8B0000',
'darksalmon' => 'E9967A',
'darkseagreen' => '8FBC8F',
'darkslateblue' => '483D8B',
'darkslategray' => '2F4F4F',
'darkslategrey' => '2F4F4F',
'darkturquoise' => '00CED1',
'darkviolet' => '9400D3',
'deeppink' => 'FF1493',
'deepskyblue' => '00BFFF',
'dimgray' => '696969',
'dimgrey' => '696969',
'dodgerblue' => '1E90FF',
'firebrick' => 'B22222',
'floralwhite' => 'FFFAF0',
'forestgreen' => '228B22',
'fuchsia' => 'FF00FF',
'gainsboro' => 'DCDCDC',
'ghostwhite' => 'F8F8FF',
'gold' => 'FFD700',
'goldenrod' => 'DAA520',
'gray' => '808080',
'green' => '008000',
'greenyellow' => 'ADFF2F',
'grey' => '808080',
'honeydew' => 'F0FFF0',
'hotpink' => 'FF69B4',
'indianred' => 'CD5C5C',
'indigo' => '4B0082',
'ivory' => 'FFFFF0',
'khaki' => 'F0E68C',
'lavender' => 'E6E6FA',
'lavenderblush' => 'FFF0F5',
'lawngreen' => '7CFC00',
'lemonchiffon' => 'FFFACD',
'lightblue' => 'ADD8E6',
'lightcoral' => 'F08080',
'lightcyan' => 'E0FFFF',
'lightgoldenrodyellow' => 'FAFAD2',
'lightgray' => 'D3D3D3',
'lightgreen' => '90EE90',
'lightgrey' => 'D3D3D3',
'lightpink' => 'FFB6C1',
'lightsalmon' => 'FFA07A',
'lightseagreen' => '20B2AA',
'lightskyblue' => '87CEFA',
'lightslategray' => '778899',
'lightslategrey' => '778899',
'lightsteelblue' => 'B0C4DE',
'lightyellow' => 'FFFFE0',
'lime' => '00FF00',
'limegreen' => '32CD32',
'linen' => 'FAF0E6',
'magenta' => 'FF00FF',
'maroon' => '800000',
'mediumaquamarine' => '66CDAA',
'mediumblue' => '0000CD',
'mediumorchid' => 'BA55D3',
'mediumpurple' => '9370D0',
'mediumseagreen' => '3CB371',
'mediumslateblue' => '7B68EE',
'mediumspringgreen' => '00FA9A',
'mediumturquoise' => '48D1CC',
'mediumvioletred' => 'C71585',
'midnightblue' => '191970',
'mintcream' => 'F5FFFA',
'mistyrose' => 'FFE4E1',
'moccasin' => 'FFE4B5',
'navajowhite' => 'FFDEAD',
'navy' => '000080',
'oldlace' => 'FDF5E6',
'olive' => '808000',
'olivedrab' => '6B8E23',
'orange' => 'FFA500',
'orangered' => 'FF4500',
'orchid' => 'DA70D6',
'palegoldenrod' => 'EEE8AA',
'palegreen' => '98FB98',
'paleturquoise' => 'AFEEEE',
'palevioletred' => 'DB7093',
'papayawhip' => 'FFEFD5',
'peachpuff' => 'FFDAB9',
'peru' => 'CD853F',
'pink' => 'FFC0CB',
'plum' => 'DDA0DD',
'powderblue' => 'B0E0E6',
'purple' => '800080',
'red' => 'FF0000',
'rosybrown' => 'BC8F8F',
'royalblue' => '4169E1',
'saddlebrown' => '8B4513',
'salmon' => 'FA8072',
'sandybrown' => 'F4A460',
'seagreen' => '2E8B57',
'seashell' => 'FFF5EE',
'sienna' => 'A0522D',
'silver' => 'C0C0C0',
'skyblue' => '87CEEB',
'slateblue' => '6A5ACD',
'slategray' => '708090',
'slategrey' => '708090',
'snow' => 'FFFAFA',
'springgreen' => '00FF7F',
'steelblue' => '4682B4',
'tan' => 'D2B48C',
'teal' => '008080',
'thistle' => 'D8BFD8',
'tomato' => 'FF6347',
'turquoise' => '40E0D0',
'violet' => 'EE82EE',
'wheat' => 'F5DEB3',
'white' => 'FFFFFF',
'whitesmoke' => 'F5F5F5',
'yellow' => 'FFFF00',
'yellowgreen' => '9ACD32',
);
}
/**
* Use fallback object.
*
* @access protected
* @since 1.2.0
*/
protected function from_fallback() {
$this->color = $this->fallback;
if ( ! $this->fallback_obj ) {
$this->fallback_obj = self::newColor( $this->fallback );
}
$this->color = $this->fallback_obj->color;
$this->mode = $this->fallback_obj->mode;
$this->red = $this->fallback_obj->red;
$this->green = $this->fallback_obj->green;
$this->blue = $this->fallback_obj->blue;
$this->alpha = $this->fallback_obj->alpha;
$this->hue = $this->fallback_obj->hue;
$this->saturation = $this->fallback_obj->saturation;
$this->lightness = $this->fallback_obj->lightness;
$this->luminance = $this->fallback_obj->luminance;
$this->hex = $this->fallback_obj->hex;
}
/**
* Handle non-existing public methods.
*
* @access public
* @since 1.1.0
* @param string $name The method name.
* @param mixed $arguments The method arguments.
* @return mixed
*/
public function __call( $name, $arguments ) {
if ( method_exists( $this, $name ) ) {
call_user_func( array( $this, $name ), $arguments );
} else {
return $arguments;
}
}
/**
* Handle non-existing public static methods.
*
* @static
* @access public
* @since 1.1.0
* @param string $name The method name.
* @param mixed $arguments The method arguments.
* @return mixed
*/
public static function __callStatic( $name, $arguments ) {
if ( method_exists( __CLASS__, $name ) ) {
call_user_func( array( __CLASS__, $name ), $arguments );
} else {
return $arguments;
}
}
}
}
lib/class-kirki-color.php 0000644 00000025212 14717721153 0011365 0 ustar 00 mode;
}
return $obj->toCSS( $mode );
}
/**
* Gets the rgb value of a color.
*
* @static
* @access public
* @param string $color The color.
* @param boolean $implode Whether we want to implode the values or not.
* @return array|string
*/
public static function get_rgb( $color, $implode = false ) {
$obj = ariColor::newColor( $color );
if ( $implode ) {
return $obj->toCSS( 'rgb' );
}
return array( $obj->red, $obj->green, $obj->blue );
}
/**
* A proxy for the sanitize_color method.
*
* @static
* @access public
* @param string|array $color The color to convert.
* @return string The hex value of the color.
*/
public static function rgba2hex( $color ) {
return self::sanitize_color( $color, 'hex' );
}
/**
* Get the alpha channel from an rgba color.
*
* @static
* @access public
* @param string $color The rgba color formatted like rgba(r,g,b,a).
* @return int|float The alpha value of the color.
*/
public static function get_alpha_from_rgba( $color ) {
$obj = ariColor::newColor( $color );
return $obj->alpha;
}
/**
* Gets the rgba value of the $color.
*
* @static
* @access public
* @param string $color The hex value of a color.
* @param int|float $alpha Opacity level (0-1).
* @return string
*/
public static function get_rgba( $color = '#fff', $alpha = 1 ) {
$obj = ariColor::newColor( $color );
if ( 1 == $alpha ) {
return $obj->toCSS( 'rgba' );
}
// Make sure that opacity is properly formatted.
// Converts 1-100 values to 0-1.
if ( $alpha > 1 || $alpha < -1 ) {
// Divide by 100.
$alpha /= 100;
}
// Get absolute value.
$alpha = abs( $alpha );
// Max 1.
if ( 1 < $alpha ) {
$alpha = 1;
}
$new_obj = $obj->getNew( 'alpha', $alpha );
return $new_obj->toCSS( 'rgba' );
}
/**
* Strips the alpha value from an RGBA color string.
*
* @static
* @access public
* @param string $color The RGBA color string.
* @return string The corresponding RGB string.
*/
public static function rgba_to_rgb( $color ) {
$obj = ariColor::newColor( $color );
return $obj->toCSS( 'rgb' );
}
/**
* Gets the brightness of the $hex color.
*
* @static
* @access public
* @param string $hex The hex value of a color.
* @return int Value between 0 and 255.
*/
public static function get_brightness( $hex ) {
$hex = self::sanitize_hex( $hex, false );
// Returns brightness value from 0 to 255.
return intval( ( ( hexdec( substr( $hex, 0, 2 ) ) * 299 ) + ( hexdec( substr( $hex, 2, 2 ) ) * 587 ) + ( hexdec( substr( $hex, 4, 2 ) ) * 114 ) ) / 1000 );
}
/**
* Adjusts brightness of the $hex color.
*
* @static
* @access public
* @param string $hex The hex value of a color.
* @param integer $steps Should be between -255 and 255. Negative = darker, positive = lighter.
* @return string Returns hex color.
*/
public static function adjust_brightness( $hex, $steps ) {
$hex = self::sanitize_hex( $hex, false );
$steps = max( -255, min( 255, $steps ) );
// Adjust number of steps and keep it inside 0 to 255.
$red = max( 0, min( 255, hexdec( substr( $hex, 0, 2 ) ) + $steps ) );
$green = max( 0, min( 255, hexdec( substr( $hex, 2, 2 ) ) + $steps ) );
$blue = max( 0, min( 255, hexdec( substr( $hex, 4, 2 ) ) + $steps ) );
$red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT );
$green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT );
$blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT );
return self::sanitize_hex( $red_hex . $green_hex . $blue_hex );
}
/**
* Mixes 2 hex colors.
* The "percentage" variable is the percent of the first color.
* to be used it the mix. default is 50 (equal mix).
*
* @static
* @access public
* @param string|false $hex1 Color.
* @param string|false $hex2 Color.
* @param int $percentage A value between 0 and 100.
* @return string Returns hex color.
*/
public static function mix_colors( $hex1, $hex2, $percentage ) {
$hex1 = self::sanitize_hex( $hex1, false );
$hex2 = self::sanitize_hex( $hex2, false );
$red = ( $percentage * hexdec( substr( $hex1, 0, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 0, 2 ) ) ) / 100;
$green = ( $percentage * hexdec( substr( $hex1, 2, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 2, 2 ) ) ) / 100;
$blue = ( $percentage * hexdec( substr( $hex1, 4, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 4, 2 ) ) ) / 100;
$red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT );
$green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT );
$blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT );
return self::sanitize_hex( $red_hex . $green_hex . $blue_hex );
}
/**
* Convert hex color to hsv.
*
* @static
* @access public
* @param string $hex The hex value of color 1.
* @return array Returns array( 'h', 's', 'v' ).
*/
public static function hex_to_hsv( $hex ) {
$rgb = (array) (array) self::get_rgb( self::sanitize_hex( $hex, false ) );
return self::rgb_to_hsv( $rgb );
}
/**
* Convert hex color to hsv.
*
* @static
* @access public
* @param string $color The rgb color to convert array( 'r', 'g', 'b' ).
* @return array Returns array( 'h', 's', 'v' ).
*/
public static function rgb_to_hsv( $color = array() ) {
$var_r = ( $color[0] / 255 );
$var_g = ( $color[1] / 255 );
$var_b = ( $color[2] / 255 );
$var_min = min( $var_r, $var_g, $var_b );
$var_max = max( $var_r, $var_g, $var_b );
$del_max = $var_max - $var_min;
$h = 0;
$s = 0;
$v = $var_max;
if ( 0 != $del_max ) {
$s = $del_max / $var_max;
$del_r = ( ( ( $var_max - $var_r ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
$del_g = ( ( ( $var_max - $var_g ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
$del_b = ( ( ( $var_max - $var_b ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
if ( $var_r == $var_max ) {
$h = $del_b - $del_g;
} elseif ( $var_g == $var_max ) {
$h = ( 1 / 3 ) + $del_r - $del_b;
} elseif ( $var_b == $var_max ) {
$h = ( 2 / 3 ) + $del_g - $del_r;
}
if ( $h < 0 ) {
$h++;
}
if ( $h > 1 ) {
$h--;
}
}
return array(
'h' => round( $h, 2 ),
's' => round( $s, 2 ),
'v' => round( $v, 2 ),
);
}
/**
* This is a very simple algorithm that works by summing up the differences between the three color components red, green and blue.
* A value higher than 500 is recommended for good readability.
*
* @static
* @access public
* @param string $color_1 The 1st color.
* @param string $color_2 The 2nd color.
* @return string
*/
public static function color_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
$color_1 = self::sanitize_hex( $color_1, false );
$color_2 = self::sanitize_hex( $color_2, false );
$color_1_rgb = self::get_rgb( $color_1 );
$color_2_rgb = self::get_rgb( $color_2 );
$r_diff = max( $color_1_rgb[0], $color_2_rgb[0] ) - min( $color_1_rgb[0], $color_2_rgb[0] );
$g_diff = max( $color_1_rgb[1], $color_2_rgb[1] ) - min( $color_1_rgb[1], $color_2_rgb[1] );
$b_diff = max( $color_1_rgb[2], $color_2_rgb[2] ) - min( $color_1_rgb[2], $color_2_rgb[2] );
$color_diff = $r_diff + $g_diff + $b_diff;
return $color_diff;
}
/**
* This function tries to compare the brightness of the colors.
* A return value of more than 125 is recommended.
* Combining it with the color_difference function above might make sense.
*
* @static
* @access public
* @param string $color_1 The 1st color.
* @param string $color_2 The 2nd color.
* @return string
*/
public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
$color_1 = self::sanitize_hex( $color_1, false );
$color_2 = self::sanitize_hex( $color_2, false );
$color_1_rgb = self::get_rgb( $color_1 );
$color_2_rgb = self::get_rgb( $color_2 );
$br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000;
$br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000;
return intval( abs( $br_1 - $br_2 ) );
}
/**
* Uses the luminosity to calculate the difference between the given colors.
* The returned value should be bigger than 5 for best readability.
*
* @static
* @access public
* @param string $color_1 The 1st color.
* @param string $color_2 The 2nd color.
* @return string
*/
public static function lumosity_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
$color_1 = self::sanitize_hex( $color_1, false );
$color_2 = self::sanitize_hex( $color_2, false );
$color_1_rgb = self::get_rgb( $color_1 );
$color_2_rgb = self::get_rgb( $color_2 );
$l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 );
$l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 );
$lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 );
return round( $lum_diff, 2 );
}
}
inc/bootstrap.php 0000644 00000000406 14717721153 0010053 0 ustar 00 3+͝;.n0SMXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&=owGyyP^;4n_W]n9_/a]?~gUrUczl̠> IENDB` assets/images/kirki-logo.jpg 0000644 00000027454 14717721153 0012110 0 ustar 00 JFIF H H C C
1
!"1#9vA2:
> !"1A2Q# 7Rqr$5Bat%6b ? 4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1"o2SvWyNn#*gk7,5Wh.Lr4`U67?K\jJhvH3ۢIqmB]fM )RP- &E*-5*E-b3)"=Y##F߇>x9?5[*dujMKzDpW
+5䙝A0.@p(CS;kbkާyyec1x͓y|,!9Ǚ#Q!*~3M1%<