Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit f3d8dba

Browse files
committed
Adding /vendor directory to release
1 parent 8ce0142 commit f3d8dba

File tree

157 files changed

+8782
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+8782
-0
lines changed

vendor/autoload.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// autoload.php @generated by Composer
4+
5+
require_once __DIR__ . '/composer/autoload_real.php';
6+
7+
return ComposerAutoloaderInita01accc2f64bb0cf4faea4c86b89896b::getLoader();

vendor/autoload_packages.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* This file was automatically generated by automattic/jetpack-autoloader.
4+
*
5+
* @package automattic/jetpack-autoloader
6+
*/
7+
8+
namespace Automattic\Jetpack\Autoloader\jpa01accc2f64bb0cf4faea4c86b89896b;
9+
10+
// phpcs:ignore
11+
12+
require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
13+
Autoloader::init();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/php/tmp
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.10.1] - 2021-03-30
9+
### Added
10+
- Composer alias for dev-master, to improve dependencies
11+
- Tests: Added code coverage transformation
12+
13+
### Changed
14+
- Update package dependencies.
15+
16+
### Fixed
17+
- Fix coverage test
18+
- Fix uninstallation fatal
19+
- Update tests for changed composer 2.0.9 hash.
20+
- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in.
21+
22+
## [2.10.0] - 2021-02-09
23+
24+
- Autoloader: test suite refactor
25+
26+
## [2.9.1] - 2021-02-05
27+
28+
- CI: Make tests more generic
29+
- Autoloader: stricter type-checking on WP functions
30+
- Autoloader: prevent transitive plugin execution
31+
32+
## [2.9.0] - 2021-01-25
33+
34+
- Autoloader: revised latest autoloader inclusion semantics
35+
- Add mirror-repo information to all current composer packages
36+
- Monorepo: Reorganize all projects
37+
- Autoloader: Don't cache deactivating plugins
38+
39+
## [2.8.0] - 2020-12-18
40+
41+
## [2.7.1] - 2020-12-18
42+
43+
- Autoloader: Added realpath resolution to plugin paths
44+
45+
## [2.7.0] - 2020-12-08
46+
47+
- Autoloader: Preemptively load unknown plugins from cache
48+
- Removed unwanted dot
49+
- Pin dependencies
50+
- Packages: Update for PHP 8 testing
51+
52+
## [2.6.0] - 2020-11-19
53+
54+
- Autoloader: AutoloadGenerator no longer extends Composer's AutoloadGenerator class
55+
- Autoloader: Reuse an existing autoloader suffix if available
56+
- Updated PHPCS: Packages and Debugger
57+
58+
## [2.5.0] - 2020-10-08
59+
60+
- Autoloader: remove the defined('JETPACK_AUTOLOAD_DEV') checks from the tests
61+
62+
## [2.4.0] - 2020-09-28
63+
64+
- Autoloader: remove the plugins_loaded bullet point from the README
65+
- Packages: avoid PHPCS warnings
66+
- Autoloader: add PSR-0 support
67+
- Autoloader: Detect filtering of active_plugins
68+
- Autoloader: Support unoptimized PSR-4
69+
70+
## [2.3.0] - 2020-08-21
71+
72+
- Autoloader: remove the plugin update hook
73+
74+
## [2.2.0] - 2020-08-14
75+
76+
- Autoloader: don't reset the autoloader version during plugin update
77+
- CI: Try collect js coverage
78+
79+
## [2.1.0] - 2020-07-27
80+
81+
- Autoloader: convert '\' directory separators to '/' in plugin paths
82+
- Autoloader: Avoid a PHP warning when an empty string is passed to `is_directory_plugin()`.
83+
- Autoloader: Tests: Use a string with define
84+
85+
## [2.0.2] - 2020-07-09
86+
87+
- Autoloader: Avoid a PHP warning when an empty string is passed to `is_directory_plugin()`.
88+
89+
## [2.0.1] - 2020-07-02
90+
91+
- Autoloader: Tests: Use a string with define
92+
93+
## [2.0.0] - 2020-06-29
94+
95+
## [2.0.0-beta] - 2020-06-29
96+
97+
- Autoloader: Support Composer v2.0
98+
- Autoloader: use paths to identify plugins instead of the directories
99+
- Autoloader: fix the fatal that occurs during plugin update
100+
- Autoloader: add fallback check for plugin path in mu-plugins
101+
- Autoloader: use JETPACK__PLUGIN_DIR when looking for the jetpack plugin directory.
102+
- Feature Branch: Update the Autoloader
103+
- PHPCS: Clean up the packages
104+
- PHPCS Updates after WPCS 2.3
105+
106+
## [1.7.0] - 2020-04-23
107+
108+
- Jetpack: Move comment notification override back to the constructor
109+
110+
## [1.6.0] - 2020-03-26
111+
112+
- Autoloader: Remove file check to improve performance.
113+
114+
## [1.5.0] - 2020-02-25
115+
116+
- Jetpack: instantiate manager object if it's null
117+
118+
## [1.4.1] - 2020-02-14
119+
120+
- Autoloader: Load only latest version of autoload files to avoid conflicts.
121+
122+
## [1.4.0] - 2020-01-23
123+
124+
- Autoloader: Remove the ignored classes
125+
126+
## [1.3.8] - 2020-01-14
127+
128+
- Trying to add deterministic initialization.
129+
- Autoloader: Remove Manager_Interface and Plugin\Tracking from ignored list
130+
- Autoloader: Remove Jetpack_IXR_Client from ignore list
131+
132+
## [1.3.7] - 2019-12-10
133+
134+
## [1.3.6] - 2019-12-09
135+
136+
- Autoloader: Use long-form sytax for array
137+
138+
## [1.3.5] - 2019-11-26
139+
140+
- Fix/php notice status
141+
142+
## [1.3.4] - 2019-11-08
143+
144+
- Deprecate Jetpack::is_development_mode() in favor of the packaged Status()-&gt;is_development_mode()
145+
146+
## [1.3.3] - 2019-10-28
147+
148+
- Packages: Add gitattributes files to all packages that need th…
149+
150+
## [1.3.2] - 2019-09-24
151+
152+
- Autoloader: Cover scenarios where composer/autoload_files.php…
153+
154+
## [1.3.1] - 2019-09-20
155+
156+
- Docs: Unify usage of @package phpdoc tags
157+
158+
## [1.3.0] - 2019-09-14
159+
160+
- Fix for empty namespaces. #13459
161+
- Connection: Move the Jetpack IXR client to the package
162+
- Adds full connection cycle capability to the Connection package.
163+
- Jetpack 7.5: Back compatibility package
164+
165+
## [1.2.0] - 2019-06-24
166+
167+
- Jetpack DNA: Add full classmap support to Autoloader
168+
- Move Jetpack_Sync_Main from legacy to PSR-4
169+
170+
## [1.1.0] - 2019-06-19
171+
172+
- Packages: Move autoloader tests to the package
173+
- DNA: Move Jetpack Usage tracking to its own file
174+
- Jetpack DNA: More isolation of Tracks Package
175+
- Autoloader: Ignore XMLRPC_Connector if called too early
176+
- Autoloader: Ignore Jetpack_Signature if called too early
177+
178+
## 1.0.0 - 2019-06-11
179+
180+
- Add Custom Autoloader
181+
182+
[2.10.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.10.0...v2.10.1
183+
[2.10.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.9.1...v2.10.0
184+
[2.9.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.9.0...v2.9.1
185+
[2.9.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.8.0...v2.9.0
186+
[2.8.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.7.1...v2.8.0
187+
[2.7.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.7.0...v2.7.1
188+
[2.7.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.6.0...v2.7.0
189+
[2.6.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.5.0...v2.6.0
190+
[2.5.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.4.0...v2.5.0
191+
[2.4.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.3.0...v2.4.0
192+
[2.3.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.2.0...v2.3.0
193+
[2.2.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.1.0...v2.2.0
194+
[2.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.2...v2.1.0
195+
[2.0.2]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.1...v2.0.2
196+
[2.0.1]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.0...v2.0.1
197+
[2.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v2.0.0-beta...v2.0.0
198+
[2.0.0-beta]: https://github.com/Automattic/jetpack-autoloader/compare/v1.7.0...v2.0.0-beta
199+
[1.7.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.6.0...v1.7.0
200+
[1.6.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.5.0...v1.6.0
201+
[1.5.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.4.1...v1.5.0
202+
[1.4.1]: https://github.com/Automattic/jetpack-autoloader/compare/v1.4.0...v1.4.1
203+
[1.4.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.8...v1.4.0
204+
[1.3.8]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.7...v1.3.8
205+
[1.3.7]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.6...v1.3.7
206+
[1.3.6]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.5...v1.3.6
207+
[1.3.5]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.4...v1.3.5
208+
[1.3.4]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.3...v1.3.4
209+
[1.3.3]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.2...v1.3.3
210+
[1.3.2]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.1...v1.3.2
211+
[1.3.1]: https://github.com/Automattic/jetpack-autoloader/compare/v1.3.0...v1.3.1
212+
[1.3.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.2.0...v1.3.0
213+
[1.2.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.1.0...v1.2.0
214+
[1.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v1.0.0...v1.1.0
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
A custom autoloader for Composer
2+
=====================================
3+
4+
This is a custom autoloader generator that uses a classmap to always load the latest version of a class.
5+
6+
The problem this autoloader is trying to solve is conflicts that arise when two or more plugins use the same package, but one of the plugins uses an older version of said package.
7+
8+
This is solved by keeping an in memory map of all the different classes that can be loaded, and updating the map with the path to the latest version of the package for the autoloader to find when we instantiate the class.
9+
10+
It diverges from the default Composer autoloader setup in the following ways:
11+
12+
* It creates `jetpack_autoload_classmap.php` and `jetpack_autoload_filemap.php` files in the `vendor/composer` directory.
13+
* This file includes the version numbers from each package that is used.
14+
* The autoloader will only load the latest version of the library no matter what plugin loads the library.
15+
16+
17+
Usage
18+
-----
19+
20+
In your project's `composer.json`, add the following lines:
21+
22+
```json
23+
{
24+
"require-dev": {
25+
"automattic/jetpack-autoloader": "^1"
26+
}
27+
}
28+
```
29+
30+
Your project must use the default composer vendor directory, `vendor`.
31+
32+
After the next update/install, you will have a `vendor/autoload_packages.php` file.
33+
Load the file in your plugin via main plugin file.
34+
35+
In the main plugin you will also need to include the files like this.
36+
```php
37+
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';
38+
```
39+
40+
Working with Development Versions of Packages
41+
-----
42+
43+
The autoloader will attempt to use the package with the latest semantic version.
44+
45+
During development, you can force the autoloader to use development package versions by setting the `JETPACK_AUTOLOAD_DEV` constant to true. When `JETPACK_AUTOLOAD_DEV` is true, the autoloader will prefer the following versions over semantic versions:
46+
- `9999999-dev`
47+
- Versions with a `dev-` prefix.
48+
49+
50+
Autoloading Standards
51+
----
52+
53+
All new Jetpack package development should use classmap autoloading, which allows the class and file names to comply with the WordPress Coding Standards.
54+
55+
### Optimized Autoloader
56+
57+
An optimized autoloader is generated when:
58+
* `composer install` or `composer update` is called with `-o` or `--optimize-autoloader`
59+
* `composer dump-autoload` is called with `-o` or `--optimize`
60+
61+
PSR-4 and PSR-0 namespaces are converted to classmaps.
62+
63+
### Unoptimized Autoloader
64+
65+
Supports PSR-4 autoloading. PSR-0 namespaces are converted to classmaps.
66+
67+
68+
Autoloader Limitations
69+
-----
70+
71+
Plugin Updates
72+
73+
When moving a package class file, renaming a package class file, or changing a package class namespace, make sure that the class will not be loaded after a plugin update.
74+
75+
The autoloader builds the in memory classmap as soon as the autoloader is loaded. The package class file paths in the map are not updated after a plugin update. If a plugins's package class files are moved during a plugin update and a moved file is autoloaded after the update, an error will occur.
76+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "automattic/jetpack-autoloader",
3+
"description": "Creates a custom autoloader for a plugin or theme.",
4+
"type": "composer-plugin",
5+
"license": "GPL-2.0-or-later",
6+
"require": {
7+
"composer-plugin-api": "^1.1 || ^2.0"
8+
},
9+
"require-dev": {
10+
"yoast/phpunit-polyfills": "0.2.0",
11+
"automattic/jetpack-changelogger": "^1.1"
12+
},
13+
"autoload": {
14+
"classmap": [
15+
"src/AutoloadGenerator.php"
16+
],
17+
"psr-4": {
18+
"Automattic\\Jetpack\\Autoloader\\": "src"
19+
}
20+
},
21+
"scripts": {
22+
"phpunit": [
23+
"@composer update",
24+
"./vendor/phpunit/phpunit/phpunit --colors=always"
25+
],
26+
"test-coverage": [
27+
"@composer update",
28+
"phpdbg -d memory_limit=2048M -d max_execution_time=900 -qrr ./vendor/bin/phpunit --coverage-php \"./tests/php/tmp/coverage-report.php\"",
29+
"php ./tests/php/bin/test-coverage.php \"$COVERAGE_DIR/clover.xml\""
30+
],
31+
"test-php": [
32+
"@composer phpunit"
33+
]
34+
},
35+
"repositories": [],
36+
"minimum-stability": "dev",
37+
"prefer-stable": true,
38+
"extra": {
39+
"class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
40+
"mirror-repo": "Automattic/jetpack-autoloader",
41+
"changelogger": {
42+
"link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
43+
},
44+
"branch-alias": {
45+
"dev-master": "2.10.x-dev"
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)