Version Description
- January 24, 2022
- update WP Dependency Installer library
- tested up to WP 5.9
Download this release
Release Info
Developer | senlin |
Plugin | Classic Editor Addon |
Version | 2.6.4 |
Comparing to | |
See all releases |
Code changes from version 2.6.3 to 2.6.4
- assets/icon-256x256.png +0 -0
- assets/icon-512x512.png +0 -0
- classic-editor-addon.php +2 -2
- composer.json +0 -5
- readme.txt +9 -3
- vendor/afragen/wp-dependency-installer/README.md +6 -40
- vendor/afragen/wp-dependency-installer/composer.json +5 -4
- vendor/afragen/wp-dependency-installer/composer.lock +63 -0
- vendor/afragen/wp-dependency-installer/example-plugin/test-dependency-installer.php +0 -25
- vendor/afragen/wp-dependency-installer/wp-dependencies-example.json +0 -42
- vendor/afragen/wp-dependency-installer/wp-dependency-installer-skin.php +59 -0
- vendor/afragen/wp-dependency-installer/wp-dependency-installer.php +118 -57
- vendor/afragen/wp-dismiss-notice/LICENSE +21 -0
- vendor/afragen/wp-dismiss-notice/README.md +20 -0
- vendor/afragen/wp-dismiss-notice/composer.json +28 -0
- vendor/afragen/wp-dismiss-notice/js/dismiss-notice.js +40 -0
- vendor/afragen/wp-dismiss-notice/wp-dismiss-notice.php +142 -0
- vendor/collizo4sky/persist-admin-notices-dismissal/README.md +0 -108
- vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js +0 -29
- vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php +0 -119
- vendor/composer/ClassLoader.php +146 -19
- vendor/composer/InstalledVersions.php +350 -0
- vendor/composer/autoload_classmap.php +3 -1
- vendor/composer/autoload_files.php +0 -10
- vendor/composer/autoload_psr4.php +0 -1
- vendor/composer/autoload_real.php +7 -20
- vendor/composer/autoload_static.php +3 -21
- vendor/composer/installed.json +112 -199
- vendor/composer/installed.php +41 -0
- vendor/composer/platform_check.php +26 -0
assets/icon-256x256.png
DELETED
Binary file
|
assets/icon-512x512.png
DELETED
Binary file
|
classic-editor-addon.php
CHANGED
@@ -4,10 +4,10 @@
|
|
4 |
* Description: This free "Classic Editor Addon" plugin makes sure that the new block editor cannot be accidentally activated and blocks the calls to additional styles from the <code><head></code> (frontend). See README for details.
|
5 |
|
6 |
* Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
|
7 |
-
* Version: 2.6.
|
8 |
|
9 |
* Requires at least: 4.9
|
10 |
-
* Tested up to: 5.
|
11 |
|
12 |
* License: GPL-3.0+
|
13 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
4 |
* Description: This free "Classic Editor Addon" plugin makes sure that the new block editor cannot be accidentally activated and blocks the calls to additional styles from the <code><head></code> (frontend). See README for details.
|
5 |
|
6 |
* Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
|
7 |
+
* Version: 2.6.4
|
8 |
|
9 |
* Requires at least: 4.9
|
10 |
+
* Tested up to: 5.9.0
|
11 |
|
12 |
* License: GPL-3.0+
|
13 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
composer.json
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"require": {
|
3 |
-
"afragen/wp-dependency-installer": "^1.4"
|
4 |
-
}
|
5 |
-
}
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: senlin, gschoppe
|
|
3 |
Tags: gutenberg, block editor, classic editor, addon, wordpress 5.0, woocommerce
|
4 |
Requires at least: 4.9
|
5 |
Requires PHP: 5.6
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.6.
|
8 |
License: GPL-3.0+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
@@ -17,7 +17,7 @@ This free "Classic Editor Addon" plugin makes sure that the new block editor can
|
|
17 |
The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for the new editing experience that has been introduced in WordPress 5.0. Install it now on sites and the UX remains the same as you are used to!
|
18 |
|
19 |
<strong>What's New:</strong>
|
20 |
-
|
21 |
|
22 |
Please pay attention that the minimum PHP version to use our plugin is <strong>5.6</strong>.
|
23 |
|
@@ -63,6 +63,12 @@ Please open an issue on [Github](https://github.com/senlin/classic-editor-addon/
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 2.6.3 =
|
67 |
|
68 |
* August 3, 2020
|
3 |
Tags: gutenberg, block editor, classic editor, addon, wordpress 5.0, woocommerce
|
4 |
Requires at least: 4.9
|
5 |
Requires PHP: 5.6
|
6 |
+
Tested up to: 5.9
|
7 |
+
Stable tag: 2.6.4
|
8 |
License: GPL-3.0+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
17 |
The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for the new editing experience that has been introduced in WordPress 5.0. Install it now on sites and the UX remains the same as you are used to!
|
18 |
|
19 |
<strong>What's New:</strong>
|
20 |
+
Security update
|
21 |
|
22 |
Please pay attention that the minimum PHP version to use our plugin is <strong>5.6</strong>.
|
23 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 2.6.4 =
|
67 |
+
|
68 |
+
* January 24, 2022
|
69 |
+
* update WP Dependency Installer library
|
70 |
+
* tested up to WP 5.9
|
71 |
+
|
72 |
= 2.6.3 =
|
73 |
|
74 |
* August 3, 2020
|
vendor/afragen/wp-dependency-installer/README.md
CHANGED
@@ -17,6 +17,8 @@ See also: [example plugin](https://github.com/afragen/wp-dependency-installer-ex
|
|
17 |
|
18 |
You can use **composer** to install this package within your WordPress plugin / theme.
|
19 |
|
|
|
|
|
20 |
1. Within your plugin or theme root folder, run the following command:
|
21 |
|
22 |
```shell
|
@@ -28,10 +30,10 @@ composer require afragen/wp-dependency-installer
|
|
28 |
```js
|
29 |
[
|
30 |
{
|
31 |
-
"name": "
|
32 |
"host": "github",
|
33 |
-
"slug": "
|
34 |
-
"uri": "afragen/
|
35 |
"branch": "develop",
|
36 |
"required": true,
|
37 |
"token": null
|
@@ -60,48 +62,12 @@ You will then need to update `wp-dependencies.json` to suit your requirements.
|
|
60 |
```php
|
61 |
require_once __DIR__ . '/vendor/autoload.php';
|
62 |
WP_Dependency_Installer::instance( __DIR__ )->run();
|
63 |
-
|
64 |
-
// Needed in theme's functions.php file.
|
65 |
-
add_filter( 'pand_theme_loader', '__return_true' );
|
66 |
```
|
67 |
|
68 |
4. (optional) Take a look at some of built in [Hooks](https://github.com/afragen/wp-dependency-installer/wiki/Actions-and-Hooks) and [Functions](https://github.com/afragen/wp-dependency-installer/wiki/Helper-Functions) to further customize your plugin look and behaviour:
|
69 |
|
70 |
-
```php
|
71 |
-
/**
|
72 |
-
* Display your plugin or theme name in dismissable notices.
|
73 |
-
*/
|
74 |
-
add_filter(
|
75 |
-
'wp_dependency_dismiss_label',
|
76 |
-
function( $label, $source ) {
|
77 |
-
$label = basename( __DIR__ ) !== $source ? $label : __( 'Group Plugin Installer', 'group-plugin-installer' );
|
78 |
-
return $label;
|
79 |
-
}, 10, 2
|
80 |
-
);
|
81 |
-
```
|
82 |
-
|
83 |
-
5. Sanity Check
|
84 |
-
|
85 |
-
```php
|
86 |
-
// Sanity check for WPDI v3.0.0.
|
87 |
-
if ( ! method_exists( 'WP_Dependency_Installer', 'json_file_decode' ) ) {
|
88 |
-
add_action(
|
89 |
-
'admin_notices',
|
90 |
-
function() {
|
91 |
-
$class = 'notice notice-error is-dismissible';
|
92 |
-
$label = __( 'Your Plugin Name', 'your-plugin' );
|
93 |
-
$file = ( new ReflectionClass( 'WP_Dependency_Installer' ) )->getFilename();
|
94 |
-
$message = __( 'Another theme or plugin is using a previous version of the WP Dependency Installer library, please update this file and try again:', 'group-plugin-installer' );
|
95 |
-
printf( '<div class="%1$s"><p><strong>[%2$s]</strong> %3$s</p><pre>%4$s</pre></div>', esc_attr( $class ), esc_html( $label ), esc_html( $message ), esc_html( $file ) );
|
96 |
-
},
|
97 |
-
1
|
98 |
-
);
|
99 |
-
return false; // Exit early.
|
100 |
-
}
|
101 |
-
```
|
102 |
-
|
103 |
That's it, happy blogging!
|
104 |
|
105 |
## Development
|
106 |
|
107 |
-
PRs are welcome against the `develop` branch.
|
17 |
|
18 |
You can use **composer** to install this package within your WordPress plugin / theme.
|
19 |
|
20 |
+
**Please ensure you are using the latest version of this framework in your `composer.json`**
|
21 |
+
|
22 |
1. Within your plugin or theme root folder, run the following command:
|
23 |
|
24 |
```shell
|
30 |
```js
|
31 |
[
|
32 |
{
|
33 |
+
"name": "Git Updater",
|
34 |
"host": "github",
|
35 |
+
"slug": "git-updater/git-updater.php",
|
36 |
+
"uri": "afragen/git-updater",
|
37 |
"branch": "develop",
|
38 |
"required": true,
|
39 |
"token": null
|
62 |
```php
|
63 |
require_once __DIR__ . '/vendor/autoload.php';
|
64 |
WP_Dependency_Installer::instance( __DIR__ )->run();
|
|
|
|
|
|
|
65 |
```
|
66 |
|
67 |
4. (optional) Take a look at some of built in [Hooks](https://github.com/afragen/wp-dependency-installer/wiki/Actions-and-Hooks) and [Functions](https://github.com/afragen/wp-dependency-installer/wiki/Helper-Functions) to further customize your plugin look and behaviour:
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
That's it, happy blogging!
|
70 |
|
71 |
## Development
|
72 |
|
73 |
+
PRs are welcome against the `develop` branch.
|
vendor/afragen/wp-dependency-installer/composer.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"name": "afragen/wp-dependency-installer",
|
3 |
"description": "Library that helps WordPress plugin dependency management.",
|
4 |
-
"version": "3.
|
5 |
"type": "library",
|
6 |
"license": "MIT",
|
7 |
"authors": [
|
@@ -25,7 +25,7 @@
|
|
25 |
"prefer-stable": true,
|
26 |
"require": {
|
27 |
"php": ">=5.6",
|
28 |
-
"
|
29 |
},
|
30 |
"support": {
|
31 |
"issues": "https://github.com/afragen/wp-dependency-installer/issues",
|
@@ -33,7 +33,8 @@
|
|
33 |
},
|
34 |
"autoload": {
|
35 |
"classmap": [
|
36 |
-
"wp-dependency-installer.php"
|
|
|
37 |
]
|
38 |
}
|
39 |
-
}
|
1 |
{
|
2 |
"name": "afragen/wp-dependency-installer",
|
3 |
"description": "Library that helps WordPress plugin dependency management.",
|
4 |
+
"version": "4.3.1",
|
5 |
"type": "library",
|
6 |
"license": "MIT",
|
7 |
"authors": [
|
25 |
"prefer-stable": true,
|
26 |
"require": {
|
27 |
"php": ">=5.6",
|
28 |
+
"afragen/wp-dismiss-notice": "*"
|
29 |
},
|
30 |
"support": {
|
31 |
"issues": "https://github.com/afragen/wp-dependency-installer/issues",
|
33 |
},
|
34 |
"autoload": {
|
35 |
"classmap": [
|
36 |
+
"wp-dependency-installer.php",
|
37 |
+
"wp-dependency-installer-skin.php"
|
38 |
]
|
39 |
}
|
40 |
+
}
|
vendor/afragen/wp-dependency-installer/composer.lock
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "522013fc51ab7aee32000de625cce168",
|
8 |
+
"packages": [
|
9 |
+
{
|
10 |
+
"name": "afragen/wp-dismiss-notice",
|
11 |
+
"version": "0.2.3",
|
12 |
+
"source": {
|
13 |
+
"type": "git",
|
14 |
+
"url": "https://github.com/afragen/wp-dismiss-notice.git",
|
15 |
+
"reference": "21949732f1ea21d81500bdda8f882ac7eb0f98af"
|
16 |
+
},
|
17 |
+
"dist": {
|
18 |
+
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/afragen/wp-dismiss-notice/zipball/21949732f1ea21d81500bdda8f882ac7eb0f98af",
|
20 |
+
"reference": "21949732f1ea21d81500bdda8f882ac7eb0f98af",
|
21 |
+
"shasum": ""
|
22 |
+
},
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.6"
|
25 |
+
},
|
26 |
+
"type": "library",
|
27 |
+
"autoload": {
|
28 |
+
"classmap": [
|
29 |
+
"wp-dismiss-notice.php"
|
30 |
+
]
|
31 |
+
},
|
32 |
+
"notification-url": "https://packagist.org/downloads/",
|
33 |
+
"license": [
|
34 |
+
"MIT"
|
35 |
+
],
|
36 |
+
"authors": [
|
37 |
+
{
|
38 |
+
"name": "Andy Fragen",
|
39 |
+
"email": "andy@thefragens.com",
|
40 |
+
"homepage": "https://thefragens.com",
|
41 |
+
"role": "Developer"
|
42 |
+
}
|
43 |
+
],
|
44 |
+
"description": "Library for time dismissible WordPress admin notices.",
|
45 |
+
"support": {
|
46 |
+
"issues": "https://github.com/afragen/wp-dismiss-notice/issues",
|
47 |
+
"source": "https://github.com/afragen/wp-dismiss-notice"
|
48 |
+
},
|
49 |
+
"time": "2021-12-19T21:53:57+00:00"
|
50 |
+
}
|
51 |
+
],
|
52 |
+
"packages-dev": [],
|
53 |
+
"aliases": [],
|
54 |
+
"minimum-stability": "stable",
|
55 |
+
"stability-flags": [],
|
56 |
+
"prefer-stable": true,
|
57 |
+
"prefer-lowest": false,
|
58 |
+
"platform": {
|
59 |
+
"php": ">=5.6"
|
60 |
+
},
|
61 |
+
"platform-dev": [],
|
62 |
+
"plugin-api-version": "2.2.0"
|
63 |
+
}
|
vendor/afragen/wp-dependency-installer/example-plugin/test-dependency-installer.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Plugin Name: Test Dependency Installer
|
5 |
-
* Plugin URI: https://github.com/afragen/wp-dependency-installer
|
6 |
-
* Description: This plugin is used for test dependency installation of remote sourced plugins.
|
7 |
-
* Version: 1.0
|
8 |
-
* Author: Andy Fragen, Matt Gibbs
|
9 |
-
* License: MIT
|
10 |
-
* Requires WP: 5.1
|
11 |
-
* Requires PHP: 5.6
|
12 |
-
*/
|
13 |
-
|
14 |
-
require_once __DIR__ . '/vendor/autoload.php';
|
15 |
-
|
16 |
-
WP_Dependency_Installer::instance()->run( __DIR__ );
|
17 |
-
add_filter(
|
18 |
-
'wp_dependency_timeout',
|
19 |
-
function( $timeout, $source ) {
|
20 |
-
$timeout = $source !== basename( __DIR__ ) ? $timeout : 14;
|
21 |
-
return $timeout;
|
22 |
-
},
|
23 |
-
10,
|
24 |
-
2
|
25 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/afragen/wp-dependency-installer/wp-dependencies-example.json
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
[
|
2 |
-
{
|
3 |
-
"name": "Query Monitor",
|
4 |
-
"host": "wordpress",
|
5 |
-
"slug": "query-monitor/query-monitor.php",
|
6 |
-
"uri": "https://wordpress.org/plugins/query-monitor/",
|
7 |
-
"optional": false
|
8 |
-
},
|
9 |
-
{
|
10 |
-
"name": "GitHub Updater",
|
11 |
-
"host": "github",
|
12 |
-
"slug": "github-updater/github-updater.php",
|
13 |
-
"uri": "afragen/github-updater",
|
14 |
-
"branch": "master",
|
15 |
-
"optional": false,
|
16 |
-
"token": null
|
17 |
-
},
|
18 |
-
{
|
19 |
-
"name": "Test Plugin Notags",
|
20 |
-
"host": "bitbucket",
|
21 |
-
"slug": "test-plugin-notags/test-plugin-notags.php",
|
22 |
-
"uri": "https://bitbucket.org/afragen/test-plugin-notags",
|
23 |
-
"branch": "master",
|
24 |
-
"optional": true
|
25 |
-
},
|
26 |
-
{
|
27 |
-
"name": "Test Gitlab Plugin2",
|
28 |
-
"host": "gitlab",
|
29 |
-
"slug": "test-gitlab-plugin2/test-gitlab-plugin2.php",
|
30 |
-
"uri": "https://gitlab.com/afragen/test-gitlab-plugin2",
|
31 |
-
"branch": "develop",
|
32 |
-
"optional": true,
|
33 |
-
"token": null
|
34 |
-
},
|
35 |
-
{
|
36 |
-
"name": "Test Direct Plugin Download",
|
37 |
-
"host": "direct",
|
38 |
-
"slug": "test-direct-plugin/test-plugin.php",
|
39 |
-
"uri": "https://direct-download.com/path/to.zip",
|
40 |
-
"optional": true
|
41 |
-
}
|
42 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/afragen/wp-dependency-installer/wp-dependency-installer-skin.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Upgrader API: WP_Dependency_Installer_Skin class
|
4 |
+
*
|
5 |
+
* @package WordPress
|
6 |
+
* @subpackage Upgrader
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Plugin Dependency Installer Skin for WordPress Plugin Installer.
|
11 |
+
*
|
12 |
+
* @since 2.8.0
|
13 |
+
* @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
|
14 |
+
*
|
15 |
+
* @see WP_Upgrader_Skin
|
16 |
+
*/
|
17 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Class WP_Plugin_Dependency_Installer_Skin
|
21 |
+
*/
|
22 |
+
class WP_Dependency_Installer_Skin extends Plugin_Installer_Skin {
|
23 |
+
/**
|
24 |
+
* Header
|
25 |
+
*
|
26 |
+
* @return void
|
27 |
+
*/
|
28 |
+
public function header() {
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Footer
|
33 |
+
*
|
34 |
+
* @return void
|
35 |
+
*/
|
36 |
+
public function footer() {
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Error
|
41 |
+
*
|
42 |
+
* @param array $errors Array of errors.
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public function error( $errors ) {
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Feedback
|
51 |
+
*
|
52 |
+
* @param string $string Feedback string.
|
53 |
+
* @param array ...$args Array of args.
|
54 |
+
*
|
55 |
+
* @return void
|
56 |
+
*/
|
57 |
+
public function feedback( $string, ...$args ) {
|
58 |
+
}
|
59 |
+
}
|
vendor/afragen/wp-dependency-installer/wp-dependency-installer.php
CHANGED
@@ -96,8 +96,22 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
96 |
add_action( 'wp_ajax_dependency_installer', [ $this, 'ajax_router' ] );
|
97 |
add_filter( 'http_request_args', [ $this, 'add_basic_auth_headers' ], 15, 2 );
|
98 |
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
/**
|
@@ -154,6 +168,12 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
154 |
$dependency['source'] = $source;
|
155 |
$dependency['sources'][] = $source;
|
156 |
$slug = $dependency['slug'];
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
// Keep a reference of all dependent plugins.
|
158 |
if ( isset( $this->config[ $slug ] ) ) {
|
159 |
$dependency['sources'] = array_merge( $this->config[ $slug ]['sources'], $dependency['sources'] );
|
@@ -277,6 +297,11 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
277 |
$this->modify_plugin_row( $slug );
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
280 |
if ( $this->is_active( $slug ) ) {
|
281 |
// Do nothing.
|
282 |
} elseif ( $this->is_installed( $slug ) ) {
|
@@ -320,7 +345,8 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
320 |
$.post(ajaxurl, {
|
321 |
action: 'dependency_installer',
|
322 |
method: $this.attr('data-action'),
|
323 |
-
slug : $this.attr('data-slug')
|
|
|
324 |
}, function (response) {
|
325 |
$parent.html(response);
|
326 |
});
|
@@ -343,13 +369,19 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
343 |
* AJAX router.
|
344 |
*/
|
345 |
public function ajax_router() {
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
348 |
$whitelist = [ 'install', 'activate', 'dismiss' ];
|
349 |
|
350 |
if ( in_array( $method, $whitelist, true ) ) {
|
351 |
$response = $this->$method( $slug );
|
352 |
-
|
|
|
353 |
}
|
354 |
wp_die();
|
355 |
}
|
@@ -419,7 +451,7 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
419 |
$this->current_slug = $slug;
|
420 |
add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 2 );
|
421 |
|
422 |
-
$skin = new
|
423 |
[
|
424 |
'type' => 'plugin',
|
425 |
'nonce' => wp_nonce_url( $this->config[ $slug ]['download_link'] ),
|
@@ -444,18 +476,19 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
444 |
|
445 |
wp_cache_flush();
|
446 |
if ( $this->is_required( $slug ) ) {
|
447 |
-
$this->activate( $slug );
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
|
|
456 |
}
|
457 |
|
458 |
-
if ( true !== $result && 'error' === $result['status'] ) {
|
459 |
return $result;
|
460 |
}
|
461 |
|
@@ -494,6 +527,10 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
494 |
* @return array Message.
|
495 |
*/
|
496 |
public function activate( $slug ) {
|
|
|
|
|
|
|
|
|
497 |
// network activate only if on network admin pages.
|
498 |
$result = is_network_admin() ? activate_plugin( $slug, null, true ) : activate_plugin( $slug );
|
499 |
|
@@ -572,25 +609,58 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
572 |
* @return bool|void
|
573 |
*/
|
574 |
private function move( $source, $destination ) {
|
575 |
-
if (
|
576 |
return true;
|
577 |
}
|
578 |
-
$
|
579 |
-
|
580 |
-
|
581 |
-
// phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.
|
582 |
-
|
583 |
-
if (
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
}
|
590 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
}
|
592 |
-
|
593 |
-
|
594 |
}
|
595 |
|
596 |
/**
|
@@ -617,9 +687,10 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
617 |
|
618 |
if ( isset( $notice['action'] ) ) {
|
619 |
$action = sprintf(
|
620 |
-
' <a href="javascript:;" class="wpdi-button" data-action="%1$s" data-slug="%2$s"
|
621 |
esc_attr( $notice['action'] ),
|
622 |
esc_attr( $notice['slug'] ),
|
|
|
623 |
esc_html( ucfirst( $notice['action'] ) )
|
624 |
);
|
625 |
}
|
@@ -637,8 +708,17 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
637 |
$dependency = dirname( $notice['slug'] );
|
638 |
$dismissible = empty( $timeout ) ? '' : sprintf( 'dependency-installer-%1$s-%2$s', esc_attr( $dependency ), esc_attr( $timeout ) );
|
639 |
}
|
640 |
-
if (
|
641 |
-
printf(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
642 |
}
|
643 |
}
|
644 |
}
|
@@ -712,10 +792,10 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
712 |
* @param bool $display show plugin row meta.
|
713 |
*/
|
714 |
if ( apply_filters( 'wp_dependency_required_row_meta', true ) ) {
|
715 |
-
print 'jQuery("tr[data-plugin=\'' . $plugin_file . '\'] .plugin-version-author-uri").append("<br><br><strong>' . esc_html__( 'Required by:' ) . '</strong> ' . $this->get_dependency_sources( $plugin_file ) . '");';
|
716 |
}
|
717 |
-
print 'jQuery(".inactive[data-plugin=\'' . $plugin_file . '\']").attr("class", "active");';
|
718 |
-
print 'jQuery(".active[data-plugin=\'' . $plugin_file . '\'] .check-column input").remove();';
|
719 |
print '</script>';
|
720 |
}
|
721 |
|
@@ -819,23 +899,4 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
|
|
819 |
return $args;
|
820 |
}
|
821 |
}
|
822 |
-
|
823 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
824 |
-
|
825 |
-
/**
|
826 |
-
* Class WPDI_Plugin_Installer_Skin
|
827 |
-
*/
|
828 |
-
class WPDI_Plugin_Installer_Skin extends Plugin_Installer_Skin {
|
829 |
-
public function header() {
|
830 |
-
}
|
831 |
-
|
832 |
-
public function footer() {
|
833 |
-
}
|
834 |
-
|
835 |
-
public function error( $errors ) {
|
836 |
-
}
|
837 |
-
|
838 |
-
public function feedback( $string, ...$args ) {
|
839 |
-
}
|
840 |
-
}
|
841 |
-
}
|
96 |
add_action( 'wp_ajax_dependency_installer', [ $this, 'ajax_router' ] );
|
97 |
add_filter( 'http_request_args', [ $this, 'add_basic_auth_headers' ], 15, 2 );
|
98 |
|
99 |
+
add_filter(
|
100 |
+
'wp_dependency_notices',
|
101 |
+
function( $notices, $slug ) {
|
102 |
+
foreach ( array_keys( $notices ) as $key ) {
|
103 |
+
if ( ! is_wp_error( $notices[ $key ] ) && $notices[ $key ]['slug'] === $slug ) {
|
104 |
+
$notices[ $key ]['nonce'] = $this->config[ $slug ]['nonce'];
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
return $notices;
|
109 |
+
},
|
110 |
+
10,
|
111 |
+
2
|
112 |
+
);
|
113 |
+
|
114 |
+
new \WP_Dismiss_Notice();
|
115 |
}
|
116 |
|
117 |
/**
|
168 |
$dependency['source'] = $source;
|
169 |
$dependency['sources'][] = $source;
|
170 |
$slug = $dependency['slug'];
|
171 |
+
|
172 |
+
if ( ! function_exists( 'wp_create_nonce' ) ) {
|
173 |
+
require_once ABSPATH . WPINC . '/pluggable.php';
|
174 |
+
}
|
175 |
+
$dependency['nonce'] = \wp_create_nonce( 'wp-dependency-installer_' . $slug );
|
176 |
+
|
177 |
// Keep a reference of all dependent plugins.
|
178 |
if ( isset( $this->config[ $slug ] ) ) {
|
179 |
$dependency['sources'] = array_merge( $this->config[ $slug ]['sources'], $dependency['sources'] );
|
297 |
$this->modify_plugin_row( $slug );
|
298 |
}
|
299 |
|
300 |
+
if ( ! wp_verify_nonce( $dependency['nonce'], 'wp-dependency-installer_' . $slug ) ) {
|
301 |
+
return false;
|
302 |
+
}
|
303 |
+
|
304 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedIf
|
305 |
if ( $this->is_active( $slug ) ) {
|
306 |
// Do nothing.
|
307 |
} elseif ( $this->is_installed( $slug ) ) {
|
345 |
$.post(ajaxurl, {
|
346 |
action: 'dependency_installer',
|
347 |
method: $this.attr('data-action'),
|
348 |
+
slug : $this.attr('data-slug'),
|
349 |
+
nonce : $this.attr('data-nonce')
|
350 |
}, function (response) {
|
351 |
$parent.html(response);
|
352 |
});
|
369 |
* AJAX router.
|
370 |
*/
|
371 |
public function ajax_router() {
|
372 |
+
if ( ! isset( $_POST['nonce'], $_POST['slug'] )
|
373 |
+
|| ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wp-dependency-installer_' . sanitize_text_field( wp_unslash( $_POST['slug'] ) ) )
|
374 |
+
) {
|
375 |
+
return;
|
376 |
+
}
|
377 |
+
$method = isset( $_POST['method'] ) ? sanitize_text_field( wp_unslash( $_POST['method'] ) ) : '';
|
378 |
+
$slug = isset( $_POST['slug'] ) ? sanitize_text_field( wp_unslash( $_POST['slug'] ) ) : '';
|
379 |
$whitelist = [ 'install', 'activate', 'dismiss' ];
|
380 |
|
381 |
if ( in_array( $method, $whitelist, true ) ) {
|
382 |
$response = $this->$method( $slug );
|
383 |
+
$message = is_wp_error( $response ) ? $response->get_error_message() : $response['message'];
|
384 |
+
esc_html_e( $message );
|
385 |
}
|
386 |
wp_die();
|
387 |
}
|
451 |
$this->current_slug = $slug;
|
452 |
add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 2 );
|
453 |
|
454 |
+
$skin = new WP_Dependency_Installer_Skin(
|
455 |
[
|
456 |
'type' => 'plugin',
|
457 |
'nonce' => wp_nonce_url( $this->config[ $slug ]['download_link'] ),
|
476 |
|
477 |
wp_cache_flush();
|
478 |
if ( $this->is_required( $slug ) ) {
|
479 |
+
$result = $this->activate( $slug );
|
480 |
+
if ( ! is_wp_error( $result ) ) {
|
481 |
+
return [
|
482 |
+
'status' => 'updated',
|
483 |
+
'slug' => $slug,
|
484 |
+
/* translators: %s: Plugin name */
|
485 |
+
'message' => sprintf( esc_html__( '%s has been installed and activated.' ), $this->config[ $slug ]['name'] ),
|
486 |
+
'source' => $this->config[ $slug ]['source'],
|
487 |
+
];
|
488 |
+
}
|
489 |
}
|
490 |
|
491 |
+
if ( is_wp_error( $result ) || ( true !== $result && 'error' === $result['status'] ) ) {
|
492 |
return $result;
|
493 |
}
|
494 |
|
527 |
* @return array Message.
|
528 |
*/
|
529 |
public function activate( $slug ) {
|
530 |
+
if ( ! current_user_can( 'activate_plugins' ) ) {
|
531 |
+
return new WP_Error( 'wpdi_activate_plugins', __( 'Current user cannot activate plugins.' ), $this->config[ $slug ]['name'] );
|
532 |
+
}
|
533 |
+
|
534 |
// network activate only if on network admin pages.
|
535 |
$result = is_network_admin() ? activate_plugin( $slug, null, true ) : activate_plugin( $slug );
|
536 |
|
609 |
* @return bool|void
|
610 |
*/
|
611 |
private function move( $source, $destination ) {
|
612 |
+
if ( $this->filesystem_move( $source, $destination ) ) {
|
613 |
return true;
|
614 |
}
|
615 |
+
if ( is_dir( $destination ) && rename( $source, $destination ) ) {
|
616 |
+
return true;
|
617 |
+
}
|
618 |
+
// phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.Found, Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
|
619 |
+
if ( $dir = opendir( $source ) ) {
|
620 |
+
if ( ! file_exists( $destination ) ) {
|
621 |
+
mkdir( $destination );
|
622 |
+
}
|
623 |
+
$source = untrailingslashit( $source );
|
624 |
+
// phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
|
625 |
+
while ( false !== ( $file = readdir( $dir ) ) ) {
|
626 |
+
if ( ( '.' !== $file ) && ( '..' !== $file ) && "{$source}/{$file}" !== $destination ) {
|
627 |
+
if ( is_dir( "{$source}/{$file}" ) ) {
|
628 |
+
$this->move( "{$source}/{$file}", "{$destination}/{$file}" );
|
629 |
+
} else {
|
630 |
+
copy( "{$source}/{$file}", "{$destination}/{$file}" );
|
631 |
+
unlink( "{$source}/{$file}" );
|
632 |
+
}
|
633 |
}
|
634 |
}
|
635 |
+
$iterator = new \FilesystemIterator( $source );
|
636 |
+
if ( ! $iterator->valid() ) { // True if directory is empty.
|
637 |
+
rmdir( $source );
|
638 |
+
}
|
639 |
+
closedir( $dir );
|
640 |
+
|
641 |
+
return true;
|
642 |
+
}
|
643 |
+
|
644 |
+
return false;
|
645 |
+
}
|
646 |
+
|
647 |
+
/**
|
648 |
+
* Non-direct filesystem move.
|
649 |
+
*
|
650 |
+
* @uses $wp_filesystem->move() when FS_METHOD is not 'direct'
|
651 |
+
*
|
652 |
+
* @param string $source File path of source.
|
653 |
+
* @param string $destination File path of destination.
|
654 |
+
*
|
655 |
+
* @return bool|void True on success, false on failure.
|
656 |
+
*/
|
657 |
+
public function filesystem_move( $source, $destination ) {
|
658 |
+
global $wp_filesystem;
|
659 |
+
if ( 'direct' !== $wp_filesystem->method ) {
|
660 |
+
return $wp_filesystem->move( $source, $destination );
|
661 |
}
|
662 |
+
|
663 |
+
return false;
|
664 |
}
|
665 |
|
666 |
/**
|
687 |
|
688 |
if ( isset( $notice['action'] ) ) {
|
689 |
$action = sprintf(
|
690 |
+
' <a href="javascript:;" class="wpdi-button" data-action="%1$s" data-slug="%2$s" data-nonce="%3$s">%4$s Now »</a> ',
|
691 |
esc_attr( $notice['action'] ),
|
692 |
esc_attr( $notice['slug'] ),
|
693 |
+
esc_attr( $notice['nonce'] ),
|
694 |
esc_html( ucfirst( $notice['action'] ) )
|
695 |
);
|
696 |
}
|
708 |
$dependency = dirname( $notice['slug'] );
|
709 |
$dismissible = empty( $timeout ) ? '' : sprintf( 'dependency-installer-%1$s-%2$s', esc_attr( $dependency ), esc_attr( $timeout ) );
|
710 |
}
|
711 |
+
if ( \WP_Dismiss_Notice::is_admin_notice_active( $dismissible ) ) {
|
712 |
+
printf(
|
713 |
+
'<div class="%1$s" data-dismissible="%2$s"><p><strong>[%3$s]</strong> %4$s%5$s</p></div>',
|
714 |
+
esc_attr( $class ),
|
715 |
+
esc_attr( $dismissible ),
|
716 |
+
esc_html( $label ),
|
717 |
+
esc_html( $message ),
|
718 |
+
// $action is escaped above.
|
719 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
720 |
+
$action
|
721 |
+
);
|
722 |
}
|
723 |
}
|
724 |
}
|
792 |
* @param bool $display show plugin row meta.
|
793 |
*/
|
794 |
if ( apply_filters( 'wp_dependency_required_row_meta', true ) ) {
|
795 |
+
print 'jQuery("tr[data-plugin=\'' . esc_attr( $plugin_file ) . '\'] .plugin-version-author-uri").append("<br><br><strong>' . esc_html__( 'Required by:' ) . '</strong> ' . esc_html( $this->get_dependency_sources( $plugin_file ) ) . '");';
|
796 |
}
|
797 |
+
print 'jQuery(".inactive[data-plugin=\'' . esc_attr( $plugin_file ) . '\']").attr("class", "active");';
|
798 |
+
print 'jQuery(".active[data-plugin=\'' . esc_attr( $plugin_file ) . '\'] .check-column input").remove();';
|
799 |
print '</script>';
|
800 |
}
|
801 |
|
899 |
return $args;
|
900 |
}
|
901 |
}
|
902 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/afragen/wp-dismiss-notice/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2021 Andy Fragen
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
vendor/afragen/wp-dismiss-notice/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# WP Dismiss Notice
|
2 |
+
|
3 |
+
Add time dismissible admin notices to WordPress.
|
4 |
+
Fork of https://github.com/w3guy/persist-admin-notices-dismissal
|
5 |
+
|
6 |
+
## Instuctions
|
7 |
+
|
8 |
+
Initialize the class.
|
9 |
+
|
10 |
+
`new \WP_Dismiss_Notice();` in your project.
|
11 |
+
|
12 |
+
### Admin notice format.
|
13 |
+
|
14 |
+
You must add `data-dismissible='<admin notice identifier>-<timeout>'` to the admin notice div class. `<timeout>` values are from one day '1' to 'forever'. Default timeout is 14 days. The `<admin notice identifier>` should be some unique value based upon the admin notice that you wish to dismiss.
|
15 |
+
|
16 |
+
Example using a 14 day dismissible notice.
|
17 |
+
|
18 |
+
```html
|
19 |
+
<div class="notice-warning notice is-dismissible" data-dismissible="my_admin_notice_<hash>-14">...</div>
|
20 |
+
```
|
vendor/afragen/wp-dismiss-notice/composer.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "afragen/wp-dismiss-notice",
|
3 |
+
"description": "Library for time dismissible WordPress admin notices.",
|
4 |
+
"version": "0.2.3",
|
5 |
+
"type": "library",
|
6 |
+
"license": "MIT",
|
7 |
+
"authors": [
|
8 |
+
{
|
9 |
+
"name": "Andy Fragen",
|
10 |
+
"email": "andy@thefragens.com",
|
11 |
+
"homepage": "https://thefragens.com",
|
12 |
+
"role": "Developer"
|
13 |
+
}
|
14 |
+
],
|
15 |
+
"prefer-stable": true,
|
16 |
+
"require": {
|
17 |
+
"php": ">=5.6"
|
18 |
+
},
|
19 |
+
"support": {
|
20 |
+
"issues": "https://github.com/afragen/wp-dismiss-notice/issues",
|
21 |
+
"source": "https://github.com/afragen/wp-dismiss-notice"
|
22 |
+
},
|
23 |
+
"autoload": {
|
24 |
+
"classmap": [
|
25 |
+
"wp-dismiss-notice.php"
|
26 |
+
]
|
27 |
+
}
|
28 |
+
}
|
vendor/afragen/wp-dismiss-notice/js/dismiss-notice.js
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @output wp-admin/js/dismiss-notice.js
|
3 |
+
*
|
4 |
+
* @see https://github.com/w3guy/persist-admin-notices-dismissal
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function ($) {
|
8 |
+
// Shorthand for ready event.
|
9 |
+
$(
|
10 |
+
function () {
|
11 |
+
$('div[data-dismissible] button.notice-dismiss').on('click',
|
12 |
+
function (event) {
|
13 |
+
event.preventDefault();
|
14 |
+
var $this = $(this);
|
15 |
+
|
16 |
+
var attr_value, option_name, dismissible_length, data;
|
17 |
+
|
18 |
+
attr_value = $this.closest('div[data-dismissible]').attr('data-dismissible').split('-');
|
19 |
+
|
20 |
+
// Remove the dismissible length from the attribute value and rejoin the array.
|
21 |
+
dismissible_length = attr_value.pop();
|
22 |
+
|
23 |
+
option_name = attr_value.join('-');
|
24 |
+
|
25 |
+
data = {
|
26 |
+
'action': 'dismiss_admin_notice',
|
27 |
+
'option_name': option_name,
|
28 |
+
'dismissible_length': dismissible_length,
|
29 |
+
'nonce': window.wp_dismiss_notice.nonce
|
30 |
+
};
|
31 |
+
|
32 |
+
// Run Ajax request.
|
33 |
+
$.post(window.wp_dismiss_notice.ajaxurl, data);
|
34 |
+
$this.closest('div[data-dismissible]').hide('slow');
|
35 |
+
}
|
36 |
+
);
|
37 |
+
}
|
38 |
+
);
|
39 |
+
|
40 |
+
}(jQuery));
|
vendor/afragen/wp-dismiss-notice/wp-dismiss-notice.php
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WP Dismiss Notice.
|
4 |
+
*
|
5 |
+
* @package wp-dismiss-notice
|
6 |
+
* @see https://github.com/w3guy/persist-admin-notices-dismissal
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WP_Dismiss_Notice
|
11 |
+
*/
|
12 |
+
class WP_Dismiss_Notice {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Init hooks.
|
16 |
+
*/
|
17 |
+
public static function init() {
|
18 |
+
add_action( 'admin_enqueue_scripts', [ __CLASS__, 'load_script' ] );
|
19 |
+
add_action( 'wp_ajax_dismiss_admin_notice', [ __CLASS__, 'dismiss_admin_notice' ] );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Enqueue javascript and variables.
|
24 |
+
*/
|
25 |
+
public static function load_script() {
|
26 |
+
|
27 |
+
if ( is_customize_preview() ) {
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
$composer_js_path = '/vendor/afragen/wp-dismiss-notice/js/dismiss-notice.js';
|
32 |
+
$plugin_js_url = plugins_url( 'js/dismiss-notice.js', __FILE__, 'wp-dismiss-notice' );
|
33 |
+
|
34 |
+
// Test to get correct URL for JS.
|
35 |
+
$response = wp_remote_head( $plugin_js_url );
|
36 |
+
$js_url = ( 200 === wp_remote_retrieve_response_code( $response ) ) || is_wp_error( $response )
|
37 |
+
? $plugin_js_url
|
38 |
+
: get_stylesheet_directory_uri() . $composer_js_path;
|
39 |
+
|
40 |
+
wp_enqueue_script(
|
41 |
+
'dismissible-notices',
|
42 |
+
$js_url,
|
43 |
+
[ 'jquery', 'common' ],
|
44 |
+
false,
|
45 |
+
true
|
46 |
+
);
|
47 |
+
|
48 |
+
wp_localize_script(
|
49 |
+
'dismissible-notices',
|
50 |
+
'wp_dismiss_notice',
|
51 |
+
[
|
52 |
+
'nonce' => wp_create_nonce( 'wp-dismiss-notice' ),
|
53 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
54 |
+
]
|
55 |
+
);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Handles Ajax request to persist notices dismissal.
|
60 |
+
* Uses check_ajax_referer to verify nonce.
|
61 |
+
*/
|
62 |
+
public static function dismiss_admin_notice() {
|
63 |
+
$option_name = isset( $_POST['option_name'] ) ? sanitize_text_field( wp_unslash( $_POST['option_name'] ) ) : false;
|
64 |
+
$dismissible_length = isset( $_POST['dismissible_length'] ) ? sanitize_text_field( wp_unslash( $_POST['dismissible_length'] ) ) : 14;
|
65 |
+
|
66 |
+
if ( 'forever' !== $dismissible_length ) {
|
67 |
+
// If $dismissible_length is not an integer default to 14.
|
68 |
+
$dismissible_length = ( 0 === absint( $dismissible_length ) ) ? 14 : $dismissible_length;
|
69 |
+
$dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
|
70 |
+
}
|
71 |
+
|
72 |
+
check_ajax_referer( 'wp-dismiss-notice', 'nonce' );
|
73 |
+
self::set_admin_notice_cache( $option_name, $dismissible_length );
|
74 |
+
wp_die();
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Is admin notice active?
|
79 |
+
*
|
80 |
+
* @param string $arg data-dismissible content of notice.
|
81 |
+
*
|
82 |
+
* @return bool
|
83 |
+
*/
|
84 |
+
public static function is_admin_notice_active( $arg ) {
|
85 |
+
$array = explode( '-', $arg );
|
86 |
+
array_pop( $array );
|
87 |
+
$option_name = implode( '-', $array );
|
88 |
+
$db_record = self::get_admin_notice_cache( $option_name );
|
89 |
+
|
90 |
+
if ( 'forever' === $db_record ) {
|
91 |
+
return false;
|
92 |
+
} elseif ( absint( $db_record ) >= time() ) {
|
93 |
+
return false;
|
94 |
+
} else {
|
95 |
+
return true;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns admin notice cached timeout.
|
101 |
+
*
|
102 |
+
* @access public
|
103 |
+
*
|
104 |
+
* @param string|bool $id admin notice name or false.
|
105 |
+
*
|
106 |
+
* @return array|bool The timeout. False if expired.
|
107 |
+
*/
|
108 |
+
public static function get_admin_notice_cache( $id = false ) {
|
109 |
+
if ( ! $id ) {
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
$cache_key = 'wpdn-' . md5( $id );
|
113 |
+
$timeout = get_site_option( $cache_key );
|
114 |
+
$timeout = 'forever' === $timeout ? time() + 60 : $timeout;
|
115 |
+
|
116 |
+
if ( empty( $timeout ) || time() > $timeout ) {
|
117 |
+
return false;
|
118 |
+
}
|
119 |
+
|
120 |
+
return $timeout;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Sets admin notice timeout in site option.
|
125 |
+
*
|
126 |
+
* @access public
|
127 |
+
*
|
128 |
+
* @param string $id Data Identifier.
|
129 |
+
* @param string|bool $timeout Timeout for admin notice.
|
130 |
+
*
|
131 |
+
* @return bool
|
132 |
+
*/
|
133 |
+
public static function set_admin_notice_cache( $id, $timeout ) {
|
134 |
+
$cache_key = 'wpdn-' . md5( $id );
|
135 |
+
update_site_option( $cache_key, $timeout );
|
136 |
+
|
137 |
+
return true;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
// Initialize.
|
142 |
+
add_action( 'admin_init', [ 'WP_Dismiss_Notice', 'init' ] );
|
vendor/collizo4sky/persist-admin-notices-dismissal/README.md
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
# Persist Admin notice Dismissals
|
2 |
-
[![Latest Stable Version](https://poser.pugx.org/collizo4sky/persist-admin-notices-dismissal/v/stable)](https://packagist.org/packages/collizo4sky/persist-admin-notices-dismissal)
|
3 |
-
[![Total Downloads](https://poser.pugx.org/collizo4sky/persist-admin-notices-dismissal/downloads)](https://packagist.org/packages/collizo4sky/persist-admin-notices-dismissal)
|
4 |
-
|
5 |
-
Simple framework library that persists the dismissal of admin notices across pages in WordPress dashboard.
|
6 |
-
|
7 |
-
## Installation
|
8 |
-
|
9 |
-
Run `composer require collizo4sky/persist-admin-notices-dismissal`
|
10 |
-
|
11 |
-
Alternatively, clone or download this repo into the `vendor/` folder in your plugin, and include/require the `persist-admin-notices-dismissal.php` file like so
|
12 |
-
|
13 |
-
```php
|
14 |
-
require __DIR__ . '/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php';
|
15 |
-
add_action( 'admin_init', array( 'PAnD', 'init' ) );
|
16 |
-
```
|
17 |
-
|
18 |
-
or let Composer's autoloader do the work.
|
19 |
-
|
20 |
-
## How to Use
|
21 |
-
Firstly, install and activate this library within a plugin.
|
22 |
-
|
23 |
-
Say you have the following markup as your admin notice,
|
24 |
-
|
25 |
-
|
26 |
-
```php
|
27 |
-
function sample_admin_notice__success() {
|
28 |
-
?>
|
29 |
-
<div class="updated notice notice-success is-dismissible">
|
30 |
-
<p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
|
31 |
-
</div>
|
32 |
-
<?php
|
33 |
-
}
|
34 |
-
add_action( 'admin_notices', 'sample_admin_notice__success' );
|
35 |
-
```
|
36 |
-
|
37 |
-
To make it hidden forever when dismissed, add the following data attribute `data-dismissible="disable-done-notice-forever"` to the div markup like so:
|
38 |
-
|
39 |
-
|
40 |
-
```php
|
41 |
-
function sample_admin_notice__success() {
|
42 |
-
if ( ! PAnD::is_admin_notice_active( 'disable-done-notice-forever' ) ) {
|
43 |
-
return;
|
44 |
-
}
|
45 |
-
|
46 |
-
?>
|
47 |
-
<div data-dismissible="disable-done-notice-forever" class="updated notice notice-success is-dismissible">
|
48 |
-
<p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
|
49 |
-
</div>
|
50 |
-
<?php
|
51 |
-
}
|
52 |
-
add_action( 'admin_init', array( 'PAnD', 'init' ) );
|
53 |
-
add_action( 'admin_notices', 'sample_admin_notice__success' );
|
54 |
-
```
|
55 |
-
|
56 |
-
## Autoloaders
|
57 |
-
When using the framework with an autoloader you **must** also load the class outside of the `admin_notices` or `network_admin_notices` hooks. The reason is that these hooks come after the `admin_enqueue_script` hook that loads the javascript.
|
58 |
-
|
59 |
-
Just add the following in your main plugin file.
|
60 |
-
|
61 |
-
```php
|
62 |
-
add_action( 'admin_init', array( 'PAnD', 'init' ) );
|
63 |
-
```
|
64 |
-
|
65 |
-
#### Usage Instructions and Examples
|
66 |
-
If you have two notices displayed when certain actions are triggered; firstly, choose a string to uniquely identify them, e.g. `notice-one` and `notice-two`
|
67 |
-
|
68 |
-
To make the first notice never appear once dismissed, its `data-dismissible` attribute will be `data-dismissible="notice-one-forever"` where `notice-one` is its unique identifier and `forever` is the dismissal time period.
|
69 |
-
|
70 |
-
To make the second notice only hidden for 2 days, its `data-dismissible` attribute will be `data-dismissible="notice-two-2"` where `notice-two` is its unique identifier and the `2`, the number of days it will be hidden is the dismissal time period.
|
71 |
-
|
72 |
-
You **must** append the dismissal time period to the end of your unique identifier with a hyphen (`-`) and this value must be an integer. The only exception is the string `forever`.
|
73 |
-
|
74 |
-
To actually make the dismissed admin notice not to appear, use the `is_admin_notice_active()` function like so:
|
75 |
-
|
76 |
-
|
77 |
-
```php
|
78 |
-
function sample_admin_notice__success1() {
|
79 |
-
if ( ! PAnD::is_admin_notice_active( 'notice-one-forever' ) ) {
|
80 |
-
return;
|
81 |
-
}
|
82 |
-
|
83 |
-
?>
|
84 |
-
<div data-dismissible="notice-one-forever" class="updated notice notice-success is-dismissible">
|
85 |
-
<p><?php _e( 'Done 1!', 'sample-text-domain' ); ?></p>
|
86 |
-
</div>
|
87 |
-
<?php
|
88 |
-
}
|
89 |
-
|
90 |
-
function sample_admin_notice__success2() {
|
91 |
-
if ( ! PAnD::is_admin_notice_active( 'notice-two-2' ) ) {
|
92 |
-
return;
|
93 |
-
}
|
94 |
-
|
95 |
-
?>
|
96 |
-
<div data-dismissible="notice-two-2" class="updated notice notice-success is-dismissible">
|
97 |
-
<p><?php _e( 'Done 2!', 'sample-text-domain' ); ?></p>
|
98 |
-
</div>
|
99 |
-
<?php
|
100 |
-
}
|
101 |
-
|
102 |
-
add_action( 'admin_init', array( 'PAnD', 'init' ) );
|
103 |
-
add_action( 'admin_notices', 'sample_admin_notice__success1' );
|
104 |
-
add_action( 'admin_notices', 'sample_admin_notice__success2' );
|
105 |
-
```
|
106 |
-
|
107 |
-
|
108 |
-
Cool beans. Isn't it?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
//shorthand for ready event.
|
3 |
-
$(function () {
|
4 |
-
$('div[data-dismissible] button.notice-dismiss').click(function (event) {
|
5 |
-
event.preventDefault();
|
6 |
-
var $this = $(this);
|
7 |
-
|
8 |
-
var attr_value, option_name, dismissible_length, data;
|
9 |
-
|
10 |
-
attr_value = $this.parent().attr('data-dismissible').split('-');
|
11 |
-
|
12 |
-
// remove the dismissible length from the attribute value and rejoin the array.
|
13 |
-
dismissible_length = attr_value.pop();
|
14 |
-
|
15 |
-
option_name = attr_value.join('-');
|
16 |
-
|
17 |
-
data = {
|
18 |
-
'action': 'dismiss_admin_notice',
|
19 |
-
'option_name': option_name,
|
20 |
-
'dismissible_length': dismissible_length,
|
21 |
-
'nonce': dismissible_notice.nonce
|
22 |
-
};
|
23 |
-
|
24 |
-
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
|
25 |
-
$.post(ajaxurl, data);
|
26 |
-
});
|
27 |
-
})
|
28 |
-
|
29 |
-
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Persist Admin notices Dismissal
|
5 |
-
*
|
6 |
-
* Copyright (C) 2016 Agbonghama Collins <http://w3guy.com>
|
7 |
-
*
|
8 |
-
* This program is free software: you can redistribute it and/or modify
|
9 |
-
* it under the terms of the GNU General Public License as published by
|
10 |
-
* the Free Software Foundation, either version 3 of the License, or
|
11 |
-
* (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This program is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
-
* GNU General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU General Public License
|
19 |
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20 |
-
*
|
21 |
-
* @package Persist Admin notices Dismissal
|
22 |
-
* @author Agbonghama Collins
|
23 |
-
* @author Andy Fragen
|
24 |
-
* @license http://www.gnu.org/licenses GNU General Public License
|
25 |
-
* @version 1.3.2
|
26 |
-
*/
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Exit if called directly.
|
30 |
-
*/
|
31 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
32 |
-
die;
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( ! class_exists( 'PAnD' ) ) {
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Class PAnD
|
39 |
-
*/
|
40 |
-
class PAnD {
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Init hooks.
|
44 |
-
*/
|
45 |
-
public static function init() {
|
46 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_script' ) );
|
47 |
-
add_action( 'wp_ajax_dismiss_admin_notice', array( __CLASS__, 'dismiss_admin_notice' ) );
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Enqueue javascript and variables.
|
52 |
-
*/
|
53 |
-
public static function load_script() {
|
54 |
-
|
55 |
-
if(is_customize_preview()) return;
|
56 |
-
|
57 |
-
wp_enqueue_script(
|
58 |
-
'dismissible-notices',
|
59 |
-
plugins_url( 'dismiss-notice.js', __FILE__ ),
|
60 |
-
array( 'jquery', 'common' ),
|
61 |
-
false,
|
62 |
-
true
|
63 |
-
);
|
64 |
-
|
65 |
-
wp_localize_script(
|
66 |
-
'dismissible-notices',
|
67 |
-
'dismissible_notice',
|
68 |
-
array(
|
69 |
-
'nonce' => wp_create_nonce( 'dismissible-notice' ),
|
70 |
-
)
|
71 |
-
);
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Handles Ajax request to persist notices dismissal.
|
76 |
-
* Uses check_ajax_referer to verify nonce.
|
77 |
-
*/
|
78 |
-
public static function dismiss_admin_notice() {
|
79 |
-
$option_name = sanitize_text_field( $_POST['option_name'] );
|
80 |
-
$dismissible_length = sanitize_text_field( $_POST['dismissible_length'] );
|
81 |
-
$transient = 0;
|
82 |
-
|
83 |
-
if ( 'forever' != $dismissible_length ) {
|
84 |
-
// If $dismissible_length is not an integer default to 1
|
85 |
-
$dismissible_length = ( 0 == absint( $dismissible_length ) ) ? 1 : $dismissible_length;
|
86 |
-
$transient = absint( $dismissible_length ) * DAY_IN_SECONDS;
|
87 |
-
$dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
|
88 |
-
}
|
89 |
-
|
90 |
-
check_ajax_referer( 'dismissible-notice', 'nonce' );
|
91 |
-
set_site_transient( $option_name, $dismissible_length, $transient );
|
92 |
-
wp_die();
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Is admin notice active?
|
97 |
-
*
|
98 |
-
* @param string $arg data-dismissible content of notice.
|
99 |
-
*
|
100 |
-
* @return bool
|
101 |
-
*/
|
102 |
-
public static function is_admin_notice_active( $arg ) {
|
103 |
-
$array = explode( '-', $arg );
|
104 |
-
$length = array_pop( $array );
|
105 |
-
$option_name = implode( '-', $array );
|
106 |
-
$db_record = get_site_transient( $option_name );
|
107 |
-
|
108 |
-
if ( 'forever' == $db_record ) {
|
109 |
-
return false;
|
110 |
-
} elseif ( absint( $db_record ) >= time() ) {
|
111 |
-
return false;
|
112 |
-
} else {
|
113 |
-
return true;
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
}
|
118 |
-
|
119 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/ClassLoader.php
CHANGED
@@ -37,57 +37,130 @@ namespace Composer\Autoload;
|
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
-
* @see
|
41 |
-
* @see
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
|
|
|
|
|
|
45 |
// PSR-4
|
|
|
|
|
|
|
|
|
46 |
private $prefixLengthsPsr4 = array();
|
|
|
|
|
|
|
|
|
47 |
private $prefixDirsPsr4 = array();
|
|
|
|
|
|
|
|
|
48 |
private $fallbackDirsPsr4 = array();
|
49 |
|
50 |
// PSR-0
|
|
|
|
|
|
|
|
|
51 |
private $prefixesPsr0 = array();
|
|
|
|
|
|
|
|
|
52 |
private $fallbackDirsPsr0 = array();
|
53 |
|
|
|
54 |
private $useIncludePath = false;
|
|
|
|
|
|
|
|
|
|
|
55 |
private $classMap = array();
|
|
|
|
|
56 |
private $classMapAuthoritative = false;
|
|
|
|
|
|
|
|
|
|
|
57 |
private $missingClasses = array();
|
|
|
|
|
58 |
private $apcuPrefix;
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
-
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
64 |
}
|
65 |
|
66 |
return array();
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
69 |
public function getPrefixesPsr4()
|
70 |
{
|
71 |
return $this->prefixDirsPsr4;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
74 |
public function getFallbackDirs()
|
75 |
{
|
76 |
return $this->fallbackDirsPsr0;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
79 |
public function getFallbackDirsPsr4()
|
80 |
{
|
81 |
return $this->fallbackDirsPsr4;
|
82 |
}
|
83 |
|
|
|
|
|
|
|
|
|
84 |
public function getClassMap()
|
85 |
{
|
86 |
return $this->classMap;
|
87 |
}
|
88 |
|
89 |
/**
|
90 |
-
* @param
|
|
|
|
|
|
|
91 |
*/
|
92 |
public function addClassMap(array $classMap)
|
93 |
{
|
@@ -102,9 +175,11 @@ class ClassLoader
|
|
102 |
* Registers a set of PSR-0 directories for a given prefix, either
|
103 |
* appending or prepending to the ones previously set for this prefix.
|
104 |
*
|
105 |
-
* @param string
|
106 |
-
* @param
|
107 |
-
* @param bool
|
|
|
|
|
108 |
*/
|
109 |
public function add($prefix, $paths, $prepend = false)
|
110 |
{
|
@@ -147,11 +222,13 @@ class ClassLoader
|
|
147 |
* Registers a set of PSR-4 directories for a given namespace, either
|
148 |
* appending or prepending to the ones previously set for this namespace.
|
149 |
*
|
150 |
-
* @param string
|
151 |
-
* @param
|
152 |
-
* @param bool
|
153 |
*
|
154 |
* @throws \InvalidArgumentException
|
|
|
|
|
155 |
*/
|
156 |
public function addPsr4($prefix, $paths, $prepend = false)
|
157 |
{
|
@@ -195,8 +272,10 @@ class ClassLoader
|
|
195 |
* Registers a set of PSR-0 directories for a given prefix,
|
196 |
* replacing any others previously set for this prefix.
|
197 |
*
|
198 |
-
* @param string
|
199 |
-
* @param
|
|
|
|
|
200 |
*/
|
201 |
public function set($prefix, $paths)
|
202 |
{
|
@@ -211,10 +290,12 @@ class ClassLoader
|
|
211 |
* Registers a set of PSR-4 directories for a given namespace,
|
212 |
* replacing any others previously set for this namespace.
|
213 |
*
|
214 |
-
* @param string
|
215 |
-
* @param
|
216 |
*
|
217 |
* @throws \InvalidArgumentException
|
|
|
|
|
218 |
*/
|
219 |
public function setPsr4($prefix, $paths)
|
220 |
{
|
@@ -234,6 +315,8 @@ class ClassLoader
|
|
234 |
* Turns on searching the include path for class files.
|
235 |
*
|
236 |
* @param bool $useIncludePath
|
|
|
|
|
237 |
*/
|
238 |
public function setUseIncludePath($useIncludePath)
|
239 |
{
|
@@ -256,6 +339,8 @@ class ClassLoader
|
|
256 |
* that have not been registered with the class map.
|
257 |
*
|
258 |
* @param bool $classMapAuthoritative
|
|
|
|
|
259 |
*/
|
260 |
public function setClassMapAuthoritative($classMapAuthoritative)
|
261 |
{
|
@@ -276,10 +361,12 @@ class ClassLoader
|
|
276 |
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
277 |
*
|
278 |
* @param string|null $apcuPrefix
|
|
|
|
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
282 |
-
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
283 |
}
|
284 |
|
285 |
/**
|
@@ -296,25 +383,44 @@ class ClassLoader
|
|
296 |
* Registers this instance as an autoloader.
|
297 |
*
|
298 |
* @param bool $prepend Whether to prepend the autoloader or not
|
|
|
|
|
299 |
*/
|
300 |
public function register($prepend = false)
|
301 |
{
|
302 |
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
}
|
304 |
|
305 |
/**
|
306 |
* Unregisters this instance as an autoloader.
|
|
|
|
|
307 |
*/
|
308 |
public function unregister()
|
309 |
{
|
310 |
spl_autoload_unregister(array($this, 'loadClass'));
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
|
313 |
/**
|
314 |
* Loads the given class or interface.
|
315 |
*
|
316 |
* @param string $class The name of the class
|
317 |
-
* @return
|
318 |
*/
|
319 |
public function loadClass($class)
|
320 |
{
|
@@ -323,6 +429,8 @@ class ClassLoader
|
|
323 |
|
324 |
return true;
|
325 |
}
|
|
|
|
|
326 |
}
|
327 |
|
328 |
/**
|
@@ -367,6 +475,21 @@ class ClassLoader
|
|
367 |
return $file;
|
368 |
}
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
private function findFileWithExtension($class, $ext)
|
371 |
{
|
372 |
// PSR-4 lookup
|
@@ -377,11 +500,11 @@ class ClassLoader
|
|
377 |
$subPath = $class;
|
378 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
$subPath = substr($subPath, 0, $lastPos);
|
380 |
-
$search = $subPath.'\\';
|
381 |
if (isset($this->prefixDirsPsr4[$search])) {
|
|
|
382 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
383 |
-
$
|
384 |
-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
385 |
return $file;
|
386 |
}
|
387 |
}
|
@@ -438,6 +561,10 @@ class ClassLoader
|
|
438 |
* Scope isolated include.
|
439 |
*
|
440 |
* Prevents access to $this/self from included files.
|
|
|
|
|
|
|
|
|
441 |
*/
|
442 |
function includeFile($file)
|
443 |
{
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
45 |
+
/** @var ?string */
|
46 |
+
private $vendorDir;
|
47 |
+
|
48 |
// PSR-4
|
49 |
+
/**
|
50 |
+
* @var array[]
|
51 |
+
* @psalm-var array<string, array<string, int>>
|
52 |
+
*/
|
53 |
private $prefixLengthsPsr4 = array();
|
54 |
+
/**
|
55 |
+
* @var array[]
|
56 |
+
* @psalm-var array<string, array<int, string>>
|
57 |
+
*/
|
58 |
private $prefixDirsPsr4 = array();
|
59 |
+
/**
|
60 |
+
* @var array[]
|
61 |
+
* @psalm-var array<string, string>
|
62 |
+
*/
|
63 |
private $fallbackDirsPsr4 = array();
|
64 |
|
65 |
// PSR-0
|
66 |
+
/**
|
67 |
+
* @var array[]
|
68 |
+
* @psalm-var array<string, array<string, string[]>>
|
69 |
+
*/
|
70 |
private $prefixesPsr0 = array();
|
71 |
+
/**
|
72 |
+
* @var array[]
|
73 |
+
* @psalm-var array<string, string>
|
74 |
+
*/
|
75 |
private $fallbackDirsPsr0 = array();
|
76 |
|
77 |
+
/** @var bool */
|
78 |
private $useIncludePath = false;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @var string[]
|
82 |
+
* @psalm-var array<string, string>
|
83 |
+
*/
|
84 |
private $classMap = array();
|
85 |
+
|
86 |
+
/** @var bool */
|
87 |
private $classMapAuthoritative = false;
|
88 |
+
|
89 |
+
/**
|
90 |
+
* @var bool[]
|
91 |
+
* @psalm-var array<string, bool>
|
92 |
+
*/
|
93 |
private $missingClasses = array();
|
94 |
+
|
95 |
+
/** @var ?string */
|
96 |
private $apcuPrefix;
|
97 |
|
98 |
+
/**
|
99 |
+
* @var self[]
|
100 |
+
*/
|
101 |
+
private static $registeredLoaders = array();
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @param ?string $vendorDir
|
105 |
+
*/
|
106 |
+
public function __construct($vendorDir = null)
|
107 |
+
{
|
108 |
+
$this->vendorDir = $vendorDir;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @return string[]
|
113 |
+
*/
|
114 |
public function getPrefixes()
|
115 |
{
|
116 |
if (!empty($this->prefixesPsr0)) {
|
117 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
118 |
}
|
119 |
|
120 |
return array();
|
121 |
}
|
122 |
|
123 |
+
/**
|
124 |
+
* @return array[]
|
125 |
+
* @psalm-return array<string, array<int, string>>
|
126 |
+
*/
|
127 |
public function getPrefixesPsr4()
|
128 |
{
|
129 |
return $this->prefixDirsPsr4;
|
130 |
}
|
131 |
|
132 |
+
/**
|
133 |
+
* @return array[]
|
134 |
+
* @psalm-return array<string, string>
|
135 |
+
*/
|
136 |
public function getFallbackDirs()
|
137 |
{
|
138 |
return $this->fallbackDirsPsr0;
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* @return array[]
|
143 |
+
* @psalm-return array<string, string>
|
144 |
+
*/
|
145 |
public function getFallbackDirsPsr4()
|
146 |
{
|
147 |
return $this->fallbackDirsPsr4;
|
148 |
}
|
149 |
|
150 |
+
/**
|
151 |
+
* @return string[] Array of classname => path
|
152 |
+
* @psalm-return array<string, string>
|
153 |
+
*/
|
154 |
public function getClassMap()
|
155 |
{
|
156 |
return $this->classMap;
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
+
* @param string[] $classMap Class to filename map
|
161 |
+
* @psalm-param array<string, string> $classMap
|
162 |
+
*
|
163 |
+
* @return void
|
164 |
*/
|
165 |
public function addClassMap(array $classMap)
|
166 |
{
|
175 |
* Registers a set of PSR-0 directories for a given prefix, either
|
176 |
* appending or prepending to the ones previously set for this prefix.
|
177 |
*
|
178 |
+
* @param string $prefix The prefix
|
179 |
+
* @param string[]|string $paths The PSR-0 root directories
|
180 |
+
* @param bool $prepend Whether to prepend the directories
|
181 |
+
*
|
182 |
+
* @return void
|
183 |
*/
|
184 |
public function add($prefix, $paths, $prepend = false)
|
185 |
{
|
222 |
* Registers a set of PSR-4 directories for a given namespace, either
|
223 |
* appending or prepending to the ones previously set for this namespace.
|
224 |
*
|
225 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
226 |
+
* @param string[]|string $paths The PSR-4 base directories
|
227 |
+
* @param bool $prepend Whether to prepend the directories
|
228 |
*
|
229 |
* @throws \InvalidArgumentException
|
230 |
+
*
|
231 |
+
* @return void
|
232 |
*/
|
233 |
public function addPsr4($prefix, $paths, $prepend = false)
|
234 |
{
|
272 |
* Registers a set of PSR-0 directories for a given prefix,
|
273 |
* replacing any others previously set for this prefix.
|
274 |
*
|
275 |
+
* @param string $prefix The prefix
|
276 |
+
* @param string[]|string $paths The PSR-0 base directories
|
277 |
+
*
|
278 |
+
* @return void
|
279 |
*/
|
280 |
public function set($prefix, $paths)
|
281 |
{
|
290 |
* Registers a set of PSR-4 directories for a given namespace,
|
291 |
* replacing any others previously set for this namespace.
|
292 |
*
|
293 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
294 |
+
* @param string[]|string $paths The PSR-4 base directories
|
295 |
*
|
296 |
* @throws \InvalidArgumentException
|
297 |
+
*
|
298 |
+
* @return void
|
299 |
*/
|
300 |
public function setPsr4($prefix, $paths)
|
301 |
{
|
315 |
* Turns on searching the include path for class files.
|
316 |
*
|
317 |
* @param bool $useIncludePath
|
318 |
+
*
|
319 |
+
* @return void
|
320 |
*/
|
321 |
public function setUseIncludePath($useIncludePath)
|
322 |
{
|
339 |
* that have not been registered with the class map.
|
340 |
*
|
341 |
* @param bool $classMapAuthoritative
|
342 |
+
*
|
343 |
+
* @return void
|
344 |
*/
|
345 |
public function setClassMapAuthoritative($classMapAuthoritative)
|
346 |
{
|
361 |
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
362 |
*
|
363 |
* @param string|null $apcuPrefix
|
364 |
+
*
|
365 |
+
* @return void
|
366 |
*/
|
367 |
public function setApcuPrefix($apcuPrefix)
|
368 |
{
|
369 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
370 |
}
|
371 |
|
372 |
/**
|
383 |
* Registers this instance as an autoloader.
|
384 |
*
|
385 |
* @param bool $prepend Whether to prepend the autoloader or not
|
386 |
+
*
|
387 |
+
* @return void
|
388 |
*/
|
389 |
public function register($prepend = false)
|
390 |
{
|
391 |
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
392 |
+
|
393 |
+
if (null === $this->vendorDir) {
|
394 |
+
return;
|
395 |
+
}
|
396 |
+
|
397 |
+
if ($prepend) {
|
398 |
+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
399 |
+
} else {
|
400 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
401 |
+
self::$registeredLoaders[$this->vendorDir] = $this;
|
402 |
+
}
|
403 |
}
|
404 |
|
405 |
/**
|
406 |
* Unregisters this instance as an autoloader.
|
407 |
+
*
|
408 |
+
* @return void
|
409 |
*/
|
410 |
public function unregister()
|
411 |
{
|
412 |
spl_autoload_unregister(array($this, 'loadClass'));
|
413 |
+
|
414 |
+
if (null !== $this->vendorDir) {
|
415 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
416 |
+
}
|
417 |
}
|
418 |
|
419 |
/**
|
420 |
* Loads the given class or interface.
|
421 |
*
|
422 |
* @param string $class The name of the class
|
423 |
+
* @return true|null True if loaded, null otherwise
|
424 |
*/
|
425 |
public function loadClass($class)
|
426 |
{
|
429 |
|
430 |
return true;
|
431 |
}
|
432 |
+
|
433 |
+
return null;
|
434 |
}
|
435 |
|
436 |
/**
|
475 |
return $file;
|
476 |
}
|
477 |
|
478 |
+
/**
|
479 |
+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
480 |
+
*
|
481 |
+
* @return self[]
|
482 |
+
*/
|
483 |
+
public static function getRegisteredLoaders()
|
484 |
+
{
|
485 |
+
return self::$registeredLoaders;
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* @param string $class
|
490 |
+
* @param string $ext
|
491 |
+
* @return string|false
|
492 |
+
*/
|
493 |
private function findFileWithExtension($class, $ext)
|
494 |
{
|
495 |
// PSR-4 lookup
|
500 |
$subPath = $class;
|
501 |
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
502 |
$subPath = substr($subPath, 0, $lastPos);
|
503 |
+
$search = $subPath . '\\';
|
504 |
if (isset($this->prefixDirsPsr4[$search])) {
|
505 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
506 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
507 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
|
|
508 |
return $file;
|
509 |
}
|
510 |
}
|
561 |
* Scope isolated include.
|
562 |
*
|
563 |
* Prevents access to $this/self from included files.
|
564 |
+
*
|
565 |
+
* @param string $file
|
566 |
+
* @return void
|
567 |
+
* @private
|
568 |
*/
|
569 |
function includeFile($file)
|
570 |
{
|
vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer;
|
14 |
+
|
15 |
+
use Composer\Autoload\ClassLoader;
|
16 |
+
use Composer\Semver\VersionParser;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* This class is copied in every Composer installed project and available to all
|
20 |
+
*
|
21 |
+
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
+
*
|
23 |
+
* To require its presence, you can require `composer-runtime-api ^2.0`
|
24 |
+
*/
|
25 |
+
class InstalledVersions
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* @var mixed[]|null
|
29 |
+
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
30 |
+
*/
|
31 |
+
private static $installed;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var bool|null
|
35 |
+
*/
|
36 |
+
private static $canGetVendors;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var array[]
|
40 |
+
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
41 |
+
*/
|
42 |
+
private static $installedByVendor = array();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
46 |
+
*
|
47 |
+
* @return string[]
|
48 |
+
* @psalm-return list<string>
|
49 |
+
*/
|
50 |
+
public static function getInstalledPackages()
|
51 |
+
{
|
52 |
+
$packages = array();
|
53 |
+
foreach (self::getInstalled() as $installed) {
|
54 |
+
$packages[] = array_keys($installed['versions']);
|
55 |
+
}
|
56 |
+
|
57 |
+
if (1 === \count($packages)) {
|
58 |
+
return $packages[0];
|
59 |
+
}
|
60 |
+
|
61 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns a list of all package names with a specific type e.g. 'library'
|
66 |
+
*
|
67 |
+
* @param string $type
|
68 |
+
* @return string[]
|
69 |
+
* @psalm-return list<string>
|
70 |
+
*/
|
71 |
+
public static function getInstalledPackagesByType($type)
|
72 |
+
{
|
73 |
+
$packagesByType = array();
|
74 |
+
|
75 |
+
foreach (self::getInstalled() as $installed) {
|
76 |
+
foreach ($installed['versions'] as $name => $package) {
|
77 |
+
if (isset($package['type']) && $package['type'] === $type) {
|
78 |
+
$packagesByType[] = $name;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
return $packagesByType;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Checks whether the given package is installed
|
88 |
+
*
|
89 |
+
* This also returns true if the package name is provided or replaced by another package
|
90 |
+
*
|
91 |
+
* @param string $packageName
|
92 |
+
* @param bool $includeDevRequirements
|
93 |
+
* @return bool
|
94 |
+
*/
|
95 |
+
public static function isInstalled($packageName, $includeDevRequirements = true)
|
96 |
+
{
|
97 |
+
foreach (self::getInstalled() as $installed) {
|
98 |
+
if (isset($installed['versions'][$packageName])) {
|
99 |
+
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Checks whether the given package satisfies a version constraint
|
108 |
+
*
|
109 |
+
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
110 |
+
*
|
111 |
+
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
112 |
+
*
|
113 |
+
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
114 |
+
* @param string $packageName
|
115 |
+
* @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
|
116 |
+
* @return bool
|
117 |
+
*/
|
118 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
119 |
+
{
|
120 |
+
$constraint = $parser->parseConstraints($constraint);
|
121 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
122 |
+
|
123 |
+
return $provided->matches($constraint);
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Returns a version constraint representing all the range(s) which are installed for a given package
|
128 |
+
*
|
129 |
+
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
130 |
+
* whether a given version of a package is installed, and not just whether it exists
|
131 |
+
*
|
132 |
+
* @param string $packageName
|
133 |
+
* @return string Version constraint usable with composer/semver
|
134 |
+
*/
|
135 |
+
public static function getVersionRanges($packageName)
|
136 |
+
{
|
137 |
+
foreach (self::getInstalled() as $installed) {
|
138 |
+
if (!isset($installed['versions'][$packageName])) {
|
139 |
+
continue;
|
140 |
+
}
|
141 |
+
|
142 |
+
$ranges = array();
|
143 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
144 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
145 |
+
}
|
146 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
147 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
148 |
+
}
|
149 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
150 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
151 |
+
}
|
152 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
153 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
154 |
+
}
|
155 |
+
|
156 |
+
return implode(' || ', $ranges);
|
157 |
+
}
|
158 |
+
|
159 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* @param string $packageName
|
164 |
+
* @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
|
165 |
+
*/
|
166 |
+
public static function getVersion($packageName)
|
167 |
+
{
|
168 |
+
foreach (self::getInstalled() as $installed) {
|
169 |
+
if (!isset($installed['versions'][$packageName])) {
|
170 |
+
continue;
|
171 |
+
}
|
172 |
+
|
173 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
174 |
+
return null;
|
175 |
+
}
|
176 |
+
|
177 |
+
return $installed['versions'][$packageName]['version'];
|
178 |
+
}
|
179 |
+
|
180 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @param string $packageName
|
185 |
+
* @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
|
186 |
+
*/
|
187 |
+
public static function getPrettyVersion($packageName)
|
188 |
+
{
|
189 |
+
foreach (self::getInstalled() as $installed) {
|
190 |
+
if (!isset($installed['versions'][$packageName])) {
|
191 |
+
continue;
|
192 |
+
}
|
193 |
+
|
194 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
195 |
+
return null;
|
196 |
+
}
|
197 |
+
|
198 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
199 |
+
}
|
200 |
+
|
201 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* @param string $packageName
|
206 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
207 |
+
*/
|
208 |
+
public static function getReference($packageName)
|
209 |
+
{
|
210 |
+
foreach (self::getInstalled() as $installed) {
|
211 |
+
if (!isset($installed['versions'][$packageName])) {
|
212 |
+
continue;
|
213 |
+
}
|
214 |
+
|
215 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
216 |
+
return null;
|
217 |
+
}
|
218 |
+
|
219 |
+
return $installed['versions'][$packageName]['reference'];
|
220 |
+
}
|
221 |
+
|
222 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* @param string $packageName
|
227 |
+
* @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.
|
228 |
+
*/
|
229 |
+
public static function getInstallPath($packageName)
|
230 |
+
{
|
231 |
+
foreach (self::getInstalled() as $installed) {
|
232 |
+
if (!isset($installed['versions'][$packageName])) {
|
233 |
+
continue;
|
234 |
+
}
|
235 |
+
|
236 |
+
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
237 |
+
}
|
238 |
+
|
239 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* @return array
|
244 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
245 |
+
*/
|
246 |
+
public static function getRootPackage()
|
247 |
+
{
|
248 |
+
$installed = self::getInstalled();
|
249 |
+
|
250 |
+
return $installed[0]['root'];
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Returns the raw installed.php data for custom implementations
|
255 |
+
*
|
256 |
+
* @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.
|
257 |
+
* @return array[]
|
258 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
259 |
+
*/
|
260 |
+
public static function getRawData()
|
261 |
+
{
|
262 |
+
@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);
|
263 |
+
|
264 |
+
if (null === self::$installed) {
|
265 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
266 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
267 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
268 |
+
self::$installed = include __DIR__ . '/installed.php';
|
269 |
+
} else {
|
270 |
+
self::$installed = array();
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
return self::$installed;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
279 |
+
*
|
280 |
+
* @return array[]
|
281 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
282 |
+
*/
|
283 |
+
public static function getAllRawData()
|
284 |
+
{
|
285 |
+
return self::getInstalled();
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Lets you reload the static array from another file
|
290 |
+
*
|
291 |
+
* This is only useful for complex integrations in which a project needs to use
|
292 |
+
* this class but then also needs to execute another project's autoloader in process,
|
293 |
+
* and wants to ensure both projects have access to their version of installed.php.
|
294 |
+
*
|
295 |
+
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
296 |
+
* the data it needs from this class, then call reload() with
|
297 |
+
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
298 |
+
* the project in which it runs can then also use this class safely, without
|
299 |
+
* interference between PHPUnit's dependencies and the project's dependencies.
|
300 |
+
*
|
301 |
+
* @param array[] $data A vendor/composer/installed.php data set
|
302 |
+
* @return void
|
303 |
+
*
|
304 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
305 |
+
*/
|
306 |
+
public static function reload($data)
|
307 |
+
{
|
308 |
+
self::$installed = $data;
|
309 |
+
self::$installedByVendor = array();
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* @return array[]
|
314 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
315 |
+
*/
|
316 |
+
private static function getInstalled()
|
317 |
+
{
|
318 |
+
if (null === self::$canGetVendors) {
|
319 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
320 |
+
}
|
321 |
+
|
322 |
+
$installed = array();
|
323 |
+
|
324 |
+
if (self::$canGetVendors) {
|
325 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
326 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
327 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
328 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
329 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
330 |
+
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
331 |
+
self::$installed = $installed[count($installed) - 1];
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
if (null === self::$installed) {
|
338 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
339 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
340 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
341 |
+
self::$installed = require __DIR__ . '/installed.php';
|
342 |
+
} else {
|
343 |
+
self::$installed = array();
|
344 |
+
}
|
345 |
+
}
|
346 |
+
$installed[] = self::$installed;
|
347 |
+
|
348 |
+
return $installed;
|
349 |
+
}
|
350 |
+
}
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,6 +6,8 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'
|
10 |
'WP_Dependency_Installer' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
|
|
|
|
|
11 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
'WP_Dependency_Installer' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
|
11 |
+
'WP_Dependency_Installer_Skin' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer-skin.php',
|
12 |
+
'WP_Dismiss_Notice' => $vendorDir . '/afragen/wp-dismiss-notice/wp-dismiss-notice.php',
|
13 |
);
|
vendor/composer/autoload_files.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_files.php @generated by Composer
|
4 |
-
|
5 |
-
$vendorDir = dirname(dirname(__FILE__));
|
6 |
-
$baseDir = dirname($vendorDir);
|
7 |
-
|
8 |
-
return array(
|
9 |
-
'f51bb131284ceb3bf7d980d1de33e647' => $vendorDir . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
|
10 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
10 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
9 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -13,19 +13,24 @@ class ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
|
|
|
|
22 |
spl_autoload_register(array('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'), true, true);
|
23 |
-
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
spl_autoload_unregister(array('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
-
|
29 |
|
30 |
call_user_func(\Composer\Autoload\ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::getInitializer($loader));
|
31 |
} else {
|
@@ -47,24 +52,6 @@ class ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4
|
|
47 |
|
48 |
$loader->register(true);
|
49 |
|
50 |
-
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$files;
|
52 |
-
} else {
|
53 |
-
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
-
}
|
55 |
-
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
composerRequire7bccf5ae526588cfb1b3cd6112f8e2a4($fileIdentifier, $file);
|
57 |
-
}
|
58 |
-
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
-
|
63 |
-
function composerRequire7bccf5ae526588cfb1b3cd6112f8e2a4($fileIdentifier, $file)
|
64 |
-
{
|
65 |
-
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
-
require $file;
|
67 |
-
|
68 |
-
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
69 |
-
}
|
70 |
-
}
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
require __DIR__ . '/platform_check.php';
|
26 |
+
|
27 |
spl_autoload_register(array('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'), true, true);
|
28 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
spl_autoload_unregister(array('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'));
|
30 |
|
31 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
if ($useStaticLoader) {
|
33 |
+
require __DIR__ . '/autoload_static.php';
|
34 |
|
35 |
call_user_func(\Composer\Autoload\ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::getInitializer($loader));
|
36 |
} else {
|
52 |
|
53 |
$loader->register(true);
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
return $loader;
|
56 |
}
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/autoload_static.php
CHANGED
@@ -6,34 +6,16 @@ namespace Composer\Autoload;
|
|
6 |
|
7 |
class ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4
|
8 |
{
|
9 |
-
public static $files = array (
|
10 |
-
'f51bb131284ceb3bf7d980d1de33e647' => __DIR__ . '/..' . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
|
11 |
-
);
|
12 |
-
|
13 |
-
public static $prefixLengthsPsr4 = array (
|
14 |
-
'C' =>
|
15 |
-
array (
|
16 |
-
'Composer\\Installers\\' => 20,
|
17 |
-
),
|
18 |
-
);
|
19 |
-
|
20 |
-
public static $prefixDirsPsr4 = array (
|
21 |
-
'Composer\\Installers\\' =>
|
22 |
-
array (
|
23 |
-
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
24 |
-
),
|
25 |
-
);
|
26 |
-
|
27 |
public static $classMap = array (
|
28 |
-
'
|
29 |
'WP_Dependency_Installer' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
|
|
|
|
|
30 |
);
|
31 |
|
32 |
public static function getInitializer(ClassLoader $loader)
|
33 |
{
|
34 |
return \Closure::bind(function () use ($loader) {
|
35 |
-
$loader->prefixLengthsPsr4 = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$prefixLengthsPsr4;
|
36 |
-
$loader->prefixDirsPsr4 = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$prefixDirsPsr4;
|
37 |
$loader->classMap = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$classMap;
|
38 |
|
39 |
}, null, ClassLoader::class);
|
6 |
|
7 |
class ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4
|
8 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
public static $classMap = array (
|
10 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
11 |
'WP_Dependency_Installer' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
|
12 |
+
'WP_Dependency_Installer_Skin' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer-skin.php',
|
13 |
+
'WP_Dismiss_Notice' => __DIR__ . '/..' . '/afragen/wp-dismiss-notice/wp-dismiss-notice.php',
|
14 |
);
|
15 |
|
16 |
public static function getInitializer(ClassLoader $loader)
|
17 |
{
|
18 |
return \Closure::bind(function () use ($loader) {
|
|
|
|
|
19 |
$loader->classMap = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$classMap;
|
20 |
|
21 |
}, null, ClassLoader::class);
|
vendor/composer/installed.json
CHANGED
@@ -1,201 +1,114 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
"
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
"
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
"
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
"
|
23 |
-
|
24 |
-
|
25 |
-
"
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
"
|
32 |
-
"
|
33 |
-
"
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
"
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
"
|
65 |
-
"Maya",
|
66 |
-
"OXID",
|
67 |
-
"Plentymarkets",
|
68 |
-
"Porto",
|
69 |
-
"RadPHP",
|
70 |
-
"SMF",
|
71 |
-
"Thelia",
|
72 |
-
"WolfCMS",
|
73 |
-
"agl",
|
74 |
-
"aimeos",
|
75 |
-
"annotatecms",
|
76 |
-
"attogram",
|
77 |
-
"bitrix",
|
78 |
-
"cakephp",
|
79 |
-
"chef",
|
80 |
-
"cockpit",
|
81 |
-
"codeigniter",
|
82 |
-
"concrete5",
|
83 |
-
"croogo",
|
84 |
-
"dokuwiki",
|
85 |
-
"drupal",
|
86 |
-
"eZ Platform",
|
87 |
-
"elgg",
|
88 |
-
"expressionengine",
|
89 |
-
"fuelphp",
|
90 |
-
"grav",
|
91 |
-
"installer",
|
92 |
-
"itop",
|
93 |
-
"joomla",
|
94 |
-
"kohana",
|
95 |
-
"laravel",
|
96 |
-
"lavalite",
|
97 |
-
"lithium",
|
98 |
-
"magento",
|
99 |
-
"majima",
|
100 |
-
"mako",
|
101 |
-
"mediawiki",
|
102 |
-
"modulework",
|
103 |
-
"modx",
|
104 |
-
"moodle",
|
105 |
-
"osclass",
|
106 |
-
"phpbb",
|
107 |
-
"piwik",
|
108 |
-
"ppi",
|
109 |
-
"puppet",
|
110 |
-
"pxcms",
|
111 |
-
"reindex",
|
112 |
-
"roundcube",
|
113 |
-
"shopware",
|
114 |
-
"silverstripe",
|
115 |
-
"sydes",
|
116 |
-
"symfony",
|
117 |
-
"typo3",
|
118 |
-
"wordpress",
|
119 |
-
"yawik",
|
120 |
-
"zend",
|
121 |
-
"zikula"
|
122 |
-
]
|
123 |
-
},
|
124 |
-
{
|
125 |
-
"name": "collizo4sky/persist-admin-notices-dismissal",
|
126 |
-
"version": "1.3.2",
|
127 |
-
"version_normalized": "1.3.2.0",
|
128 |
-
"source": {
|
129 |
-
"type": "git",
|
130 |
-
"url": "https://github.com/collizo4sky/persist-admin-notices-dismissal.git",
|
131 |
-
"reference": "b80673631d14f10af9747283d08434619232c003"
|
132 |
-
},
|
133 |
-
"dist": {
|
134 |
-
"type": "zip",
|
135 |
-
"url": "https://api.github.com/repos/collizo4sky/persist-admin-notices-dismissal/zipball/b80673631d14f10af9747283d08434619232c003",
|
136 |
-
"reference": "b80673631d14f10af9747283d08434619232c003",
|
137 |
-
"shasum": ""
|
138 |
-
},
|
139 |
-
"time": "2018-01-23T03:14:06+00:00",
|
140 |
-
"type": "library",
|
141 |
-
"installation-source": "dist",
|
142 |
-
"autoload": {
|
143 |
-
"files": [
|
144 |
-
"persist-admin-notices-dismissal.php"
|
145 |
-
]
|
146 |
-
},
|
147 |
-
"notification-url": "https://packagist.org/downloads/",
|
148 |
-
"authors": [
|
149 |
-
{
|
150 |
-
"name": "Collins Agbonghama",
|
151 |
-
"email": "me@w3guy.com"
|
152 |
-
}
|
153 |
-
],
|
154 |
-
"description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."
|
155 |
-
},
|
156 |
-
{
|
157 |
-
"name": "afragen/wp-dependency-installer",
|
158 |
-
"version": "1.4.8",
|
159 |
-
"version_normalized": "1.4.8.0",
|
160 |
-
"source": {
|
161 |
-
"type": "git",
|
162 |
-
"url": "https://github.com/afragen/wp-dependency-installer.git",
|
163 |
-
"reference": "ea09e08c20e9071f5a0e61fae6c5b34a72e3e55f"
|
164 |
-
},
|
165 |
-
"dist": {
|
166 |
-
"type": "zip",
|
167 |
-
"url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/ea09e08c20e9071f5a0e61fae6c5b34a72e3e55f",
|
168 |
-
"reference": "ea09e08c20e9071f5a0e61fae6c5b34a72e3e55f",
|
169 |
-
"shasum": ""
|
170 |
-
},
|
171 |
-
"require": {
|
172 |
-
"collizo4sky/persist-admin-notices-dismissal": "^1",
|
173 |
-
"php": ">=5.3"
|
174 |
-
},
|
175 |
-
"time": "2018-11-26T00:08:14+00:00",
|
176 |
-
"type": "library",
|
177 |
-
"installation-source": "dist",
|
178 |
-
"autoload": {
|
179 |
-
"classmap": [
|
180 |
-
"wp-dependency-installer.php"
|
181 |
-
]
|
182 |
},
|
183 |
-
|
184 |
-
|
185 |
-
"
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
"
|
190 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
},
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
],
|
199 |
-
"description": "Library that helps WordPress plugin dependency management."
|
200 |
-
}
|
201 |
-
]
|
1 |
+
{
|
2 |
+
"packages": [
|
3 |
+
{
|
4 |
+
"name": "afragen/wp-dependency-installer",
|
5 |
+
"version": "4.3.1",
|
6 |
+
"version_normalized": "4.3.1.0",
|
7 |
+
"source": {
|
8 |
+
"type": "git",
|
9 |
+
"url": "https://github.com/afragen/wp-dependency-installer.git",
|
10 |
+
"reference": "6572e3b8027dd1f0f5655eeea482ddef22d8ca7c"
|
11 |
+
},
|
12 |
+
"dist": {
|
13 |
+
"type": "zip",
|
14 |
+
"url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/6572e3b8027dd1f0f5655eeea482ddef22d8ca7c",
|
15 |
+
"reference": "6572e3b8027dd1f0f5655eeea482ddef22d8ca7c",
|
16 |
+
"shasum": ""
|
17 |
+
},
|
18 |
+
"require": {
|
19 |
+
"afragen/wp-dismiss-notice": "*",
|
20 |
+
"php": ">=5.6"
|
21 |
+
},
|
22 |
+
"time": "2022-01-19T00:48:02+00:00",
|
23 |
+
"type": "library",
|
24 |
+
"installation-source": "dist",
|
25 |
+
"autoload": {
|
26 |
+
"classmap": [
|
27 |
+
"wp-dependency-installer.php",
|
28 |
+
"wp-dependency-installer-skin.php"
|
29 |
+
]
|
30 |
+
},
|
31 |
+
"notification-url": "https://packagist.org/downloads/",
|
32 |
+
"license": [
|
33 |
+
"MIT"
|
34 |
+
],
|
35 |
+
"authors": [
|
36 |
+
{
|
37 |
+
"name": "Andy Fragen",
|
38 |
+
"email": "andy@thefragens.com",
|
39 |
+
"homepage": "https://thefragens.com",
|
40 |
+
"role": "Developer"
|
41 |
+
},
|
42 |
+
{
|
43 |
+
"name": "Matt Gibbs",
|
44 |
+
"homepage": "https://facetwp.com",
|
45 |
+
"role": "Developer"
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"name": "Raruto",
|
49 |
+
"homepage": "https://raruto.github.io",
|
50 |
+
"role": "Developer"
|
51 |
+
}
|
52 |
+
],
|
53 |
+
"description": "Library that helps WordPress plugin dependency management.",
|
54 |
+
"support": {
|
55 |
+
"issues": "https://github.com/afragen/wp-dependency-installer/issues",
|
56 |
+
"source": "https://github.com/afragen/wp-dependency-installer"
|
57 |
+
},
|
58 |
+
"funding": [
|
59 |
+
{
|
60 |
+
"url": "https://github.com/afragen",
|
61 |
+
"type": "github"
|
62 |
+
}
|
63 |
+
],
|
64 |
+
"install-path": "../afragen/wp-dependency-installer"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
},
|
66 |
+
{
|
67 |
+
"name": "afragen/wp-dismiss-notice",
|
68 |
+
"version": "0.2.3",
|
69 |
+
"version_normalized": "0.2.3.0",
|
70 |
+
"source": {
|
71 |
+
"type": "git",
|
72 |
+
"url": "https://github.com/afragen/wp-dismiss-notice.git",
|
73 |
+
"reference": "21949732f1ea21d81500bdda8f882ac7eb0f98af"
|
74 |
+
},
|
75 |
+
"dist": {
|
76 |
+
"type": "zip",
|
77 |
+
"url": "https://api.github.com/repos/afragen/wp-dismiss-notice/zipball/21949732f1ea21d81500bdda8f882ac7eb0f98af",
|
78 |
+
"reference": "21949732f1ea21d81500bdda8f882ac7eb0f98af",
|
79 |
+
"shasum": ""
|
80 |
+
},
|
81 |
+
"require": {
|
82 |
+
"php": ">=5.6"
|
83 |
+
},
|
84 |
+
"time": "2021-12-19T21:53:57+00:00",
|
85 |
+
"type": "library",
|
86 |
+
"installation-source": "dist",
|
87 |
+
"autoload": {
|
88 |
+
"classmap": [
|
89 |
+
"wp-dismiss-notice.php"
|
90 |
+
]
|
91 |
+
},
|
92 |
+
"notification-url": "https://packagist.org/downloads/",
|
93 |
+
"license": [
|
94 |
+
"MIT"
|
95 |
+
],
|
96 |
+
"authors": [
|
97 |
+
{
|
98 |
+
"name": "Andy Fragen",
|
99 |
+
"email": "andy@thefragens.com",
|
100 |
+
"homepage": "https://thefragens.com",
|
101 |
+
"role": "Developer"
|
102 |
+
}
|
103 |
+
],
|
104 |
+
"description": "Library for time dismissible WordPress admin notices.",
|
105 |
+
"support": {
|
106 |
+
"issues": "https://github.com/afragen/wp-dismiss-notice/issues",
|
107 |
+
"source": "https://github.com/afragen/wp-dismiss-notice"
|
108 |
},
|
109 |
+
"install-path": "../afragen/wp-dismiss-notice"
|
110 |
+
}
|
111 |
+
],
|
112 |
+
"dev": true,
|
113 |
+
"dev-package-names": []
|
114 |
+
}
|
|
|
|
|
|
|
|
vendor/composer/installed.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array(
|
2 |
+
'root' => array(
|
3 |
+
'pretty_version' => '1.0.0+no-version-set',
|
4 |
+
'version' => '1.0.0.0',
|
5 |
+
'type' => 'library',
|
6 |
+
'install_path' => __DIR__ . '/../../',
|
7 |
+
'aliases' => array(),
|
8 |
+
'reference' => NULL,
|
9 |
+
'name' => '__root__',
|
10 |
+
'dev' => true,
|
11 |
+
),
|
12 |
+
'versions' => array(
|
13 |
+
'__root__' => array(
|
14 |
+
'pretty_version' => '1.0.0+no-version-set',
|
15 |
+
'version' => '1.0.0.0',
|
16 |
+
'type' => 'library',
|
17 |
+
'install_path' => __DIR__ . '/../../',
|
18 |
+
'aliases' => array(),
|
19 |
+
'reference' => NULL,
|
20 |
+
'dev_requirement' => false,
|
21 |
+
),
|
22 |
+
'afragen/wp-dependency-installer' => array(
|
23 |
+
'pretty_version' => '4.3.1',
|
24 |
+
'version' => '4.3.1.0',
|
25 |
+
'type' => 'library',
|
26 |
+
'install_path' => __DIR__ . '/../afragen/wp-dependency-installer',
|
27 |
+
'aliases' => array(),
|
28 |
+
'reference' => '6572e3b8027dd1f0f5655eeea482ddef22d8ca7c',
|
29 |
+
'dev_requirement' => false,
|
30 |
+
),
|
31 |
+
'afragen/wp-dismiss-notice' => array(
|
32 |
+
'pretty_version' => '0.2.3',
|
33 |
+
'version' => '0.2.3.0',
|
34 |
+
'type' => 'library',
|
35 |
+
'install_path' => __DIR__ . '/../afragen/wp-dismiss-notice',
|
36 |
+
'aliases' => array(),
|
37 |
+
'reference' => '21949732f1ea21d81500bdda8f882ac7eb0f98af',
|
38 |
+
'dev_requirement' => false,
|
39 |
+
),
|
40 |
+
),
|
41 |
+
);
|
vendor/composer/platform_check.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// platform_check.php @generated by Composer
|
4 |
+
|
5 |
+
$issues = array();
|
6 |
+
|
7 |
+
if (!(PHP_VERSION_ID >= 50600)) {
|
8 |
+
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
|
9 |
+
}
|
10 |
+
|
11 |
+
if ($issues) {
|
12 |
+
if (!headers_sent()) {
|
13 |
+
header('HTTP/1.1 500 Internal Server Error');
|
14 |
+
}
|
15 |
+
if (!ini_get('display_errors')) {
|
16 |
+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
17 |
+
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
18 |
+
} elseif (!headers_sent()) {
|
19 |
+
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;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
trigger_error(
|
23 |
+
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
24 |
+
E_USER_ERROR
|
25 |
+
);
|
26 |
+
}
|