Version Description
Bugfix: Prevent a conflict with WP Rocket Bugfix: apply loading="lazy" on Youtube thumbnail Bugfix: Add autoplay attribute on iframe loaded with Youtube thumbnail
Download this release
Release Info
Developer | wp_media |
Plugin | Lazy Load by WP Rocket |
Version | 2.3.1 |
Comparing to | |
See all releases |
Code changes from version 2.3 to 2.3.1
- composer.json +74 -53
- composer.lock +2695 -2266
- readme.txt +304 -299
- rocket-lazy-load.php +78 -78
- src/Admin/AdminPage.php +176 -176
- src/Admin/ImagifyNotice.php +72 -72
- src/Dependencies/Interop/Container/ContainerInterface.php +15 -0
- src/Dependencies/Interop/Container/Exception/ContainerException.php +15 -0
- src/Dependencies/Interop/Container/Exception/NotFoundException.php +15 -0
- src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php +26 -0
- src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php +82 -0
- src/Dependencies/League/Container/Argument/RawArgument.php +27 -0
- src/Dependencies/League/Container/Argument/RawArgumentInterface.php +13 -0
- src/Dependencies/League/Container/Container.php +305 -0
- src/Dependencies/League/Container/ContainerAwareInterface.php +20 -0
- src/Dependencies/League/Container/ContainerAwareTrait.php +34 -0
- src/Dependencies/League/Container/ContainerInterface.php +59 -0
- src/Dependencies/League/Container/Definition/AbstractDefinition.php +62 -0
- src/Dependencies/League/Container/Definition/CallableDefinition.php +23 -0
- src/Dependencies/League/Container/Definition/ClassDefinition.php +67 -0
- src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php +23 -0
- src/Dependencies/League/Container/Definition/DefinitionFactory.php +28 -0
- src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php +17 -0
- src/Dependencies/League/Container/Definition/DefinitionInterface.php +30 -0
- src/Dependencies/League/Container/Exception/NotFoundException.php +10 -0
- src/Dependencies/League/Container/ImmutableContainerAwareInterface.php +22 -0
- src/Dependencies/League/Container/ImmutableContainerAwareTrait.php +36 -0
- src/Dependencies/League/Container/ImmutableContainerInterface.php +10 -0
- src/Dependencies/League/Container/Inflector/Inflector.php +103 -0
- src/Dependencies/League/Container/Inflector/InflectorAggregate.php +53 -0
- src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php +25 -0
- src/Dependencies/League/Container/ReflectionContainer.php +87 -0
- src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php +27 -0
- src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php +31 -0
- src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php +14 -0
- src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php +88 -0
- src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php +32 -0
- src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php +26 -0
- src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php +24 -0
- src/Dependencies/Psr/Container/ContainerExceptionInterface.php +13 -0
- src/Dependencies/Psr/Container/ContainerInterface.php +37 -0
- src/Dependencies/Psr/Container/NotFoundExceptionInterface.php +13 -0
- src/Dependencies/RocketLazyload/Assets.php +299 -0
- src/Dependencies/RocketLazyload/Iframe.php +202 -0
- src/Dependencies/RocketLazyload/Image.php +474 -0
- src/EventManagement/EventManager.php +145 -145
- src/EventManagement/EventManagerAwareSubscriberInterface.php +21 -21
- src/EventManagement/SubscriberInterface.php +39 -39
- src/Options/AbstractOptions.php +69 -69
- src/Options/OptionArray.php +111 -111
- src/Options/Options.php +106 -106
- src/Plugin.php +97 -97
- src/ServiceProvider/AdminServiceProvider.php +47 -47
- src/ServiceProvider/ImagifyNoticeServiceProvider.php +45 -45
- src/ServiceProvider/LazyloadServiceProvider.php +48 -48
- src/ServiceProvider/OptionServiceProvider.php +45 -45
- src/ServiceProvider/SubscribersServiceProvider.php +60 -60
- src/Subscriber/AdminPageSubscriber.php +142 -142
- src/Subscriber/ImagifyNoticeSubscriber.php +152 -152
- src/Subscriber/LazyloadSubscriber.php +429 -429
- src/Subscriber/ThirdParty/AMPSubscriber.php +73 -73
- src/rocket-lazyload-requirements-check.php +143 -143
- vendor/composer/ClassLoader.php +4 -4
- vendor/composer/installed.json +121 -121
- vendor/wp-media/rocket-lazyload-common/src/Assets.php +2 -2
composer.json
CHANGED
@@ -1,53 +1,74 @@
|
|
1 |
-
{
|
2 |
-
"name": "wp-media/rocket-lazy-load",
|
3 |
-
"description": "Lazy Load images and iframes without jQuery",
|
4 |
-
"keywords": [
|
5 |
-
"wordpress",
|
6 |
-
"lazyload"
|
7 |
-
],
|
8 |
-
"homepage": "https://github.com/wp-media/rocket-lazy-load",
|
9 |
-
"license": "GPL-2.0+",
|
10 |
-
"authors": [
|
11 |
-
{
|
12 |
-
"name": "WP Media",
|
13 |
-
"email": "contact@wp-media.me",
|
14 |
-
"homepage": "https://wp-media.me"
|
15 |
-
}
|
16 |
-
],
|
17 |
-
"type": "wordpress-plugin",
|
18 |
-
"config": {
|
19 |
-
"sort-packages": true
|
20 |
-
},
|
21 |
-
"support": {
|
22 |
-
"issues": "https://github.com/wp-media/rocket-lazy-load/issues",
|
23 |
-
"source": "https://github.com/wp-media/rocket-lazy-load"
|
24 |
-
},
|
25 |
-
"autoload": {
|
26 |
-
"psr-4": {
|
27 |
-
"RocketLazyLoadPlugin\\": "src/"
|
28 |
-
}
|
29 |
-
},
|
30 |
-
"autoload-dev": {
|
31 |
-
"psr-4": {
|
32 |
-
"RocketLazyLoadPlugin\\Tests\\Unit\\": "tests/Unit",
|
33 |
-
"RocketLazyLoadPlugin\\Tests\\Integration\\": "tests/Integration"
|
34 |
-
}
|
35 |
-
},
|
36 |
-
"require": {
|
37 |
-
"php": ">=5.6",
|
38 |
-
"composer/installers": "~1.0",
|
39 |
-
"league/container": "^2.4",
|
40 |
-
"wp-media/rocket-lazyload-common": "^2.0"
|
41 |
-
},
|
42 |
-
"require-dev": {
|
43 |
-
"brain/monkey": "^2.0",
|
44 |
-
"
|
45 |
-
"
|
46 |
-
"
|
47 |
-
"
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "wp-media/rocket-lazy-load",
|
3 |
+
"description": "Lazy Load images and iframes without jQuery",
|
4 |
+
"keywords": [
|
5 |
+
"wordpress",
|
6 |
+
"lazyload"
|
7 |
+
],
|
8 |
+
"homepage": "https://github.com/wp-media/rocket-lazy-load",
|
9 |
+
"license": "GPL-2.0+",
|
10 |
+
"authors": [
|
11 |
+
{
|
12 |
+
"name": "WP Media",
|
13 |
+
"email": "contact@wp-media.me",
|
14 |
+
"homepage": "https://wp-media.me"
|
15 |
+
}
|
16 |
+
],
|
17 |
+
"type": "wordpress-plugin",
|
18 |
+
"config": {
|
19 |
+
"sort-packages": true
|
20 |
+
},
|
21 |
+
"support": {
|
22 |
+
"issues": "https://github.com/wp-media/rocket-lazy-load/issues",
|
23 |
+
"source": "https://github.com/wp-media/rocket-lazy-load"
|
24 |
+
},
|
25 |
+
"autoload": {
|
26 |
+
"psr-4": {
|
27 |
+
"RocketLazyLoadPlugin\\": "src/"
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"autoload-dev": {
|
31 |
+
"psr-4": {
|
32 |
+
"RocketLazyLoadPlugin\\Tests\\Unit\\": "tests/Unit",
|
33 |
+
"RocketLazyLoadPlugin\\Tests\\Integration\\": "tests/Integration"
|
34 |
+
}
|
35 |
+
},
|
36 |
+
"require": {
|
37 |
+
"php": ">=5.6",
|
38 |
+
"composer/installers": "~1.0",
|
39 |
+
"league/container": "^2.4",
|
40 |
+
"wp-media/rocket-lazyload-common": "^2.0"
|
41 |
+
},
|
42 |
+
"require-dev": {
|
43 |
+
"brain/monkey": "^2.0",
|
44 |
+
"coenjacobs/mozart": "^0.4.0",
|
45 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
46 |
+
"phpcompatibility/phpcompatibility-wp": "^2.0",
|
47 |
+
"phpunit/phpunit": "^5.7",
|
48 |
+
"wp-coding-standards/wpcs": "^2.0.0"
|
49 |
+
},
|
50 |
+
"extra": {
|
51 |
+
"mozart": {
|
52 |
+
"dep_namespace": "RocketLazyLoadPlugin\\Dependencies\\",
|
53 |
+
"dep_directory": "/src/Dependencies/",
|
54 |
+
"classmap_directory": "/classes/dependencies/",
|
55 |
+
"classmap_prefix": "RLLP_",
|
56 |
+
"packages": [
|
57 |
+
"wp-media/rocket-lazyload-common",
|
58 |
+
"league/container"
|
59 |
+
]
|
60 |
+
}
|
61 |
+
},
|
62 |
+
"scripts": {
|
63 |
+
"test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always",
|
64 |
+
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist",
|
65 |
+
"post-install-cmd": [
|
66 |
+
"\"vendor/bin/mozart\" compose",
|
67 |
+
"composer dump-autoload"
|
68 |
+
],
|
69 |
+
"post-update-cmd": [
|
70 |
+
"\"vendor/bin/mozart\" compose",
|
71 |
+
"composer dump-autoload"
|
72 |
+
]
|
73 |
+
}
|
74 |
+
}
|
composer.lock
CHANGED
@@ -1,2266 +1,2695 @@
|
|
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#
|
5 |
-
"This file is @generated automatically"
|
6 |
-
],
|
7 |
-
"content-hash": "
|
8 |
-
"packages": [
|
9 |
-
{
|
10 |
-
"name": "composer/installers",
|
11 |
-
"version": "v1.7.0",
|
12 |
-
"source": {
|
13 |
-
"type": "git",
|
14 |
-
"url": "https://github.com/composer/installers.git",
|
15 |
-
"reference": "141b272484481432cda342727a427dc1e206bfa0"
|
16 |
-
},
|
17 |
-
"dist": {
|
18 |
-
"type": "zip",
|
19 |
-
"url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
|
20 |
-
"reference": "141b272484481432cda342727a427dc1e206bfa0",
|
21 |
-
"shasum": ""
|
22 |
-
},
|
23 |
-
"require": {
|
24 |
-
"composer-plugin-api": "^1.0"
|
25 |
-
},
|
26 |
-
"replace": {
|
27 |
-
"roundcube/plugin-installer": "*",
|
28 |
-
"shama/baton": "*"
|
29 |
-
},
|
30 |
-
"require-dev": {
|
31 |
-
"composer/composer": "1.0.*@dev",
|
32 |
-
"phpunit/phpunit": "^4.8.36"
|
33 |
-
},
|
34 |
-
"type": "composer-plugin",
|
35 |
-
"extra": {
|
36 |
-
"class": "Composer\\Installers\\Plugin",
|
37 |
-
"branch-alias": {
|
38 |
-
"dev-master": "1.0-dev"
|
39 |
-
}
|
40 |
-
},
|
41 |
-
"autoload": {
|
42 |
-
"psr-4": {
|
43 |
-
"Composer\\Installers\\": "src/Composer/Installers"
|
44 |
-
}
|
45 |
-
},
|
46 |
-
"notification-url": "https://packagist.org/downloads/",
|
47 |
-
"license": [
|
48 |
-
"MIT"
|
49 |
-
],
|
50 |
-
"authors": [
|
51 |
-
{
|
52 |
-
"name": "Kyle Robinson Young",
|
53 |
-
"email": "kyle@dontkry.com",
|
54 |
-
"homepage": "https://github.com/shama"
|
55 |
-
}
|
56 |
-
],
|
57 |
-
"description": "A multi-framework Composer library installer",
|
58 |
-
"homepage": "https://composer.github.io/installers/",
|
59 |
-
"keywords": [
|
60 |
-
"Craft",
|
61 |
-
"Dolibarr",
|
62 |
-
"Eliasis",
|
63 |
-
"Hurad",
|
64 |
-
"ImageCMS",
|
65 |
-
"Kanboard",
|
66 |
-
"Lan Management System",
|
67 |
-
"MODX Evo",
|
68 |
-
"Mautic",
|
69 |
-
"Maya",
|
70 |
-
"OXID",
|
71 |
-
"Plentymarkets",
|
72 |
-
"Porto",
|
73 |
-
"RadPHP",
|
74 |
-
"SMF",
|
75 |
-
"Thelia",
|
76 |
-
"Whmcs",
|
77 |
-
"WolfCMS",
|
78 |
-
"agl",
|
79 |
-
"aimeos",
|
80 |
-
"annotatecms",
|
81 |
-
"attogram",
|
82 |
-
"bitrix",
|
83 |
-
"cakephp",
|
84 |
-
"chef",
|
85 |
-
"cockpit",
|
86 |
-
"codeigniter",
|
87 |
-
"concrete5",
|
88 |
-
"croogo",
|
89 |
-
"dokuwiki",
|
90 |
-
"drupal",
|
91 |
-
"eZ Platform",
|
92 |
-
"elgg",
|
93 |
-
"expressionengine",
|
94 |
-
"fuelphp",
|
95 |
-
"grav",
|
96 |
-
"installer",
|
97 |
-
"itop",
|
98 |
-
"joomla",
|
99 |
-
"known",
|
100 |
-
"kohana",
|
101 |
-
"laravel",
|
102 |
-
"lavalite",
|
103 |
-
"lithium",
|
104 |
-
"magento",
|
105 |
-
"majima",
|
106 |
-
"mako",
|
107 |
-
"mediawiki",
|
108 |
-
"modulework",
|
109 |
-
"modx",
|
110 |
-
"moodle",
|
111 |
-
"osclass",
|
112 |
-
"phpbb",
|
113 |
-
"piwik",
|
114 |
-
"ppi",
|
115 |
-
"puppet",
|
116 |
-
"pxcms",
|
117 |
-
"reindex",
|
118 |
-
"roundcube",
|
119 |
-
"shopware",
|
120 |
-
"silverstripe",
|
121 |
-
"sydes",
|
122 |
-
"symfony",
|
123 |
-
"typo3",
|
124 |
-
"wordpress",
|
125 |
-
"yawik",
|
126 |
-
"zend",
|
127 |
-
"zikula"
|
128 |
-
],
|
129 |
-
"time": "2019-08-12T15:00:31+00:00"
|
130 |
-
},
|
131 |
-
{
|
132 |
-
"name": "container-interop/container-interop",
|
133 |
-
"version": "1.2.0",
|
134 |
-
"source": {
|
135 |
-
"type": "git",
|
136 |
-
"url": "https://github.com/container-interop/container-interop.git",
|
137 |
-
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
|
138 |
-
},
|
139 |
-
"dist": {
|
140 |
-
"type": "zip",
|
141 |
-
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
142 |
-
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
143 |
-
"shasum": ""
|
144 |
-
},
|
145 |
-
"require": {
|
146 |
-
"psr/container": "^1.0"
|
147 |
-
},
|
148 |
-
"type": "library",
|
149 |
-
"autoload": {
|
150 |
-
"psr-4": {
|
151 |
-
"Interop\\Container\\": "src/Interop/Container/"
|
152 |
-
}
|
153 |
-
},
|
154 |
-
"notification-url": "https://packagist.org/downloads/",
|
155 |
-
"license": [
|
156 |
-
"MIT"
|
157 |
-
],
|
158 |
-
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
159 |
-
"homepage": "https://github.com/container-interop/container-interop",
|
160 |
-
"time": "2017-02-14T19:40:03+00:00"
|
161 |
-
},
|
162 |
-
{
|
163 |
-
"name": "league/container",
|
164 |
-
"version": "2.4.1",
|
165 |
-
"source": {
|
166 |
-
"type": "git",
|
167 |
-
"url": "https://github.com/thephpleague/container.git",
|
168 |
-
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0"
|
169 |
-
},
|
170 |
-
"dist": {
|
171 |
-
"type": "zip",
|
172 |
-
"url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0",
|
173 |
-
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0",
|
174 |
-
"shasum": ""
|
175 |
-
},
|
176 |
-
"require": {
|
177 |
-
"container-interop/container-interop": "^1.2",
|
178 |
-
"php": "^5.4.0 || ^7.0"
|
179 |
-
},
|
180 |
-
"provide": {
|
181 |
-
"container-interop/container-interop-implementation": "^1.2",
|
182 |
-
"psr/container-implementation": "^1.0"
|
183 |
-
},
|
184 |
-
"replace": {
|
185 |
-
"orno/di": "~2.0"
|
186 |
-
},
|
187 |
-
"require-dev": {
|
188 |
-
"phpunit/phpunit": "4.*"
|
189 |
-
},
|
190 |
-
"type": "library",
|
191 |
-
"extra": {
|
192 |
-
"branch-alias": {
|
193 |
-
"dev-2.x": "2.x-dev",
|
194 |
-
"dev-1.x": "1.x-dev"
|
195 |
-
}
|
196 |
-
},
|
197 |
-
"autoload": {
|
198 |
-
"psr-4": {
|
199 |
-
"League\\Container\\": "src"
|
200 |
-
}
|
201 |
-
},
|
202 |
-
"notification-url": "https://packagist.org/downloads/",
|
203 |
-
"license": [
|
204 |
-
"MIT"
|
205 |
-
],
|
206 |
-
"authors": [
|
207 |
-
{
|
208 |
-
"name": "Phil Bennett",
|
209 |
-
"email": "philipobenito@gmail.com",
|
210 |
-
"homepage": "http://www.philipobenito.com",
|
211 |
-
"role": "Developer"
|
212 |
-
}
|
213 |
-
],
|
214 |
-
"description": "A fast and intuitive dependency injection container.",
|
215 |
-
"homepage": "https://github.com/thephpleague/container",
|
216 |
-
"keywords": [
|
217 |
-
"container",
|
218 |
-
"dependency",
|
219 |
-
"di",
|
220 |
-
"injection",
|
221 |
-
"league",
|
222 |
-
"provider",
|
223 |
-
"service"
|
224 |
-
],
|
225 |
-
"time": "2017-05-10T09:20:27+00:00"
|
226 |
-
},
|
227 |
-
{
|
228 |
-
"name": "psr/container",
|
229 |
-
"version": "1.0.0",
|
230 |
-
"source": {
|
231 |
-
"type": "git",
|
232 |
-
"url": "https://github.com/php-fig/container.git",
|
233 |
-
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
234 |
-
},
|
235 |
-
"dist": {
|
236 |
-
"type": "zip",
|
237 |
-
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
238 |
-
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
239 |
-
"shasum": ""
|
240 |
-
},
|
241 |
-
"require": {
|
242 |
-
"php": ">=5.3.0"
|
243 |
-
},
|
244 |
-
"type": "library",
|
245 |
-
"extra": {
|
246 |
-
"branch-alias": {
|
247 |
-
"dev-master": "1.0.x-dev"
|
248 |
-
}
|
249 |
-
},
|
250 |
-
"autoload": {
|
251 |
-
"psr-4": {
|
252 |
-
"Psr\\Container\\": "src/"
|
253 |
-
}
|
254 |
-
},
|
255 |
-
"notification-url": "https://packagist.org/downloads/",
|
256 |
-
"license": [
|
257 |
-
"MIT"
|
258 |
-
],
|
259 |
-
"authors": [
|
260 |
-
{
|
261 |
-
"name": "PHP-FIG",
|
262 |
-
"homepage": "http://www.php-fig.org/"
|
263 |
-
}
|
264 |
-
],
|
265 |
-
"description": "Common Container Interface (PHP FIG PSR-11)",
|
266 |
-
"homepage": "https://github.com/php-fig/container",
|
267 |
-
"keywords": [
|
268 |
-
"PSR-11",
|
269 |
-
"container",
|
270 |
-
"container-interface",
|
271 |
-
"container-interop",
|
272 |
-
"psr"
|
273 |
-
],
|
274 |
-
"time": "2017-02-14T16:28:37+00:00"
|
275 |
-
},
|
276 |
-
{
|
277 |
-
"name": "wp-media/rocket-lazyload-common",
|
278 |
-
"version": "v2.5",
|
279 |
-
"source": {
|
280 |
-
"type": "git",
|
281 |
-
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
282 |
-
"reference": "
|
283 |
-
},
|
284 |
-
"dist": {
|
285 |
-
"type": "zip",
|
286 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
287 |
-
"reference": "
|
288 |
-
"shasum": ""
|
289 |
-
},
|
290 |
-
"require": {
|
291 |
-
"php": ">=5.6"
|
292 |
-
},
|
293 |
-
"require-dev": {
|
294 |
-
"brain/monkey": "^2.0",
|
295 |
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
296 |
-
"doctrine/instantiator": "1.0.*",
|
297 |
-
"myclabs/deep-copy": "1.6.*",
|
298 |
-
"phpcompatibility/phpcompatibility-wp": "^2.0",
|
299 |
-
"phpdocumentor/reflection-docblock": "^3.3",
|
300 |
-
"phpunit/php-token-stream": "^1.4",
|
301 |
-
"phpunit/phpunit": "^5.7",
|
302 |
-
"symfony/yaml": "2.8.*",
|
303 |
-
"wp-coding-standards/wpcs": "^2.0.0"
|
304 |
-
},
|
305 |
-
"type": "library",
|
306 |
-
"autoload": {
|
307 |
-
"psr-4": {
|
308 |
-
"RocketLazyload\\": "src"
|
309 |
-
}
|
310 |
-
},
|
311 |
-
"notification-url": "https://packagist.org/downloads/",
|
312 |
-
"license": [
|
313 |
-
"GPL-3.0-or-later"
|
314 |
-
],
|
315 |
-
"authors": [
|
316 |
-
{
|
317 |
-
"name": "WP Media",
|
318 |
-
"email": "contact@wp-media.me"
|
319 |
-
}
|
320 |
-
],
|
321 |
-
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
322 |
-
"time": "2019-09-
|
323 |
-
}
|
324 |
-
],
|
325 |
-
"packages-dev": [
|
326 |
-
{
|
327 |
-
"name": "antecedent/patchwork",
|
328 |
-
"version": "2.1.
|
329 |
-
"source": {
|
330 |
-
"type": "git",
|
331 |
-
"url": "https://github.com/antecedent/patchwork.git",
|
332 |
-
"reference": "
|
333 |
-
},
|
334 |
-
"dist": {
|
335 |
-
"type": "zip",
|
336 |
-
"url": "https://api.github.com/repos/antecedent/patchwork/zipball/
|
337 |
-
"reference": "
|
338 |
-
"shasum": ""
|
339 |
-
},
|
340 |
-
"require": {
|
341 |
-
"php": ">=5.4.0"
|
342 |
-
},
|
343 |
-
"type": "library",
|
344 |
-
"notification-url": "https://packagist.org/downloads/",
|
345 |
-
"license": [
|
346 |
-
"MIT"
|
347 |
-
],
|
348 |
-
"authors": [
|
349 |
-
{
|
350 |
-
"name": "Ignas Rudaitis",
|
351 |
-
"email": "ignas.rudaitis@gmail.com"
|
352 |
-
}
|
353 |
-
],
|
354 |
-
"description": "Method redefinition (monkey-patching) functionality for PHP.",
|
355 |
-
"homepage": "http://patchwork2.org/",
|
356 |
-
"keywords": [
|
357 |
-
"aop",
|
358 |
-
"aspect",
|
359 |
-
"interception",
|
360 |
-
"monkeypatching",
|
361 |
-
"redefinition",
|
362 |
-
"runkit",
|
363 |
-
"testing"
|
364 |
-
],
|
365 |
-
"time": "
|
366 |
-
},
|
367 |
-
{
|
368 |
-
"name": "brain/monkey",
|
369 |
-
"version": "2.3.1",
|
370 |
-
"source": {
|
371 |
-
"type": "git",
|
372 |
-
"url": "https://github.com/Brain-WP/BrainMonkey.git",
|
373 |
-
"reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776"
|
374 |
-
},
|
375 |
-
"dist": {
|
376 |
-
"type": "zip",
|
377 |
-
"url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
|
378 |
-
"reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
|
379 |
-
"shasum": ""
|
380 |
-
},
|
381 |
-
"require": {
|
382 |
-
"antecedent/patchwork": "^2.0",
|
383 |
-
"mockery/mockery": ">=0.9 <2",
|
384 |
-
"php": ">=5.6.0"
|
385 |
-
},
|
386 |
-
"require-dev": {
|
387 |
-
"phpunit/phpunit": "~5.7.9"
|
388 |
-
},
|
389 |
-
"type": "library",
|
390 |
-
"extra": {
|
391 |
-
"branch-alias": {
|
392 |
-
"dev-version/1": "1.x-dev",
|
393 |
-
"dev-master": "2.0.x-dev"
|
394 |
-
}
|
395 |
-
},
|
396 |
-
"autoload": {
|
397 |
-
"psr-4": {
|
398 |
-
"Brain\\Monkey\\": "src/"
|
399 |
-
},
|
400 |
-
"files": [
|
401 |
-
"inc/api.php"
|
402 |
-
]
|
403 |
-
},
|
404 |
-
"notification-url": "https://packagist.org/downloads/",
|
405 |
-
"license": [
|
406 |
-
"MIT"
|
407 |
-
],
|
408 |
-
"authors": [
|
409 |
-
{
|
410 |
-
"name": "Giuseppe Mazzapica",
|
411 |
-
"role": "Developer",
|
412 |
-
"email": "giuseppe.mazzapica@gmail.com",
|
413 |
-
"homepage": "https://gmazzap.me"
|
414 |
-
}
|
415 |
-
],
|
416 |
-
"description": "Mocking utility for PHP functions and WordPress plugin API",
|
417 |
-
"keywords": [
|
418 |
-
"Monkey Patching",
|
419 |
-
"interception",
|
420 |
-
"mock",
|
421 |
-
"mock functions",
|
422 |
-
"mockery",
|
423 |
-
"patchwork",
|
424 |
-
"redefinition",
|
425 |
-
"runkit",
|
426 |
-
"test",
|
427 |
-
"testing"
|
428 |
-
],
|
429 |
-
"time": "2019-07-26T19:00:28+00:00"
|
430 |
-
},
|
431 |
-
{
|
432 |
-
"name": "
|
433 |
-
"version": "
|
434 |
-
"source": {
|
435 |
-
"type": "git",
|
436 |
-
"url": "https://github.com/
|
437 |
-
"reference": "
|
438 |
-
},
|
439 |
-
"dist": {
|
440 |
-
"type": "zip",
|
441 |
-
"url": "https://api.github.com/repos/
|
442 |
-
"reference": "
|
443 |
-
"shasum": ""
|
444 |
-
},
|
445 |
-
"require": {
|
446 |
-
"
|
447 |
-
"php": "^
|
448 |
-
"
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
"
|
453 |
-
"
|
454 |
-
},
|
455 |
-
"
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
"autoload": {
|
460 |
-
"psr-4": {
|
461 |
-
"
|
462 |
-
}
|
463 |
-
},
|
464 |
-
"notification-url": "https://packagist.org/downloads/",
|
465 |
-
"license": [
|
466 |
-
"MIT"
|
467 |
-
],
|
468 |
-
"authors": [
|
469 |
-
{
|
470 |
-
"name": "
|
471 |
-
"email": "
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
"
|
479 |
-
|
480 |
-
|
481 |
-
"
|
482 |
-
"
|
483 |
-
"
|
484 |
-
|
485 |
-
|
486 |
-
"
|
487 |
-
"
|
488 |
-
"
|
489 |
-
"
|
490 |
-
|
491 |
-
|
492 |
-
"
|
493 |
-
"
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
"
|
504 |
-
},
|
505 |
-
"
|
506 |
-
"
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
"
|
512 |
-
"
|
513 |
-
|
514 |
-
"
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
"
|
524 |
-
"
|
525 |
-
"
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
"
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
"
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
"
|
546 |
-
"
|
547 |
-
|
548 |
-
"
|
549 |
-
"
|
550 |
-
|
551 |
-
"
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
"
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
"
|
563 |
-
"
|
564 |
-
"
|
565 |
-
"
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
"
|
571 |
-
"
|
572 |
-
|
573 |
-
|
574 |
-
},
|
575 |
-
"
|
576 |
-
"
|
577 |
-
|
578 |
-
|
579 |
-
},
|
580 |
-
"
|
581 |
-
"
|
582 |
-
"
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
"
|
589 |
-
|
590 |
-
|
591 |
-
"
|
592 |
-
"
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
"
|
603 |
-
|
604 |
-
|
605 |
-
"
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
"
|
611 |
-
"
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
"
|
618 |
-
"php": "
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
"
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
"
|
651 |
-
|
652 |
-
|
653 |
-
"
|
654 |
-
|
655 |
-
|
656 |
-
"
|
657 |
-
"
|
658 |
-
"
|
659 |
-
"
|
660 |
-
|
661 |
-
|
662 |
-
"
|
663 |
-
|
664 |
-
"
|
665 |
-
|
666 |
-
|
667 |
-
"
|
668 |
-
|
669 |
-
|
670 |
-
"
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
"
|
676 |
-
"
|
677 |
-
"
|
678 |
-
"
|
679 |
-
|
680 |
-
|
681 |
-
"
|
682 |
-
|
683 |
-
|
684 |
-
"
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
"
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
"
|
719 |
-
"
|
720 |
-
"
|
721 |
-
|
722 |
-
|
723 |
-
"
|
724 |
-
"
|
725 |
-
"
|
726 |
-
"
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
"
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
"
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
"
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
"
|
757 |
-
}
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
"
|
765 |
-
"
|
766 |
-
"
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
"
|
781 |
-
|
782 |
-
|
783 |
-
"
|
784 |
-
"
|
785 |
-
|
786 |
-
|
787 |
-
"
|
788 |
-
|
789 |
-
|
790 |
-
"
|
791 |
-
"
|
792 |
-
"
|
793 |
-
|
794 |
-
"
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
"
|
799 |
-
"
|
800 |
-
|
801 |
-
"
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
"
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
"
|
818 |
-
"
|
819 |
-
"
|
820 |
-
|
821 |
-
|
822 |
-
"
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
"
|
837 |
-
|
838 |
-
|
839 |
-
"
|
840 |
-
"
|
841 |
-
|
842 |
-
"
|
843 |
-
|
844 |
-
|
845 |
-
"
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
"
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
"
|
870 |
-
"
|
871 |
-
|
872 |
-
"
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
"
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
"
|
895 |
-
"
|
896 |
-
"
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
"
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
"
|
920 |
-
"
|
921 |
-
"
|
922 |
-
"
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
"
|
930 |
-
"
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
"
|
947 |
-
|
948 |
-
|
949 |
-
"
|
950 |
-
"
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
"
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
"
|
981 |
-
"
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
"
|
999 |
-
"
|
1000 |
-
|
1001 |
-
|
1002 |
-
"
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
"
|
1008 |
-
"
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
"
|
1017 |
-
|
1018 |
-
"
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
"
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
"
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
"
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
"
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
"
|
1065 |
-
|
1066 |
-
"
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
"
|
1079 |
-
|
1080 |
-
"
|
1081 |
-
"
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
"
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
"
|
1098 |
-
"
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
"
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
"
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
},
|
1127 |
-
"
|
1128 |
-
"
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
"
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
"
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
"
|
1145 |
-
"
|
1146 |
-
"
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
"
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
"
|
1162 |
-
"
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
"
|
1168 |
-
|
1169 |
-
|
1170 |
-
"
|
1171 |
-
"
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
"
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
"
|
1193 |
-
"
|
1194 |
-
"
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
"
|
1208 |
-
|
1209 |
-
|
1210 |
-
"
|
1211 |
-
"
|
1212 |
-
|
1213 |
-
|
1214 |
-
"
|
1215 |
-
|
1216 |
-
|
1217 |
-
"
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
"
|
1223 |
-
|
1224 |
-
"
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
"
|
1234 |
-
|
1235 |
-
|
1236 |
-
"
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
"
|
1246 |
-
"
|
1247 |
-
},
|
1248 |
-
"
|
1249 |
-
"
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
},
|
1257 |
-
"
|
1258 |
-
"
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
"
|
1267 |
-
|
1268 |
-
"
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
"
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
"
|
1284 |
-
"
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
"
|
1291 |
-
|
1292 |
-
|
1293 |
-
"
|
1294 |
-
"
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
"
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
},
|
1310 |
-
"
|
1311 |
-
"
|
1312 |
-
"
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
"
|
1319 |
-
|
1320 |
-
|
1321 |
-
"
|
1322 |
-
"
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
"
|
1332 |
-
"
|
1333 |
-
|
1334 |
-
"
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
"
|
1345 |
-
},
|
1346 |
-
"
|
1347 |
-
|
1348 |
-
"
|
1349 |
-
|
1350 |
-
|
1351 |
-
},
|
1352 |
-
"
|
1353 |
-
|
1354 |
-
"
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
"
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
"
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
"
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
"
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
"
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
"
|
1408 |
-
"
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
"
|
1413 |
-
"
|
1414 |
-
|
1415 |
-
"
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
"
|
1422 |
-
"
|
1423 |
-
|
1424 |
-
"
|
1425 |
-
"
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
"
|
1430 |
-
"
|
1431 |
-
"
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
"
|
1436 |
-
|
1437 |
-
|
1438 |
-
"
|
1439 |
-
},
|
1440 |
-
"
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
},
|
1446 |
-
"
|
1447 |
-
"
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
"
|
1456 |
-
|
1457 |
-
"
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
"
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
"
|
1472 |
-
|
1473 |
-
|
1474 |
-
"
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
"
|
1483 |
-
|
1484 |
-
"
|
1485 |
-
"
|
1486 |
-
"
|
1487 |
-
|
1488 |
-
|
1489 |
-
"
|
1490 |
-
"
|
1491 |
-
"
|
1492 |
-
"
|
1493 |
-
|
1494 |
-
|
1495 |
-
"
|
1496 |
-
|
1497 |
-
|
1498 |
-
"
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
"
|
1503 |
-
|
1504 |
-
|
1505 |
-
},
|
1506 |
-
"
|
1507 |
-
"
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
"
|
1513 |
-
"
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
"
|
1546 |
-
|
1547 |
-
|
1548 |
-
"
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
"
|
1554 |
-
"
|
1555 |
-
|
1556 |
-
|
1557 |
-
},
|
1558 |
-
"
|
1559 |
-
|
1560 |
-
"
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
"
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
"
|
1591 |
-
"
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
"
|
1604 |
-
"
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
"
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
"
|
1623 |
-
|
1624 |
-
"
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
"
|
1637 |
-
"
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
"
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
"
|
1659 |
-
"
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
"
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
"
|
1690 |
-
|
1691 |
-
|
1692 |
-
"
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
"
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
{
|
1742 |
-
"
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
"
|
1748 |
-
|
1749 |
-
|
1750 |
-
"
|
1751 |
-
"
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
"
|
1767 |
-
"
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
"
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
"
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
"
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
"
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
"
|
1800 |
-
|
1801 |
-
|
1802 |
-
"
|
1803 |
-
"
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
"
|
1813 |
-
|
1814 |
-
|
1815 |
-
"
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
"
|
1824 |
-
|
1825 |
-
"
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
"
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
"
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
"
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
"
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
"
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
"
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
"
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
"
|
1912 |
-
|
1913 |
-
"
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
"
|
1919 |
-
|
1920 |
-
|
1921 |
-
},
|
1922 |
-
"
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
"
|
1927 |
-
|
1928 |
-
"
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
"
|
1938 |
-
|
1939 |
-
|
1940 |
-
"
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
"
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
"
|
1954 |
-
"
|
1955 |
-
"
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
"
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
"
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
"
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
"
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
},
|
2016 |
-
"
|
2017 |
-
|
2018 |
-
"
|
2019 |
-
],
|
2020 |
-
"
|
2021 |
-
|
2022 |
-
|
2023 |
-
"
|
2024 |
-
}
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
"
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
"
|
2047 |
-
|
2048 |
-
"
|
2049 |
-
"
|
2050 |
-
"
|
2051 |
-
},
|
2052 |
-
"
|
2053 |
-
"
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
},
|
2061 |
-
"
|
2062 |
-
"
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
"
|
2071 |
-
|
2072 |
-
"
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
"
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
"
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
"
|
2095 |
-
"
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
"
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
"
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
"
|
2127 |
-
"
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
"
|
2140 |
-
|
2141 |
-
|
2142 |
-
},
|
2143 |
-
"
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
{
|
2153 |
-
"
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
"
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
"
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
"
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
"
|
2181 |
-
},
|
2182 |
-
"
|
2183 |
-
|
2184 |
-
"
|
2185 |
-
|
2186 |
-
|
2187 |
-
},
|
2188 |
-
"
|
2189 |
-
"
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
"
|
2195 |
-
"
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
"
|
2206 |
-
"
|
2207 |
-
"
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
"
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
"
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": "ad8bf18ef0f69ab2d4fbfa356dcb019f",
|
8 |
+
"packages": [
|
9 |
+
{
|
10 |
+
"name": "composer/installers",
|
11 |
+
"version": "v1.7.0",
|
12 |
+
"source": {
|
13 |
+
"type": "git",
|
14 |
+
"url": "https://github.com/composer/installers.git",
|
15 |
+
"reference": "141b272484481432cda342727a427dc1e206bfa0"
|
16 |
+
},
|
17 |
+
"dist": {
|
18 |
+
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
|
20 |
+
"reference": "141b272484481432cda342727a427dc1e206bfa0",
|
21 |
+
"shasum": ""
|
22 |
+
},
|
23 |
+
"require": {
|
24 |
+
"composer-plugin-api": "^1.0"
|
25 |
+
},
|
26 |
+
"replace": {
|
27 |
+
"roundcube/plugin-installer": "*",
|
28 |
+
"shama/baton": "*"
|
29 |
+
},
|
30 |
+
"require-dev": {
|
31 |
+
"composer/composer": "1.0.*@dev",
|
32 |
+
"phpunit/phpunit": "^4.8.36"
|
33 |
+
},
|
34 |
+
"type": "composer-plugin",
|
35 |
+
"extra": {
|
36 |
+
"class": "Composer\\Installers\\Plugin",
|
37 |
+
"branch-alias": {
|
38 |
+
"dev-master": "1.0-dev"
|
39 |
+
}
|
40 |
+
},
|
41 |
+
"autoload": {
|
42 |
+
"psr-4": {
|
43 |
+
"Composer\\Installers\\": "src/Composer/Installers"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"notification-url": "https://packagist.org/downloads/",
|
47 |
+
"license": [
|
48 |
+
"MIT"
|
49 |
+
],
|
50 |
+
"authors": [
|
51 |
+
{
|
52 |
+
"name": "Kyle Robinson Young",
|
53 |
+
"email": "kyle@dontkry.com",
|
54 |
+
"homepage": "https://github.com/shama"
|
55 |
+
}
|
56 |
+
],
|
57 |
+
"description": "A multi-framework Composer library installer",
|
58 |
+
"homepage": "https://composer.github.io/installers/",
|
59 |
+
"keywords": [
|
60 |
+
"Craft",
|
61 |
+
"Dolibarr",
|
62 |
+
"Eliasis",
|
63 |
+
"Hurad",
|
64 |
+
"ImageCMS",
|
65 |
+
"Kanboard",
|
66 |
+
"Lan Management System",
|
67 |
+
"MODX Evo",
|
68 |
+
"Mautic",
|
69 |
+
"Maya",
|
70 |
+
"OXID",
|
71 |
+
"Plentymarkets",
|
72 |
+
"Porto",
|
73 |
+
"RadPHP",
|
74 |
+
"SMF",
|
75 |
+
"Thelia",
|
76 |
+
"Whmcs",
|
77 |
+
"WolfCMS",
|
78 |
+
"agl",
|
79 |
+
"aimeos",
|
80 |
+
"annotatecms",
|
81 |
+
"attogram",
|
82 |
+
"bitrix",
|
83 |
+
"cakephp",
|
84 |
+
"chef",
|
85 |
+
"cockpit",
|
86 |
+
"codeigniter",
|
87 |
+
"concrete5",
|
88 |
+
"croogo",
|
89 |
+
"dokuwiki",
|
90 |
+
"drupal",
|
91 |
+
"eZ Platform",
|
92 |
+
"elgg",
|
93 |
+
"expressionengine",
|
94 |
+
"fuelphp",
|
95 |
+
"grav",
|
96 |
+
"installer",
|
97 |
+
"itop",
|
98 |
+
"joomla",
|
99 |
+
"known",
|
100 |
+
"kohana",
|
101 |
+
"laravel",
|
102 |
+
"lavalite",
|
103 |
+
"lithium",
|
104 |
+
"magento",
|
105 |
+
"majima",
|
106 |
+
"mako",
|
107 |
+
"mediawiki",
|
108 |
+
"modulework",
|
109 |
+
"modx",
|
110 |
+
"moodle",
|
111 |
+
"osclass",
|
112 |
+
"phpbb",
|
113 |
+
"piwik",
|
114 |
+
"ppi",
|
115 |
+
"puppet",
|
116 |
+
"pxcms",
|
117 |
+
"reindex",
|
118 |
+
"roundcube",
|
119 |
+
"shopware",
|
120 |
+
"silverstripe",
|
121 |
+
"sydes",
|
122 |
+
"symfony",
|
123 |
+
"typo3",
|
124 |
+
"wordpress",
|
125 |
+
"yawik",
|
126 |
+
"zend",
|
127 |
+
"zikula"
|
128 |
+
],
|
129 |
+
"time": "2019-08-12T15:00:31+00:00"
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"name": "container-interop/container-interop",
|
133 |
+
"version": "1.2.0",
|
134 |
+
"source": {
|
135 |
+
"type": "git",
|
136 |
+
"url": "https://github.com/container-interop/container-interop.git",
|
137 |
+
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
|
138 |
+
},
|
139 |
+
"dist": {
|
140 |
+
"type": "zip",
|
141 |
+
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
142 |
+
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
143 |
+
"shasum": ""
|
144 |
+
},
|
145 |
+
"require": {
|
146 |
+
"psr/container": "^1.0"
|
147 |
+
},
|
148 |
+
"type": "library",
|
149 |
+
"autoload": {
|
150 |
+
"psr-4": {
|
151 |
+
"Interop\\Container\\": "src/Interop/Container/"
|
152 |
+
}
|
153 |
+
},
|
154 |
+
"notification-url": "https://packagist.org/downloads/",
|
155 |
+
"license": [
|
156 |
+
"MIT"
|
157 |
+
],
|
158 |
+
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
159 |
+
"homepage": "https://github.com/container-interop/container-interop",
|
160 |
+
"time": "2017-02-14T19:40:03+00:00"
|
161 |
+
},
|
162 |
+
{
|
163 |
+
"name": "league/container",
|
164 |
+
"version": "2.4.1",
|
165 |
+
"source": {
|
166 |
+
"type": "git",
|
167 |
+
"url": "https://github.com/thephpleague/container.git",
|
168 |
+
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0"
|
169 |
+
},
|
170 |
+
"dist": {
|
171 |
+
"type": "zip",
|
172 |
+
"url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0",
|
173 |
+
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0",
|
174 |
+
"shasum": ""
|
175 |
+
},
|
176 |
+
"require": {
|
177 |
+
"container-interop/container-interop": "^1.2",
|
178 |
+
"php": "^5.4.0 || ^7.0"
|
179 |
+
},
|
180 |
+
"provide": {
|
181 |
+
"container-interop/container-interop-implementation": "^1.2",
|
182 |
+
"psr/container-implementation": "^1.0"
|
183 |
+
},
|
184 |
+
"replace": {
|
185 |
+
"orno/di": "~2.0"
|
186 |
+
},
|
187 |
+
"require-dev": {
|
188 |
+
"phpunit/phpunit": "4.*"
|
189 |
+
},
|
190 |
+
"type": "library",
|
191 |
+
"extra": {
|
192 |
+
"branch-alias": {
|
193 |
+
"dev-2.x": "2.x-dev",
|
194 |
+
"dev-1.x": "1.x-dev"
|
195 |
+
}
|
196 |
+
},
|
197 |
+
"autoload": {
|
198 |
+
"psr-4": {
|
199 |
+
"League\\Container\\": "src"
|
200 |
+
}
|
201 |
+
},
|
202 |
+
"notification-url": "https://packagist.org/downloads/",
|
203 |
+
"license": [
|
204 |
+
"MIT"
|
205 |
+
],
|
206 |
+
"authors": [
|
207 |
+
{
|
208 |
+
"name": "Phil Bennett",
|
209 |
+
"email": "philipobenito@gmail.com",
|
210 |
+
"homepage": "http://www.philipobenito.com",
|
211 |
+
"role": "Developer"
|
212 |
+
}
|
213 |
+
],
|
214 |
+
"description": "A fast and intuitive dependency injection container.",
|
215 |
+
"homepage": "https://github.com/thephpleague/container",
|
216 |
+
"keywords": [
|
217 |
+
"container",
|
218 |
+
"dependency",
|
219 |
+
"di",
|
220 |
+
"injection",
|
221 |
+
"league",
|
222 |
+
"provider",
|
223 |
+
"service"
|
224 |
+
],
|
225 |
+
"time": "2017-05-10T09:20:27+00:00"
|
226 |
+
},
|
227 |
+
{
|
228 |
+
"name": "psr/container",
|
229 |
+
"version": "1.0.0",
|
230 |
+
"source": {
|
231 |
+
"type": "git",
|
232 |
+
"url": "https://github.com/php-fig/container.git",
|
233 |
+
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
234 |
+
},
|
235 |
+
"dist": {
|
236 |
+
"type": "zip",
|
237 |
+
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
238 |
+
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
239 |
+
"shasum": ""
|
240 |
+
},
|
241 |
+
"require": {
|
242 |
+
"php": ">=5.3.0"
|
243 |
+
},
|
244 |
+
"type": "library",
|
245 |
+
"extra": {
|
246 |
+
"branch-alias": {
|
247 |
+
"dev-master": "1.0.x-dev"
|
248 |
+
}
|
249 |
+
},
|
250 |
+
"autoload": {
|
251 |
+
"psr-4": {
|
252 |
+
"Psr\\Container\\": "src/"
|
253 |
+
}
|
254 |
+
},
|
255 |
+
"notification-url": "https://packagist.org/downloads/",
|
256 |
+
"license": [
|
257 |
+
"MIT"
|
258 |
+
],
|
259 |
+
"authors": [
|
260 |
+
{
|
261 |
+
"name": "PHP-FIG",
|
262 |
+
"homepage": "http://www.php-fig.org/"
|
263 |
+
}
|
264 |
+
],
|
265 |
+
"description": "Common Container Interface (PHP FIG PSR-11)",
|
266 |
+
"homepage": "https://github.com/php-fig/container",
|
267 |
+
"keywords": [
|
268 |
+
"PSR-11",
|
269 |
+
"container",
|
270 |
+
"container-interface",
|
271 |
+
"container-interop",
|
272 |
+
"psr"
|
273 |
+
],
|
274 |
+
"time": "2017-02-14T16:28:37+00:00"
|
275 |
+
},
|
276 |
+
{
|
277 |
+
"name": "wp-media/rocket-lazyload-common",
|
278 |
+
"version": "v2.5.1",
|
279 |
+
"source": {
|
280 |
+
"type": "git",
|
281 |
+
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
282 |
+
"reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e"
|
283 |
+
},
|
284 |
+
"dist": {
|
285 |
+
"type": "zip",
|
286 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
|
287 |
+
"reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
|
288 |
+
"shasum": ""
|
289 |
+
},
|
290 |
+
"require": {
|
291 |
+
"php": ">=5.6"
|
292 |
+
},
|
293 |
+
"require-dev": {
|
294 |
+
"brain/monkey": "^2.0",
|
295 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
296 |
+
"doctrine/instantiator": "1.0.*",
|
297 |
+
"myclabs/deep-copy": "1.6.*",
|
298 |
+
"phpcompatibility/phpcompatibility-wp": "^2.0",
|
299 |
+
"phpdocumentor/reflection-docblock": "^3.3",
|
300 |
+
"phpunit/php-token-stream": "^1.4",
|
301 |
+
"phpunit/phpunit": "^5.7",
|
302 |
+
"symfony/yaml": "2.8.*",
|
303 |
+
"wp-coding-standards/wpcs": "^2.0.0"
|
304 |
+
},
|
305 |
+
"type": "library",
|
306 |
+
"autoload": {
|
307 |
+
"psr-4": {
|
308 |
+
"RocketLazyload\\": "src"
|
309 |
+
}
|
310 |
+
},
|
311 |
+
"notification-url": "https://packagist.org/downloads/",
|
312 |
+
"license": [
|
313 |
+
"GPL-3.0-or-later"
|
314 |
+
],
|
315 |
+
"authors": [
|
316 |
+
{
|
317 |
+
"name": "WP Media",
|
318 |
+
"email": "contact@wp-media.me"
|
319 |
+
}
|
320 |
+
],
|
321 |
+
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
322 |
+
"time": "2019-09-06T13:51:56+00:00"
|
323 |
+
}
|
324 |
+
],
|
325 |
+
"packages-dev": [
|
326 |
+
{
|
327 |
+
"name": "antecedent/patchwork",
|
328 |
+
"version": "2.1.9",
|
329 |
+
"source": {
|
330 |
+
"type": "git",
|
331 |
+
"url": "https://github.com/antecedent/patchwork.git",
|
332 |
+
"reference": "1229bb22283177e196b572120de0772d9ee9baac"
|
333 |
+
},
|
334 |
+
"dist": {
|
335 |
+
"type": "zip",
|
336 |
+
"url": "https://api.github.com/repos/antecedent/patchwork/zipball/1229bb22283177e196b572120de0772d9ee9baac",
|
337 |
+
"reference": "1229bb22283177e196b572120de0772d9ee9baac",
|
338 |
+
"shasum": ""
|
339 |
+
},
|
340 |
+
"require": {
|
341 |
+
"php": ">=5.4.0"
|
342 |
+
},
|
343 |
+
"type": "library",
|
344 |
+
"notification-url": "https://packagist.org/downloads/",
|
345 |
+
"license": [
|
346 |
+
"MIT"
|
347 |
+
],
|
348 |
+
"authors": [
|
349 |
+
{
|
350 |
+
"name": "Ignas Rudaitis",
|
351 |
+
"email": "ignas.rudaitis@gmail.com"
|
352 |
+
}
|
353 |
+
],
|
354 |
+
"description": "Method redefinition (monkey-patching) functionality for PHP.",
|
355 |
+
"homepage": "http://patchwork2.org/",
|
356 |
+
"keywords": [
|
357 |
+
"aop",
|
358 |
+
"aspect",
|
359 |
+
"interception",
|
360 |
+
"monkeypatching",
|
361 |
+
"redefinition",
|
362 |
+
"runkit",
|
363 |
+
"testing"
|
364 |
+
],
|
365 |
+
"time": "2019-08-18T15:18:18+00:00"
|
366 |
+
},
|
367 |
+
{
|
368 |
+
"name": "brain/monkey",
|
369 |
+
"version": "2.3.1",
|
370 |
+
"source": {
|
371 |
+
"type": "git",
|
372 |
+
"url": "https://github.com/Brain-WP/BrainMonkey.git",
|
373 |
+
"reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776"
|
374 |
+
},
|
375 |
+
"dist": {
|
376 |
+
"type": "zip",
|
377 |
+
"url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
|
378 |
+
"reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
|
379 |
+
"shasum": ""
|
380 |
+
},
|
381 |
+
"require": {
|
382 |
+
"antecedent/patchwork": "^2.0",
|
383 |
+
"mockery/mockery": ">=0.9 <2",
|
384 |
+
"php": ">=5.6.0"
|
385 |
+
},
|
386 |
+
"require-dev": {
|
387 |
+
"phpunit/phpunit": "~5.7.9"
|
388 |
+
},
|
389 |
+
"type": "library",
|
390 |
+
"extra": {
|
391 |
+
"branch-alias": {
|
392 |
+
"dev-version/1": "1.x-dev",
|
393 |
+
"dev-master": "2.0.x-dev"
|
394 |
+
}
|
395 |
+
},
|
396 |
+
"autoload": {
|
397 |
+
"psr-4": {
|
398 |
+
"Brain\\Monkey\\": "src/"
|
399 |
+
},
|
400 |
+
"files": [
|
401 |
+
"inc/api.php"
|
402 |
+
]
|
403 |
+
},
|
404 |
+
"notification-url": "https://packagist.org/downloads/",
|
405 |
+
"license": [
|
406 |
+
"MIT"
|
407 |
+
],
|
408 |
+
"authors": [
|
409 |
+
{
|
410 |
+
"name": "Giuseppe Mazzapica",
|
411 |
+
"role": "Developer",
|
412 |
+
"email": "giuseppe.mazzapica@gmail.com",
|
413 |
+
"homepage": "https://gmazzap.me"
|
414 |
+
}
|
415 |
+
],
|
416 |
+
"description": "Mocking utility for PHP functions and WordPress plugin API",
|
417 |
+
"keywords": [
|
418 |
+
"Monkey Patching",
|
419 |
+
"interception",
|
420 |
+
"mock",
|
421 |
+
"mock functions",
|
422 |
+
"mockery",
|
423 |
+
"patchwork",
|
424 |
+
"redefinition",
|
425 |
+
"runkit",
|
426 |
+
"test",
|
427 |
+
"testing"
|
428 |
+
],
|
429 |
+
"time": "2019-07-26T19:00:28+00:00"
|
430 |
+
},
|
431 |
+
{
|
432 |
+
"name": "coenjacobs/mozart",
|
433 |
+
"version": "0.4.0",
|
434 |
+
"source": {
|
435 |
+
"type": "git",
|
436 |
+
"url": "https://github.com/coenjacobs/mozart.git",
|
437 |
+
"reference": "2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5"
|
438 |
+
},
|
439 |
+
"dist": {
|
440 |
+
"type": "zip",
|
441 |
+
"url": "https://api.github.com/repos/coenjacobs/mozart/zipball/2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5",
|
442 |
+
"reference": "2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5",
|
443 |
+
"shasum": ""
|
444 |
+
},
|
445 |
+
"require": {
|
446 |
+
"league/flysystem": "^1.0",
|
447 |
+
"php": "^7.1",
|
448 |
+
"symfony/console": "^4",
|
449 |
+
"symfony/finder": "^4"
|
450 |
+
},
|
451 |
+
"require-dev": {
|
452 |
+
"coenjacobs/php-composter-phpcs": "^0.1.0",
|
453 |
+
"phpunit/phpunit": "^7.5"
|
454 |
+
},
|
455 |
+
"bin": [
|
456 |
+
"bin/mozart"
|
457 |
+
],
|
458 |
+
"type": "library",
|
459 |
+
"autoload": {
|
460 |
+
"psr-4": {
|
461 |
+
"CoenJacobs\\Mozart\\": "src/"
|
462 |
+
}
|
463 |
+
},
|
464 |
+
"notification-url": "https://packagist.org/downloads/",
|
465 |
+
"license": [
|
466 |
+
"MIT"
|
467 |
+
],
|
468 |
+
"authors": [
|
469 |
+
{
|
470 |
+
"name": "Coen Jacobs",
|
471 |
+
"email": "coenjacobs@gmail.com"
|
472 |
+
}
|
473 |
+
],
|
474 |
+
"description": "Composes all dependencies as a package inside a WordPress plugin",
|
475 |
+
"time": "2019-06-27T09:52:52+00:00"
|
476 |
+
},
|
477 |
+
{
|
478 |
+
"name": "dealerdirect/phpcodesniffer-composer-installer",
|
479 |
+
"version": "v0.5.0",
|
480 |
+
"source": {
|
481 |
+
"type": "git",
|
482 |
+
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
|
483 |
+
"reference": "e749410375ff6fb7a040a68878c656c2e610b132"
|
484 |
+
},
|
485 |
+
"dist": {
|
486 |
+
"type": "zip",
|
487 |
+
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132",
|
488 |
+
"reference": "e749410375ff6fb7a040a68878c656c2e610b132",
|
489 |
+
"shasum": ""
|
490 |
+
},
|
491 |
+
"require": {
|
492 |
+
"composer-plugin-api": "^1.0",
|
493 |
+
"php": "^5.3|^7",
|
494 |
+
"squizlabs/php_codesniffer": "^2|^3"
|
495 |
+
},
|
496 |
+
"require-dev": {
|
497 |
+
"composer/composer": "*",
|
498 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
499 |
+
"sensiolabs/security-checker": "^4.1.0"
|
500 |
+
},
|
501 |
+
"type": "composer-plugin",
|
502 |
+
"extra": {
|
503 |
+
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
|
504 |
+
},
|
505 |
+
"autoload": {
|
506 |
+
"psr-4": {
|
507 |
+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
|
508 |
+
}
|
509 |
+
},
|
510 |
+
"notification-url": "https://packagist.org/downloads/",
|
511 |
+
"license": [
|
512 |
+
"MIT"
|
513 |
+
],
|
514 |
+
"authors": [
|
515 |
+
{
|
516 |
+
"name": "Franck Nijhof",
|
517 |
+
"email": "franck.nijhof@dealerdirect.com",
|
518 |
+
"homepage": "http://www.frenck.nl",
|
519 |
+
"role": "Developer / IT Manager"
|
520 |
+
}
|
521 |
+
],
|
522 |
+
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
|
523 |
+
"homepage": "http://www.dealerdirect.com",
|
524 |
+
"keywords": [
|
525 |
+
"PHPCodeSniffer",
|
526 |
+
"PHP_CodeSniffer",
|
527 |
+
"code quality",
|
528 |
+
"codesniffer",
|
529 |
+
"composer",
|
530 |
+
"installer",
|
531 |
+
"phpcs",
|
532 |
+
"plugin",
|
533 |
+
"qa",
|
534 |
+
"quality",
|
535 |
+
"standard",
|
536 |
+
"standards",
|
537 |
+
"style guide",
|
538 |
+
"stylecheck",
|
539 |
+
"tests"
|
540 |
+
],
|
541 |
+
"time": "2018-10-26T13:21:45+00:00"
|
542 |
+
},
|
543 |
+
{
|
544 |
+
"name": "doctrine/instantiator",
|
545 |
+
"version": "1.2.0",
|
546 |
+
"source": {
|
547 |
+
"type": "git",
|
548 |
+
"url": "https://github.com/doctrine/instantiator.git",
|
549 |
+
"reference": "a2c590166b2133a4633738648b6b064edae0814a"
|
550 |
+
},
|
551 |
+
"dist": {
|
552 |
+
"type": "zip",
|
553 |
+
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
|
554 |
+
"reference": "a2c590166b2133a4633738648b6b064edae0814a",
|
555 |
+
"shasum": ""
|
556 |
+
},
|
557 |
+
"require": {
|
558 |
+
"php": "^7.1"
|
559 |
+
},
|
560 |
+
"require-dev": {
|
561 |
+
"doctrine/coding-standard": "^6.0",
|
562 |
+
"ext-pdo": "*",
|
563 |
+
"ext-phar": "*",
|
564 |
+
"phpbench/phpbench": "^0.13",
|
565 |
+
"phpstan/phpstan-phpunit": "^0.11",
|
566 |
+
"phpstan/phpstan-shim": "^0.11",
|
567 |
+
"phpunit/phpunit": "^7.0"
|
568 |
+
},
|
569 |
+
"type": "library",
|
570 |
+
"extra": {
|
571 |
+
"branch-alias": {
|
572 |
+
"dev-master": "1.2.x-dev"
|
573 |
+
}
|
574 |
+
},
|
575 |
+
"autoload": {
|
576 |
+
"psr-4": {
|
577 |
+
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
578 |
+
}
|
579 |
+
},
|
580 |
+
"notification-url": "https://packagist.org/downloads/",
|
581 |
+
"license": [
|
582 |
+
"MIT"
|
583 |
+
],
|
584 |
+
"authors": [
|
585 |
+
{
|
586 |
+
"name": "Marco Pivetta",
|
587 |
+
"email": "ocramius@gmail.com",
|
588 |
+
"homepage": "http://ocramius.github.com/"
|
589 |
+
}
|
590 |
+
],
|
591 |
+
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
592 |
+
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
|
593 |
+
"keywords": [
|
594 |
+
"constructor",
|
595 |
+
"instantiate"
|
596 |
+
],
|
597 |
+
"time": "2019-03-17T17:37:11+00:00"
|
598 |
+
},
|
599 |
+
{
|
600 |
+
"name": "hamcrest/hamcrest-php",
|
601 |
+
"version": "v2.0.0",
|
602 |
+
"source": {
|
603 |
+
"type": "git",
|
604 |
+
"url": "https://github.com/hamcrest/hamcrest-php.git",
|
605 |
+
"reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad"
|
606 |
+
},
|
607 |
+
"dist": {
|
608 |
+
"type": "zip",
|
609 |
+
"url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad",
|
610 |
+
"reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad",
|
611 |
+
"shasum": ""
|
612 |
+
},
|
613 |
+
"require": {
|
614 |
+
"php": "^5.3|^7.0"
|
615 |
+
},
|
616 |
+
"replace": {
|
617 |
+
"cordoval/hamcrest-php": "*",
|
618 |
+
"davedevelopment/hamcrest-php": "*",
|
619 |
+
"kodova/hamcrest-php": "*"
|
620 |
+
},
|
621 |
+
"require-dev": {
|
622 |
+
"phpunit/php-file-iterator": "1.3.3",
|
623 |
+
"phpunit/phpunit": "~4.0",
|
624 |
+
"satooshi/php-coveralls": "^1.0"
|
625 |
+
},
|
626 |
+
"type": "library",
|
627 |
+
"extra": {
|
628 |
+
"branch-alias": {
|
629 |
+
"dev-master": "2.0-dev"
|
630 |
+
}
|
631 |
+
},
|
632 |
+
"autoload": {
|
633 |
+
"classmap": [
|
634 |
+
"hamcrest"
|
635 |
+
]
|
636 |
+
},
|
637 |
+
"notification-url": "https://packagist.org/downloads/",
|
638 |
+
"license": [
|
639 |
+
"BSD"
|
640 |
+
],
|
641 |
+
"description": "This is the PHP port of Hamcrest Matchers",
|
642 |
+
"keywords": [
|
643 |
+
"test"
|
644 |
+
],
|
645 |
+
"time": "2016-01-20T08:20:44+00:00"
|
646 |
+
},
|
647 |
+
{
|
648 |
+
"name": "league/flysystem",
|
649 |
+
"version": "1.0.46",
|
650 |
+
"source": {
|
651 |
+
"type": "git",
|
652 |
+
"url": "https://github.com/thephpleague/flysystem.git",
|
653 |
+
"reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2"
|
654 |
+
},
|
655 |
+
"dist": {
|
656 |
+
"type": "zip",
|
657 |
+
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
|
658 |
+
"reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
|
659 |
+
"shasum": ""
|
660 |
+
},
|
661 |
+
"require": {
|
662 |
+
"php": ">=5.5.9"
|
663 |
+
},
|
664 |
+
"conflict": {
|
665 |
+
"league/flysystem-sftp": "<1.0.6"
|
666 |
+
},
|
667 |
+
"require-dev": {
|
668 |
+
"ext-fileinfo": "*",
|
669 |
+
"phpspec/phpspec": "^3.4",
|
670 |
+
"phpunit/phpunit": "^5.7.10"
|
671 |
+
},
|
672 |
+
"suggest": {
|
673 |
+
"ext-fileinfo": "Required for MimeType",
|
674 |
+
"ext-ftp": "Allows you to use FTP server storage",
|
675 |
+
"ext-openssl": "Allows you to use FTPS server storage",
|
676 |
+
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
|
677 |
+
"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
|
678 |
+
"league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
|
679 |
+
"league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
|
680 |
+
"league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
|
681 |
+
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
|
682 |
+
"league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
|
683 |
+
"league/flysystem-webdav": "Allows you to use WebDAV storage",
|
684 |
+
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
|
685 |
+
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
|
686 |
+
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
|
687 |
+
},
|
688 |
+
"type": "library",
|
689 |
+
"extra": {
|
690 |
+
"branch-alias": {
|
691 |
+
"dev-master": "1.1-dev"
|
692 |
+
}
|
693 |
+
},
|
694 |
+
"autoload": {
|
695 |
+
"psr-4": {
|
696 |
+
"League\\Flysystem\\": "src/"
|
697 |
+
}
|
698 |
+
},
|
699 |
+
"notification-url": "https://packagist.org/downloads/",
|
700 |
+
"license": [
|
701 |
+
"MIT"
|
702 |
+
],
|
703 |
+
"authors": [
|
704 |
+
{
|
705 |
+
"name": "Frank de Jonge",
|
706 |
+
"email": "info@frenky.net"
|
707 |
+
}
|
708 |
+
],
|
709 |
+
"description": "Filesystem abstraction: Many filesystems, one API.",
|
710 |
+
"keywords": [
|
711 |
+
"Cloud Files",
|
712 |
+
"WebDAV",
|
713 |
+
"abstraction",
|
714 |
+
"aws",
|
715 |
+
"cloud",
|
716 |
+
"copy.com",
|
717 |
+
"dropbox",
|
718 |
+
"file systems",
|
719 |
+
"files",
|
720 |
+
"filesystem",
|
721 |
+
"filesystems",
|
722 |
+
"ftp",
|
723 |
+
"rackspace",
|
724 |
+
"remote",
|
725 |
+
"s3",
|
726 |
+
"sftp",
|
727 |
+
"storage"
|
728 |
+
],
|
729 |
+
"time": "2018-08-22T07:45:22+00:00"
|
730 |
+
},
|
731 |
+
{
|
732 |
+
"name": "mockery/mockery",
|
733 |
+
"version": "1.2.3",
|
734 |
+
"source": {
|
735 |
+
"type": "git",
|
736 |
+
"url": "https://github.com/mockery/mockery.git",
|
737 |
+
"reference": "4eff936d83eb809bde2c57a3cea0ee9643769031"
|
738 |
+
},
|
739 |
+
"dist": {
|
740 |
+
"type": "zip",
|
741 |
+
"url": "https://api.github.com/repos/mockery/mockery/zipball/4eff936d83eb809bde2c57a3cea0ee9643769031",
|
742 |
+
"reference": "4eff936d83eb809bde2c57a3cea0ee9643769031",
|
743 |
+
"shasum": ""
|
744 |
+
},
|
745 |
+
"require": {
|
746 |
+
"hamcrest/hamcrest-php": "~2.0",
|
747 |
+
"lib-pcre": ">=7.0",
|
748 |
+
"php": ">=5.6.0"
|
749 |
+
},
|
750 |
+
"require-dev": {
|
751 |
+
"phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0"
|
752 |
+
},
|
753 |
+
"type": "library",
|
754 |
+
"extra": {
|
755 |
+
"branch-alias": {
|
756 |
+
"dev-master": "1.0.x-dev"
|
757 |
+
}
|
758 |
+
},
|
759 |
+
"autoload": {
|
760 |
+
"psr-0": {
|
761 |
+
"Mockery": "library/"
|
762 |
+
}
|
763 |
+
},
|
764 |
+
"notification-url": "https://packagist.org/downloads/",
|
765 |
+
"license": [
|
766 |
+
"BSD-3-Clause"
|
767 |
+
],
|
768 |
+
"authors": [
|
769 |
+
{
|
770 |
+
"name": "Pádraic Brady",
|
771 |
+
"email": "padraic.brady@gmail.com",
|
772 |
+
"homepage": "http://blog.astrumfutura.com"
|
773 |
+
},
|
774 |
+
{
|
775 |
+
"name": "Dave Marshall",
|
776 |
+
"email": "dave.marshall@atstsolutions.co.uk",
|
777 |
+
"homepage": "http://davedevelopment.co.uk"
|
778 |
+
}
|
779 |
+
],
|
780 |
+
"description": "Mockery is a simple yet flexible PHP mock object framework",
|
781 |
+
"homepage": "https://github.com/mockery/mockery",
|
782 |
+
"keywords": [
|
783 |
+
"BDD",
|
784 |
+
"TDD",
|
785 |
+
"library",
|
786 |
+
"mock",
|
787 |
+
"mock objects",
|
788 |
+
"mockery",
|
789 |
+
"stub",
|
790 |
+
"test",
|
791 |
+
"test double",
|
792 |
+
"testing"
|
793 |
+
],
|
794 |
+
"time": "2019-08-07T15:01:07+00:00"
|
795 |
+
},
|
796 |
+
{
|
797 |
+
"name": "myclabs/deep-copy",
|
798 |
+
"version": "1.9.3",
|
799 |
+
"source": {
|
800 |
+
"type": "git",
|
801 |
+
"url": "https://github.com/myclabs/DeepCopy.git",
|
802 |
+
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea"
|
803 |
+
},
|
804 |
+
"dist": {
|
805 |
+
"type": "zip",
|
806 |
+
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea",
|
807 |
+
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea",
|
808 |
+
"shasum": ""
|
809 |
+
},
|
810 |
+
"require": {
|
811 |
+
"php": "^7.1"
|
812 |
+
},
|
813 |
+
"replace": {
|
814 |
+
"myclabs/deep-copy": "self.version"
|
815 |
+
},
|
816 |
+
"require-dev": {
|
817 |
+
"doctrine/collections": "^1.0",
|
818 |
+
"doctrine/common": "^2.6",
|
819 |
+
"phpunit/phpunit": "^7.1"
|
820 |
+
},
|
821 |
+
"type": "library",
|
822 |
+
"autoload": {
|
823 |
+
"psr-4": {
|
824 |
+
"DeepCopy\\": "src/DeepCopy/"
|
825 |
+
},
|
826 |
+
"files": [
|
827 |
+
"src/DeepCopy/deep_copy.php"
|
828 |
+
]
|
829 |
+
},
|
830 |
+
"notification-url": "https://packagist.org/downloads/",
|
831 |
+
"license": [
|
832 |
+
"MIT"
|
833 |
+
],
|
834 |
+
"description": "Create deep copies (clones) of your objects",
|
835 |
+
"keywords": [
|
836 |
+
"clone",
|
837 |
+
"copy",
|
838 |
+
"duplicate",
|
839 |
+
"object",
|
840 |
+
"object graph"
|
841 |
+
],
|
842 |
+
"time": "2019-08-09T12:45:53+00:00"
|
843 |
+
},
|
844 |
+
{
|
845 |
+
"name": "phpcompatibility/php-compatibility",
|
846 |
+
"version": "9.3.1",
|
847 |
+
"source": {
|
848 |
+
"type": "git",
|
849 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
|
850 |
+
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196"
|
851 |
+
},
|
852 |
+
"dist": {
|
853 |
+
"type": "zip",
|
854 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9999344e47e7af6b00e1a898eacc4e4368fb7196",
|
855 |
+
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196",
|
856 |
+
"shasum": ""
|
857 |
+
},
|
858 |
+
"require": {
|
859 |
+
"php": ">=5.3",
|
860 |
+
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
|
861 |
+
},
|
862 |
+
"conflict": {
|
863 |
+
"squizlabs/php_codesniffer": "2.6.2"
|
864 |
+
},
|
865 |
+
"require-dev": {
|
866 |
+
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
|
867 |
+
},
|
868 |
+
"suggest": {
|
869 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
|
870 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
871 |
+
},
|
872 |
+
"type": "phpcodesniffer-standard",
|
873 |
+
"notification-url": "https://packagist.org/downloads/",
|
874 |
+
"license": [
|
875 |
+
"LGPL-3.0-or-later"
|
876 |
+
],
|
877 |
+
"authors": [
|
878 |
+
{
|
879 |
+
"name": "Wim Godden",
|
880 |
+
"homepage": "https://github.com/wimg",
|
881 |
+
"role": "lead"
|
882 |
+
},
|
883 |
+
{
|
884 |
+
"name": "Juliette Reinders Folmer",
|
885 |
+
"homepage": "https://github.com/jrfnl",
|
886 |
+
"role": "lead"
|
887 |
+
},
|
888 |
+
{
|
889 |
+
"name": "Contributors",
|
890 |
+
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
|
891 |
+
}
|
892 |
+
],
|
893 |
+
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
|
894 |
+
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
|
895 |
+
"keywords": [
|
896 |
+
"compatibility",
|
897 |
+
"phpcs",
|
898 |
+
"standards"
|
899 |
+
],
|
900 |
+
"time": "2019-09-05T18:36:49+00:00"
|
901 |
+
},
|
902 |
+
{
|
903 |
+
"name": "phpcompatibility/phpcompatibility-paragonie",
|
904 |
+
"version": "1.1.0",
|
905 |
+
"source": {
|
906 |
+
"type": "git",
|
907 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
|
908 |
+
"reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936"
|
909 |
+
},
|
910 |
+
"dist": {
|
911 |
+
"type": "zip",
|
912 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
|
913 |
+
"reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
|
914 |
+
"shasum": ""
|
915 |
+
},
|
916 |
+
"require": {
|
917 |
+
"phpcompatibility/php-compatibility": "^9.0"
|
918 |
+
},
|
919 |
+
"require-dev": {
|
920 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
|
921 |
+
"paragonie/random_compat": "dev-master",
|
922 |
+
"paragonie/sodium_compat": "dev-master"
|
923 |
+
},
|
924 |
+
"suggest": {
|
925 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
926 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
927 |
+
},
|
928 |
+
"type": "phpcodesniffer-standard",
|
929 |
+
"notification-url": "https://packagist.org/downloads/",
|
930 |
+
"license": [
|
931 |
+
"LGPL-3.0-or-later"
|
932 |
+
],
|
933 |
+
"authors": [
|
934 |
+
{
|
935 |
+
"name": "Wim Godden",
|
936 |
+
"role": "lead"
|
937 |
+
},
|
938 |
+
{
|
939 |
+
"name": "Juliette Reinders Folmer",
|
940 |
+
"role": "lead"
|
941 |
+
}
|
942 |
+
],
|
943 |
+
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
|
944 |
+
"homepage": "http://phpcompatibility.com/",
|
945 |
+
"keywords": [
|
946 |
+
"compatibility",
|
947 |
+
"paragonie",
|
948 |
+
"phpcs",
|
949 |
+
"polyfill",
|
950 |
+
"standards"
|
951 |
+
],
|
952 |
+
"time": "2019-08-28T15:58:19+00:00"
|
953 |
+
},
|
954 |
+
{
|
955 |
+
"name": "phpcompatibility/phpcompatibility-wp",
|
956 |
+
"version": "2.1.0",
|
957 |
+
"source": {
|
958 |
+
"type": "git",
|
959 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
|
960 |
+
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f"
|
961 |
+
},
|
962 |
+
"dist": {
|
963 |
+
"type": "zip",
|
964 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f",
|
965 |
+
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f",
|
966 |
+
"shasum": ""
|
967 |
+
},
|
968 |
+
"require": {
|
969 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
970 |
+
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
|
971 |
+
},
|
972 |
+
"require-dev": {
|
973 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5"
|
974 |
+
},
|
975 |
+
"suggest": {
|
976 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
977 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
978 |
+
},
|
979 |
+
"type": "phpcodesniffer-standard",
|
980 |
+
"notification-url": "https://packagist.org/downloads/",
|
981 |
+
"license": [
|
982 |
+
"LGPL-3.0-or-later"
|
983 |
+
],
|
984 |
+
"authors": [
|
985 |
+
{
|
986 |
+
"name": "Wim Godden",
|
987 |
+
"role": "lead"
|
988 |
+
},
|
989 |
+
{
|
990 |
+
"name": "Juliette Reinders Folmer",
|
991 |
+
"role": "lead"
|
992 |
+
}
|
993 |
+
],
|
994 |
+
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
|
995 |
+
"homepage": "http://phpcompatibility.com/",
|
996 |
+
"keywords": [
|
997 |
+
"compatibility",
|
998 |
+
"phpcs",
|
999 |
+
"standards",
|
1000 |
+
"wordpress"
|
1001 |
+
],
|
1002 |
+
"time": "2019-08-28T14:22:28+00:00"
|
1003 |
+
},
|
1004 |
+
{
|
1005 |
+
"name": "phpdocumentor/reflection-common",
|
1006 |
+
"version": "1.0.1",
|
1007 |
+
"source": {
|
1008 |
+
"type": "git",
|
1009 |
+
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
1010 |
+
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
|
1011 |
+
},
|
1012 |
+
"dist": {
|
1013 |
+
"type": "zip",
|
1014 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
1015 |
+
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
1016 |
+
"shasum": ""
|
1017 |
+
},
|
1018 |
+
"require": {
|
1019 |
+
"php": ">=5.5"
|
1020 |
+
},
|
1021 |
+
"require-dev": {
|
1022 |
+
"phpunit/phpunit": "^4.6"
|
1023 |
+
},
|
1024 |
+
"type": "library",
|
1025 |
+
"extra": {
|
1026 |
+
"branch-alias": {
|
1027 |
+
"dev-master": "1.0.x-dev"
|
1028 |
+
}
|
1029 |
+
},
|
1030 |
+
"autoload": {
|
1031 |
+
"psr-4": {
|
1032 |
+
"phpDocumentor\\Reflection\\": [
|
1033 |
+
"src"
|
1034 |
+
]
|
1035 |
+
}
|
1036 |
+
},
|
1037 |
+
"notification-url": "https://packagist.org/downloads/",
|
1038 |
+
"license": [
|
1039 |
+
"MIT"
|
1040 |
+
],
|
1041 |
+
"authors": [
|
1042 |
+
{
|
1043 |
+
"name": "Jaap van Otterdijk",
|
1044 |
+
"email": "opensource@ijaap.nl"
|
1045 |
+
}
|
1046 |
+
],
|
1047 |
+
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
|
1048 |
+
"homepage": "http://www.phpdoc.org",
|
1049 |
+
"keywords": [
|
1050 |
+
"FQSEN",
|
1051 |
+
"phpDocumentor",
|
1052 |
+
"phpdoc",
|
1053 |
+
"reflection",
|
1054 |
+
"static analysis"
|
1055 |
+
],
|
1056 |
+
"time": "2017-09-11T18:02:19+00:00"
|
1057 |
+
},
|
1058 |
+
{
|
1059 |
+
"name": "phpdocumentor/reflection-docblock",
|
1060 |
+
"version": "4.3.1",
|
1061 |
+
"source": {
|
1062 |
+
"type": "git",
|
1063 |
+
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
1064 |
+
"reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c"
|
1065 |
+
},
|
1066 |
+
"dist": {
|
1067 |
+
"type": "zip",
|
1068 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
|
1069 |
+
"reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
|
1070 |
+
"shasum": ""
|
1071 |
+
},
|
1072 |
+
"require": {
|
1073 |
+
"php": "^7.0",
|
1074 |
+
"phpdocumentor/reflection-common": "^1.0.0",
|
1075 |
+
"phpdocumentor/type-resolver": "^0.4.0",
|
1076 |
+
"webmozart/assert": "^1.0"
|
1077 |
+
},
|
1078 |
+
"require-dev": {
|
1079 |
+
"doctrine/instantiator": "~1.0.5",
|
1080 |
+
"mockery/mockery": "^1.0",
|
1081 |
+
"phpunit/phpunit": "^6.4"
|
1082 |
+
},
|
1083 |
+
"type": "library",
|
1084 |
+
"extra": {
|
1085 |
+
"branch-alias": {
|
1086 |
+
"dev-master": "4.x-dev"
|
1087 |
+
}
|
1088 |
+
},
|
1089 |
+
"autoload": {
|
1090 |
+
"psr-4": {
|
1091 |
+
"phpDocumentor\\Reflection\\": [
|
1092 |
+
"src/"
|
1093 |
+
]
|
1094 |
+
}
|
1095 |
+
},
|
1096 |
+
"notification-url": "https://packagist.org/downloads/",
|
1097 |
+
"license": [
|
1098 |
+
"MIT"
|
1099 |
+
],
|
1100 |
+
"authors": [
|
1101 |
+
{
|
1102 |
+
"name": "Mike van Riel",
|
1103 |
+
"email": "me@mikevanriel.com"
|
1104 |
+
}
|
1105 |
+
],
|
1106 |
+
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
1107 |
+
"time": "2019-04-30T17:48:53+00:00"
|
1108 |
+
},
|
1109 |
+
{
|
1110 |
+
"name": "phpdocumentor/type-resolver",
|
1111 |
+
"version": "0.4.0",
|
1112 |
+
"source": {
|
1113 |
+
"type": "git",
|
1114 |
+
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
1115 |
+
"reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
|
1116 |
+
},
|
1117 |
+
"dist": {
|
1118 |
+
"type": "zip",
|
1119 |
+
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
|
1120 |
+
"reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
|
1121 |
+
"shasum": ""
|
1122 |
+
},
|
1123 |
+
"require": {
|
1124 |
+
"php": "^5.5 || ^7.0",
|
1125 |
+
"phpdocumentor/reflection-common": "^1.0"
|
1126 |
+
},
|
1127 |
+
"require-dev": {
|
1128 |
+
"mockery/mockery": "^0.9.4",
|
1129 |
+
"phpunit/phpunit": "^5.2||^4.8.24"
|
1130 |
+
},
|
1131 |
+
"type": "library",
|
1132 |
+
"extra": {
|
1133 |
+
"branch-alias": {
|
1134 |
+
"dev-master": "1.0.x-dev"
|
1135 |
+
}
|
1136 |
+
},
|
1137 |
+
"autoload": {
|
1138 |
+
"psr-4": {
|
1139 |
+
"phpDocumentor\\Reflection\\": [
|
1140 |
+
"src/"
|
1141 |
+
]
|
1142 |
+
}
|
1143 |
+
},
|
1144 |
+
"notification-url": "https://packagist.org/downloads/",
|
1145 |
+
"license": [
|
1146 |
+
"MIT"
|
1147 |
+
],
|
1148 |
+
"authors": [
|
1149 |
+
{
|
1150 |
+
"name": "Mike van Riel",
|
1151 |
+
"email": "me@mikevanriel.com"
|
1152 |
+
}
|
1153 |
+
],
|
1154 |
+
"time": "2017-07-14T14:27:02+00:00"
|
1155 |
+
},
|
1156 |
+
{
|
1157 |
+
"name": "phpspec/prophecy",
|
1158 |
+
"version": "1.8.1",
|
1159 |
+
"source": {
|
1160 |
+
"type": "git",
|
1161 |
+
"url": "https://github.com/phpspec/prophecy.git",
|
1162 |
+
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
|
1163 |
+
},
|
1164 |
+
"dist": {
|
1165 |
+
"type": "zip",
|
1166 |
+
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
|
1167 |
+
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
|
1168 |
+
"shasum": ""
|
1169 |
+
},
|
1170 |
+
"require": {
|
1171 |
+
"doctrine/instantiator": "^1.0.2",
|
1172 |
+
"php": "^5.3|^7.0",
|
1173 |
+
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
|
1174 |
+
"sebastian/comparator": "^1.1|^2.0|^3.0",
|
1175 |
+
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
|
1176 |
+
},
|
1177 |
+
"require-dev": {
|
1178 |
+
"phpspec/phpspec": "^2.5|^3.2",
|
1179 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
|
1180 |
+
},
|
1181 |
+
"type": "library",
|
1182 |
+
"extra": {
|
1183 |
+
"branch-alias": {
|
1184 |
+
"dev-master": "1.8.x-dev"
|
1185 |
+
}
|
1186 |
+
},
|
1187 |
+
"autoload": {
|
1188 |
+
"psr-4": {
|
1189 |
+
"Prophecy\\": "src/Prophecy"
|
1190 |
+
}
|
1191 |
+
},
|
1192 |
+
"notification-url": "https://packagist.org/downloads/",
|
1193 |
+
"license": [
|
1194 |
+
"MIT"
|
1195 |
+
],
|
1196 |
+
"authors": [
|
1197 |
+
{
|
1198 |
+
"name": "Konstantin Kudryashov",
|
1199 |
+
"email": "ever.zet@gmail.com",
|
1200 |
+
"homepage": "http://everzet.com"
|
1201 |
+
},
|
1202 |
+
{
|
1203 |
+
"name": "Marcello Duarte",
|
1204 |
+
"email": "marcello.duarte@gmail.com"
|
1205 |
+
}
|
1206 |
+
],
|
1207 |
+
"description": "Highly opinionated mocking framework for PHP 5.3+",
|
1208 |
+
"homepage": "https://github.com/phpspec/prophecy",
|
1209 |
+
"keywords": [
|
1210 |
+
"Double",
|
1211 |
+
"Dummy",
|
1212 |
+
"fake",
|
1213 |
+
"mock",
|
1214 |
+
"spy",
|
1215 |
+
"stub"
|
1216 |
+
],
|
1217 |
+
"time": "2019-06-13T12:50:23+00:00"
|
1218 |
+
},
|
1219 |
+
{
|
1220 |
+
"name": "phpunit/php-code-coverage",
|
1221 |
+
"version": "4.0.8",
|
1222 |
+
"source": {
|
1223 |
+
"type": "git",
|
1224 |
+
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
1225 |
+
"reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
|
1226 |
+
},
|
1227 |
+
"dist": {
|
1228 |
+
"type": "zip",
|
1229 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
|
1230 |
+
"reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
|
1231 |
+
"shasum": ""
|
1232 |
+
},
|
1233 |
+
"require": {
|
1234 |
+
"ext-dom": "*",
|
1235 |
+
"ext-xmlwriter": "*",
|
1236 |
+
"php": "^5.6 || ^7.0",
|
1237 |
+
"phpunit/php-file-iterator": "^1.3",
|
1238 |
+
"phpunit/php-text-template": "^1.2",
|
1239 |
+
"phpunit/php-token-stream": "^1.4.2 || ^2.0",
|
1240 |
+
"sebastian/code-unit-reverse-lookup": "^1.0",
|
1241 |
+
"sebastian/environment": "^1.3.2 || ^2.0",
|
1242 |
+
"sebastian/version": "^1.0 || ^2.0"
|
1243 |
+
},
|
1244 |
+
"require-dev": {
|
1245 |
+
"ext-xdebug": "^2.1.4",
|
1246 |
+
"phpunit/phpunit": "^5.7"
|
1247 |
+
},
|
1248 |
+
"suggest": {
|
1249 |
+
"ext-xdebug": "^2.5.1"
|
1250 |
+
},
|
1251 |
+
"type": "library",
|
1252 |
+
"extra": {
|
1253 |
+
"branch-alias": {
|
1254 |
+
"dev-master": "4.0.x-dev"
|
1255 |
+
}
|
1256 |
+
},
|
1257 |
+
"autoload": {
|
1258 |
+
"classmap": [
|
1259 |
+
"src/"
|
1260 |
+
]
|
1261 |
+
},
|
1262 |
+
"notification-url": "https://packagist.org/downloads/",
|
1263 |
+
"license": [
|
1264 |
+
"BSD-3-Clause"
|
1265 |
+
],
|
1266 |
+
"authors": [
|
1267 |
+
{
|
1268 |
+
"name": "Sebastian Bergmann",
|
1269 |
+
"email": "sb@sebastian-bergmann.de",
|
1270 |
+
"role": "lead"
|
1271 |
+
}
|
1272 |
+
],
|
1273 |
+
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
|
1274 |
+
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
|
1275 |
+
"keywords": [
|
1276 |
+
"coverage",
|
1277 |
+
"testing",
|
1278 |
+
"xunit"
|
1279 |
+
],
|
1280 |
+
"time": "2017-04-02T07:44:40+00:00"
|
1281 |
+
},
|
1282 |
+
{
|
1283 |
+
"name": "phpunit/php-file-iterator",
|
1284 |
+
"version": "1.4.5",
|
1285 |
+
"source": {
|
1286 |
+
"type": "git",
|
1287 |
+
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
1288 |
+
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
|
1289 |
+
},
|
1290 |
+
"dist": {
|
1291 |
+
"type": "zip",
|
1292 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
|
1293 |
+
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
|
1294 |
+
"shasum": ""
|
1295 |
+
},
|
1296 |
+
"require": {
|
1297 |
+
"php": ">=5.3.3"
|
1298 |
+
},
|
1299 |
+
"type": "library",
|
1300 |
+
"extra": {
|
1301 |
+
"branch-alias": {
|
1302 |
+
"dev-master": "1.4.x-dev"
|
1303 |
+
}
|
1304 |
+
},
|
1305 |
+
"autoload": {
|
1306 |
+
"classmap": [
|
1307 |
+
"src/"
|
1308 |
+
]
|
1309 |
+
},
|
1310 |
+
"notification-url": "https://packagist.org/downloads/",
|
1311 |
+
"license": [
|
1312 |
+
"BSD-3-Clause"
|
1313 |
+
],
|
1314 |
+
"authors": [
|
1315 |
+
{
|
1316 |
+
"name": "Sebastian Bergmann",
|
1317 |
+
"email": "sb@sebastian-bergmann.de",
|
1318 |
+
"role": "lead"
|
1319 |
+
}
|
1320 |
+
],
|
1321 |
+
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
|
1322 |
+
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
|
1323 |
+
"keywords": [
|
1324 |
+
"filesystem",
|
1325 |
+
"iterator"
|
1326 |
+
],
|
1327 |
+
"time": "2017-11-27T13:52:08+00:00"
|
1328 |
+
},
|
1329 |
+
{
|
1330 |
+
"name": "phpunit/php-text-template",
|
1331 |
+
"version": "1.2.1",
|
1332 |
+
"source": {
|
1333 |
+
"type": "git",
|
1334 |
+
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
1335 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
|
1336 |
+
},
|
1337 |
+
"dist": {
|
1338 |
+
"type": "zip",
|
1339 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
1340 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
1341 |
+
"shasum": ""
|
1342 |
+
},
|
1343 |
+
"require": {
|
1344 |
+
"php": ">=5.3.3"
|
1345 |
+
},
|
1346 |
+
"type": "library",
|
1347 |
+
"autoload": {
|
1348 |
+
"classmap": [
|
1349 |
+
"src/"
|
1350 |
+
]
|
1351 |
+
},
|
1352 |
+
"notification-url": "https://packagist.org/downloads/",
|
1353 |
+
"license": [
|
1354 |
+
"BSD-3-Clause"
|
1355 |
+
],
|
1356 |
+
"authors": [
|
1357 |
+
{
|
1358 |
+
"name": "Sebastian Bergmann",
|
1359 |
+
"email": "sebastian@phpunit.de",
|
1360 |
+
"role": "lead"
|
1361 |
+
}
|
1362 |
+
],
|
1363 |
+
"description": "Simple template engine.",
|
1364 |
+
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
1365 |
+
"keywords": [
|
1366 |
+
"template"
|
1367 |
+
],
|
1368 |
+
"time": "2015-06-21T13:50:34+00:00"
|
1369 |
+
},
|
1370 |
+
{
|
1371 |
+
"name": "phpunit/php-timer",
|
1372 |
+
"version": "1.0.9",
|
1373 |
+
"source": {
|
1374 |
+
"type": "git",
|
1375 |
+
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
1376 |
+
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
|
1377 |
+
},
|
1378 |
+
"dist": {
|
1379 |
+
"type": "zip",
|
1380 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
|
1381 |
+
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
|
1382 |
+
"shasum": ""
|
1383 |
+
},
|
1384 |
+
"require": {
|
1385 |
+
"php": "^5.3.3 || ^7.0"
|
1386 |
+
},
|
1387 |
+
"require-dev": {
|
1388 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
|
1389 |
+
},
|
1390 |
+
"type": "library",
|
1391 |
+
"extra": {
|
1392 |
+
"branch-alias": {
|
1393 |
+
"dev-master": "1.0-dev"
|
1394 |
+
}
|
1395 |
+
},
|
1396 |
+
"autoload": {
|
1397 |
+
"classmap": [
|
1398 |
+
"src/"
|
1399 |
+
]
|
1400 |
+
},
|
1401 |
+
"notification-url": "https://packagist.org/downloads/",
|
1402 |
+
"license": [
|
1403 |
+
"BSD-3-Clause"
|
1404 |
+
],
|
1405 |
+
"authors": [
|
1406 |
+
{
|
1407 |
+
"name": "Sebastian Bergmann",
|
1408 |
+
"email": "sb@sebastian-bergmann.de",
|
1409 |
+
"role": "lead"
|
1410 |
+
}
|
1411 |
+
],
|
1412 |
+
"description": "Utility class for timing",
|
1413 |
+
"homepage": "https://github.com/sebastianbergmann/php-timer/",
|
1414 |
+
"keywords": [
|
1415 |
+
"timer"
|
1416 |
+
],
|
1417 |
+
"time": "2017-02-26T11:10:40+00:00"
|
1418 |
+
},
|
1419 |
+
{
|
1420 |
+
"name": "phpunit/php-token-stream",
|
1421 |
+
"version": "2.0.2",
|
1422 |
+
"source": {
|
1423 |
+
"type": "git",
|
1424 |
+
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
1425 |
+
"reference": "791198a2c6254db10131eecfe8c06670700904db"
|
1426 |
+
},
|
1427 |
+
"dist": {
|
1428 |
+
"type": "zip",
|
1429 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
|
1430 |
+
"reference": "791198a2c6254db10131eecfe8c06670700904db",
|
1431 |
+
"shasum": ""
|
1432 |
+
},
|
1433 |
+
"require": {
|
1434 |
+
"ext-tokenizer": "*",
|
1435 |
+
"php": "^7.0"
|
1436 |
+
},
|
1437 |
+
"require-dev": {
|
1438 |
+
"phpunit/phpunit": "^6.2.4"
|
1439 |
+
},
|
1440 |
+
"type": "library",
|
1441 |
+
"extra": {
|
1442 |
+
"branch-alias": {
|
1443 |
+
"dev-master": "2.0-dev"
|
1444 |
+
}
|
1445 |
+
},
|
1446 |
+
"autoload": {
|
1447 |
+
"classmap": [
|
1448 |
+
"src/"
|
1449 |
+
]
|
1450 |
+
},
|
1451 |
+
"notification-url": "https://packagist.org/downloads/",
|
1452 |
+
"license": [
|
1453 |
+
"BSD-3-Clause"
|
1454 |
+
],
|
1455 |
+
"authors": [
|
1456 |
+
{
|
1457 |
+
"name": "Sebastian Bergmann",
|
1458 |
+
"email": "sebastian@phpunit.de"
|
1459 |
+
}
|
1460 |
+
],
|
1461 |
+
"description": "Wrapper around PHP's tokenizer extension.",
|
1462 |
+
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
|
1463 |
+
"keywords": [
|
1464 |
+
"tokenizer"
|
1465 |
+
],
|
1466 |
+
"time": "2017-11-27T05:48:46+00:00"
|
1467 |
+
},
|
1468 |
+
{
|
1469 |
+
"name": "phpunit/phpunit",
|
1470 |
+
"version": "5.7.27",
|
1471 |
+
"source": {
|
1472 |
+
"type": "git",
|
1473 |
+
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
1474 |
+
"reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
|
1475 |
+
},
|
1476 |
+
"dist": {
|
1477 |
+
"type": "zip",
|
1478 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
|
1479 |
+
"reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
|
1480 |
+
"shasum": ""
|
1481 |
+
},
|
1482 |
+
"require": {
|
1483 |
+
"ext-dom": "*",
|
1484 |
+
"ext-json": "*",
|
1485 |
+
"ext-libxml": "*",
|
1486 |
+
"ext-mbstring": "*",
|
1487 |
+
"ext-xml": "*",
|
1488 |
+
"myclabs/deep-copy": "~1.3",
|
1489 |
+
"php": "^5.6 || ^7.0",
|
1490 |
+
"phpspec/prophecy": "^1.6.2",
|
1491 |
+
"phpunit/php-code-coverage": "^4.0.4",
|
1492 |
+
"phpunit/php-file-iterator": "~1.4",
|
1493 |
+
"phpunit/php-text-template": "~1.2",
|
1494 |
+
"phpunit/php-timer": "^1.0.6",
|
1495 |
+
"phpunit/phpunit-mock-objects": "^3.2",
|
1496 |
+
"sebastian/comparator": "^1.2.4",
|
1497 |
+
"sebastian/diff": "^1.4.3",
|
1498 |
+
"sebastian/environment": "^1.3.4 || ^2.0",
|
1499 |
+
"sebastian/exporter": "~2.0",
|
1500 |
+
"sebastian/global-state": "^1.1",
|
1501 |
+
"sebastian/object-enumerator": "~2.0",
|
1502 |
+
"sebastian/resource-operations": "~1.0",
|
1503 |
+
"sebastian/version": "^1.0.6|^2.0.1",
|
1504 |
+
"symfony/yaml": "~2.1|~3.0|~4.0"
|
1505 |
+
},
|
1506 |
+
"conflict": {
|
1507 |
+
"phpdocumentor/reflection-docblock": "3.0.2"
|
1508 |
+
},
|
1509 |
+
"require-dev": {
|
1510 |
+
"ext-pdo": "*"
|
1511 |
+
},
|
1512 |
+
"suggest": {
|
1513 |
+
"ext-xdebug": "*",
|
1514 |
+
"phpunit/php-invoker": "~1.1"
|
1515 |
+
},
|
1516 |
+
"bin": [
|
1517 |
+
"phpunit"
|
1518 |
+
],
|
1519 |
+
"type": "library",
|
1520 |
+
"extra": {
|
1521 |
+
"branch-alias": {
|
1522 |
+
"dev-master": "5.7.x-dev"
|
1523 |
+
}
|
1524 |
+
},
|
1525 |
+
"autoload": {
|
1526 |
+
"classmap": [
|
1527 |
+
"src/"
|
1528 |
+
]
|
1529 |
+
},
|
1530 |
+
"notification-url": "https://packagist.org/downloads/",
|
1531 |
+
"license": [
|
1532 |
+
"BSD-3-Clause"
|
1533 |
+
],
|
1534 |
+
"authors": [
|
1535 |
+
{
|
1536 |
+
"name": "Sebastian Bergmann",
|
1537 |
+
"email": "sebastian@phpunit.de",
|
1538 |
+
"role": "lead"
|
1539 |
+
}
|
1540 |
+
],
|
1541 |
+
"description": "The PHP Unit Testing framework.",
|
1542 |
+
"homepage": "https://phpunit.de/",
|
1543 |
+
"keywords": [
|
1544 |
+
"phpunit",
|
1545 |
+
"testing",
|
1546 |
+
"xunit"
|
1547 |
+
],
|
1548 |
+
"time": "2018-02-01T05:50:59+00:00"
|
1549 |
+
},
|
1550 |
+
{
|
1551 |
+
"name": "phpunit/phpunit-mock-objects",
|
1552 |
+
"version": "3.4.4",
|
1553 |
+
"source": {
|
1554 |
+
"type": "git",
|
1555 |
+
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
1556 |
+
"reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
|
1557 |
+
},
|
1558 |
+
"dist": {
|
1559 |
+
"type": "zip",
|
1560 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
|
1561 |
+
"reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
|
1562 |
+
"shasum": ""
|
1563 |
+
},
|
1564 |
+
"require": {
|
1565 |
+
"doctrine/instantiator": "^1.0.2",
|
1566 |
+
"php": "^5.6 || ^7.0",
|
1567 |
+
"phpunit/php-text-template": "^1.2",
|
1568 |
+
"sebastian/exporter": "^1.2 || ^2.0"
|
1569 |
+
},
|
1570 |
+
"conflict": {
|
1571 |
+
"phpunit/phpunit": "<5.4.0"
|
1572 |
+
},
|
1573 |
+
"require-dev": {
|
1574 |
+
"phpunit/phpunit": "^5.4"
|
1575 |
+
},
|
1576 |
+
"suggest": {
|
1577 |
+
"ext-soap": "*"
|
1578 |
+
},
|
1579 |
+
"type": "library",
|
1580 |
+
"extra": {
|
1581 |
+
"branch-alias": {
|
1582 |
+
"dev-master": "3.2.x-dev"
|
1583 |
+
}
|
1584 |
+
},
|
1585 |
+
"autoload": {
|
1586 |
+
"classmap": [
|
1587 |
+
"src/"
|
1588 |
+
]
|
1589 |
+
},
|
1590 |
+
"notification-url": "https://packagist.org/downloads/",
|
1591 |
+
"license": [
|
1592 |
+
"BSD-3-Clause"
|
1593 |
+
],
|
1594 |
+
"authors": [
|
1595 |
+
{
|
1596 |
+
"name": "Sebastian Bergmann",
|
1597 |
+
"email": "sb@sebastian-bergmann.de",
|
1598 |
+
"role": "lead"
|
1599 |
+
}
|
1600 |
+
],
|
1601 |
+
"description": "Mock Object library for PHPUnit",
|
1602 |
+
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
1603 |
+
"keywords": [
|
1604 |
+
"mock",
|
1605 |
+
"xunit"
|
1606 |
+
],
|
1607 |
+
"abandoned": true,
|
1608 |
+
"time": "2017-06-30T09:13:00+00:00"
|
1609 |
+
},
|
1610 |
+
{
|
1611 |
+
"name": "sebastian/code-unit-reverse-lookup",
|
1612 |
+
"version": "1.0.1",
|
1613 |
+
"source": {
|
1614 |
+
"type": "git",
|
1615 |
+
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
|
1616 |
+
"reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
|
1617 |
+
},
|
1618 |
+
"dist": {
|
1619 |
+
"type": "zip",
|
1620 |
+
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
|
1621 |
+
"reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
|
1622 |
+
"shasum": ""
|
1623 |
+
},
|
1624 |
+
"require": {
|
1625 |
+
"php": "^5.6 || ^7.0"
|
1626 |
+
},
|
1627 |
+
"require-dev": {
|
1628 |
+
"phpunit/phpunit": "^5.7 || ^6.0"
|
1629 |
+
},
|
1630 |
+
"type": "library",
|
1631 |
+
"extra": {
|
1632 |
+
"branch-alias": {
|
1633 |
+
"dev-master": "1.0.x-dev"
|
1634 |
+
}
|
1635 |
+
},
|
1636 |
+
"autoload": {
|
1637 |
+
"classmap": [
|
1638 |
+
"src/"
|
1639 |
+
]
|
1640 |
+
},
|
1641 |
+
"notification-url": "https://packagist.org/downloads/",
|
1642 |
+
"license": [
|
1643 |
+
"BSD-3-Clause"
|
1644 |
+
],
|
1645 |
+
"authors": [
|
1646 |
+
{
|
1647 |
+
"name": "Sebastian Bergmann",
|
1648 |
+
"email": "sebastian@phpunit.de"
|
1649 |
+
}
|
1650 |
+
],
|
1651 |
+
"description": "Looks up which function or method a line of code belongs to",
|
1652 |
+
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
|
1653 |
+
"time": "2017-03-04T06:30:41+00:00"
|
1654 |
+
},
|
1655 |
+
{
|
1656 |
+
"name": "sebastian/comparator",
|
1657 |
+
"version": "1.2.4",
|
1658 |
+
"source": {
|
1659 |
+
"type": "git",
|
1660 |
+
"url": "https://github.com/sebastianbergmann/comparator.git",
|
1661 |
+
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
|
1662 |
+
},
|
1663 |
+
"dist": {
|
1664 |
+
"type": "zip",
|
1665 |
+
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
|
1666 |
+
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
|
1667 |
+
"shasum": ""
|
1668 |
+
},
|
1669 |
+
"require": {
|
1670 |
+
"php": ">=5.3.3",
|
1671 |
+
"sebastian/diff": "~1.2",
|
1672 |
+
"sebastian/exporter": "~1.2 || ~2.0"
|
1673 |
+
},
|
1674 |
+
"require-dev": {
|
1675 |
+
"phpunit/phpunit": "~4.4"
|
1676 |
+
},
|
1677 |
+
"type": "library",
|
1678 |
+
"extra": {
|
1679 |
+
"branch-alias": {
|
1680 |
+
"dev-master": "1.2.x-dev"
|
1681 |
+
}
|
1682 |
+
},
|
1683 |
+
"autoload": {
|
1684 |
+
"classmap": [
|
1685 |
+
"src/"
|
1686 |
+
]
|
1687 |
+
},
|
1688 |
+
"notification-url": "https://packagist.org/downloads/",
|
1689 |
+
"license": [
|
1690 |
+
"BSD-3-Clause"
|
1691 |
+
],
|
1692 |
+
"authors": [
|
1693 |
+
{
|
1694 |
+
"name": "Jeff Welch",
|
1695 |
+
"email": "whatthejeff@gmail.com"
|
1696 |
+
},
|
1697 |
+
{
|
1698 |
+
"name": "Volker Dusch",
|
1699 |
+
"email": "github@wallbash.com"
|
1700 |
+
},
|
1701 |
+
{
|
1702 |
+
"name": "Bernhard Schussek",
|
1703 |
+
"email": "bschussek@2bepublished.at"
|
1704 |
+
},
|
1705 |
+
{
|
1706 |
+
"name": "Sebastian Bergmann",
|
1707 |
+
"email": "sebastian@phpunit.de"
|
1708 |
+
}
|
1709 |
+
],
|
1710 |
+
"description": "Provides the functionality to compare PHP values for equality",
|
1711 |
+
"homepage": "http://www.github.com/sebastianbergmann/comparator",
|
1712 |
+
"keywords": [
|
1713 |
+
"comparator",
|
1714 |
+
"compare",
|
1715 |
+
"equality"
|
1716 |
+
],
|
1717 |
+
"time": "2017-01-29T09:50:25+00:00"
|
1718 |
+
},
|
1719 |
+
{
|
1720 |
+
"name": "sebastian/diff",
|
1721 |
+
"version": "1.4.3",
|
1722 |
+
"source": {
|
1723 |
+
"type": "git",
|
1724 |
+
"url": "https://github.com/sebastianbergmann/diff.git",
|
1725 |
+
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
|
1726 |
+
},
|
1727 |
+
"dist": {
|
1728 |
+
"type": "zip",
|
1729 |
+
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
|
1730 |
+
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
|
1731 |
+
"shasum": ""
|
1732 |
+
},
|
1733 |
+
"require": {
|
1734 |
+
"php": "^5.3.3 || ^7.0"
|
1735 |
+
},
|
1736 |
+
"require-dev": {
|
1737 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
|
1738 |
+
},
|
1739 |
+
"type": "library",
|
1740 |
+
"extra": {
|
1741 |
+
"branch-alias": {
|
1742 |
+
"dev-master": "1.4-dev"
|
1743 |
+
}
|
1744 |
+
},
|
1745 |
+
"autoload": {
|
1746 |
+
"classmap": [
|
1747 |
+
"src/"
|
1748 |
+
]
|
1749 |
+
},
|
1750 |
+
"notification-url": "https://packagist.org/downloads/",
|
1751 |
+
"license": [
|
1752 |
+
"BSD-3-Clause"
|
1753 |
+
],
|
1754 |
+
"authors": [
|
1755 |
+
{
|
1756 |
+
"name": "Kore Nordmann",
|
1757 |
+
"email": "mail@kore-nordmann.de"
|
1758 |
+
},
|
1759 |
+
{
|
1760 |
+
"name": "Sebastian Bergmann",
|
1761 |
+
"email": "sebastian@phpunit.de"
|
1762 |
+
}
|
1763 |
+
],
|
1764 |
+
"description": "Diff implementation",
|
1765 |
+
"homepage": "https://github.com/sebastianbergmann/diff",
|
1766 |
+
"keywords": [
|
1767 |
+
"diff"
|
1768 |
+
],
|
1769 |
+
"time": "2017-05-22T07:24:03+00:00"
|
1770 |
+
},
|
1771 |
+
{
|
1772 |
+
"name": "sebastian/environment",
|
1773 |
+
"version": "2.0.0",
|
1774 |
+
"source": {
|
1775 |
+
"type": "git",
|
1776 |
+
"url": "https://github.com/sebastianbergmann/environment.git",
|
1777 |
+
"reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
|
1778 |
+
},
|
1779 |
+
"dist": {
|
1780 |
+
"type": "zip",
|
1781 |
+
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
|
1782 |
+
"reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
|
1783 |
+
"shasum": ""
|
1784 |
+
},
|
1785 |
+
"require": {
|
1786 |
+
"php": "^5.6 || ^7.0"
|
1787 |
+
},
|
1788 |
+
"require-dev": {
|
1789 |
+
"phpunit/phpunit": "^5.0"
|
1790 |
+
},
|
1791 |
+
"type": "library",
|
1792 |
+
"extra": {
|
1793 |
+
"branch-alias": {
|
1794 |
+
"dev-master": "2.0.x-dev"
|
1795 |
+
}
|
1796 |
+
},
|
1797 |
+
"autoload": {
|
1798 |
+
"classmap": [
|
1799 |
+
"src/"
|
1800 |
+
]
|
1801 |
+
},
|
1802 |
+
"notification-url": "https://packagist.org/downloads/",
|
1803 |
+
"license": [
|
1804 |
+
"BSD-3-Clause"
|
1805 |
+
],
|
1806 |
+
"authors": [
|
1807 |
+
{
|
1808 |
+
"name": "Sebastian Bergmann",
|
1809 |
+
"email": "sebastian@phpunit.de"
|
1810 |
+
}
|
1811 |
+
],
|
1812 |
+
"description": "Provides functionality to handle HHVM/PHP environments",
|
1813 |
+
"homepage": "http://www.github.com/sebastianbergmann/environment",
|
1814 |
+
"keywords": [
|
1815 |
+
"Xdebug",
|
1816 |
+
"environment",
|
1817 |
+
"hhvm"
|
1818 |
+
],
|
1819 |
+
"time": "2016-11-26T07:53:53+00:00"
|
1820 |
+
},
|
1821 |
+
{
|
1822 |
+
"name": "sebastian/exporter",
|
1823 |
+
"version": "2.0.0",
|
1824 |
+
"source": {
|
1825 |
+
"type": "git",
|
1826 |
+
"url": "https://github.com/sebastianbergmann/exporter.git",
|
1827 |
+
"reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
|
1828 |
+
},
|
1829 |
+
"dist": {
|
1830 |
+
"type": "zip",
|
1831 |
+
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
|
1832 |
+
"reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
|
1833 |
+
"shasum": ""
|
1834 |
+
},
|
1835 |
+
"require": {
|
1836 |
+
"php": ">=5.3.3",
|
1837 |
+
"sebastian/recursion-context": "~2.0"
|
1838 |
+
},
|
1839 |
+
"require-dev": {
|
1840 |
+
"ext-mbstring": "*",
|
1841 |
+
"phpunit/phpunit": "~4.4"
|
1842 |
+
},
|
1843 |
+
"type": "library",
|
1844 |
+
"extra": {
|
1845 |
+
"branch-alias": {
|
1846 |
+
"dev-master": "2.0.x-dev"
|
1847 |
+
}
|
1848 |
+
},
|
1849 |
+
"autoload": {
|
1850 |
+
"classmap": [
|
1851 |
+
"src/"
|
1852 |
+
]
|
1853 |
+
},
|
1854 |
+
"notification-url": "https://packagist.org/downloads/",
|
1855 |
+
"license": [
|
1856 |
+
"BSD-3-Clause"
|
1857 |
+
],
|
1858 |
+
"authors": [
|
1859 |
+
{
|
1860 |
+
"name": "Jeff Welch",
|
1861 |
+
"email": "whatthejeff@gmail.com"
|
1862 |
+
},
|
1863 |
+
{
|
1864 |
+
"name": "Volker Dusch",
|
1865 |
+
"email": "github@wallbash.com"
|
1866 |
+
},
|
1867 |
+
{
|
1868 |
+
"name": "Bernhard Schussek",
|
1869 |
+
"email": "bschussek@2bepublished.at"
|
1870 |
+
},
|
1871 |
+
{
|
1872 |
+
"name": "Sebastian Bergmann",
|
1873 |
+
"email": "sebastian@phpunit.de"
|
1874 |
+
},
|
1875 |
+
{
|
1876 |
+
"name": "Adam Harvey",
|
1877 |
+
"email": "aharvey@php.net"
|
1878 |
+
}
|
1879 |
+
],
|
1880 |
+
"description": "Provides the functionality to export PHP variables for visualization",
|
1881 |
+
"homepage": "http://www.github.com/sebastianbergmann/exporter",
|
1882 |
+
"keywords": [
|
1883 |
+
"export",
|
1884 |
+
"exporter"
|
1885 |
+
],
|
1886 |
+
"time": "2016-11-19T08:54:04+00:00"
|
1887 |
+
},
|
1888 |
+
{
|
1889 |
+
"name": "sebastian/global-state",
|
1890 |
+
"version": "1.1.1",
|
1891 |
+
"source": {
|
1892 |
+
"type": "git",
|
1893 |
+
"url": "https://github.com/sebastianbergmann/global-state.git",
|
1894 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
|
1895 |
+
},
|
1896 |
+
"dist": {
|
1897 |
+
"type": "zip",
|
1898 |
+
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
1899 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
1900 |
+
"shasum": ""
|
1901 |
+
},
|
1902 |
+
"require": {
|
1903 |
+
"php": ">=5.3.3"
|
1904 |
+
},
|
1905 |
+
"require-dev": {
|
1906 |
+
"phpunit/phpunit": "~4.2"
|
1907 |
+
},
|
1908 |
+
"suggest": {
|
1909 |
+
"ext-uopz": "*"
|
1910 |
+
},
|
1911 |
+
"type": "library",
|
1912 |
+
"extra": {
|
1913 |
+
"branch-alias": {
|
1914 |
+
"dev-master": "1.0-dev"
|
1915 |
+
}
|
1916 |
+
},
|
1917 |
+
"autoload": {
|
1918 |
+
"classmap": [
|
1919 |
+
"src/"
|
1920 |
+
]
|
1921 |
+
},
|
1922 |
+
"notification-url": "https://packagist.org/downloads/",
|
1923 |
+
"license": [
|
1924 |
+
"BSD-3-Clause"
|
1925 |
+
],
|
1926 |
+
"authors": [
|
1927 |
+
{
|
1928 |
+
"name": "Sebastian Bergmann",
|
1929 |
+
"email": "sebastian@phpunit.de"
|
1930 |
+
}
|
1931 |
+
],
|
1932 |
+
"description": "Snapshotting of global state",
|
1933 |
+
"homepage": "http://www.github.com/sebastianbergmann/global-state",
|
1934 |
+
"keywords": [
|
1935 |
+
"global state"
|
1936 |
+
],
|
1937 |
+
"time": "2015-10-12T03:26:01+00:00"
|
1938 |
+
},
|
1939 |
+
{
|
1940 |
+
"name": "sebastian/object-enumerator",
|
1941 |
+
"version": "2.0.1",
|
1942 |
+
"source": {
|
1943 |
+
"type": "git",
|
1944 |
+
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
|
1945 |
+
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
|
1946 |
+
},
|
1947 |
+
"dist": {
|
1948 |
+
"type": "zip",
|
1949 |
+
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
|
1950 |
+
"reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
|
1951 |
+
"shasum": ""
|
1952 |
+
},
|
1953 |
+
"require": {
|
1954 |
+
"php": ">=5.6",
|
1955 |
+
"sebastian/recursion-context": "~2.0"
|
1956 |
+
},
|
1957 |
+
"require-dev": {
|
1958 |
+
"phpunit/phpunit": "~5"
|
1959 |
+
},
|
1960 |
+
"type": "library",
|
1961 |
+
"extra": {
|
1962 |
+
"branch-alias": {
|
1963 |
+
"dev-master": "2.0.x-dev"
|
1964 |
+
}
|
1965 |
+
},
|
1966 |
+
"autoload": {
|
1967 |
+
"classmap": [
|
1968 |
+
"src/"
|
1969 |
+
]
|
1970 |
+
},
|
1971 |
+
"notification-url": "https://packagist.org/downloads/",
|
1972 |
+
"license": [
|
1973 |
+
"BSD-3-Clause"
|
1974 |
+
],
|
1975 |
+
"authors": [
|
1976 |
+
{
|
1977 |
+
"name": "Sebastian Bergmann",
|
1978 |
+
"email": "sebastian@phpunit.de"
|
1979 |
+
}
|
1980 |
+
],
|
1981 |
+
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
1982 |
+
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
1983 |
+
"time": "2017-02-18T15:18:39+00:00"
|
1984 |
+
},
|
1985 |
+
{
|
1986 |
+
"name": "sebastian/recursion-context",
|
1987 |
+
"version": "2.0.0",
|
1988 |
+
"source": {
|
1989 |
+
"type": "git",
|
1990 |
+
"url": "https://github.com/sebastianbergmann/recursion-context.git",
|
1991 |
+
"reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
|
1992 |
+
},
|
1993 |
+
"dist": {
|
1994 |
+
"type": "zip",
|
1995 |
+
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
|
1996 |
+
"reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
|
1997 |
+
"shasum": ""
|
1998 |
+
},
|
1999 |
+
"require": {
|
2000 |
+
"php": ">=5.3.3"
|
2001 |
+
},
|
2002 |
+
"require-dev": {
|
2003 |
+
"phpunit/phpunit": "~4.4"
|
2004 |
+
},
|
2005 |
+
"type": "library",
|
2006 |
+
"extra": {
|
2007 |
+
"branch-alias": {
|
2008 |
+
"dev-master": "2.0.x-dev"
|
2009 |
+
}
|
2010 |
+
},
|
2011 |
+
"autoload": {
|
2012 |
+
"classmap": [
|
2013 |
+
"src/"
|
2014 |
+
]
|
2015 |
+
},
|
2016 |
+
"notification-url": "https://packagist.org/downloads/",
|
2017 |
+
"license": [
|
2018 |
+
"BSD-3-Clause"
|
2019 |
+
],
|
2020 |
+
"authors": [
|
2021 |
+
{
|
2022 |
+
"name": "Jeff Welch",
|
2023 |
+
"email": "whatthejeff@gmail.com"
|
2024 |
+
},
|
2025 |
+
{
|
2026 |
+
"name": "Sebastian Bergmann",
|
2027 |
+
"email": "sebastian@phpunit.de"
|
2028 |
+
},
|
2029 |
+
{
|
2030 |
+
"name": "Adam Harvey",
|
2031 |
+
"email": "aharvey@php.net"
|
2032 |
+
}
|
2033 |
+
],
|
2034 |
+
"description": "Provides functionality to recursively process PHP variables",
|
2035 |
+
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
2036 |
+
"time": "2016-11-19T07:33:16+00:00"
|
2037 |
+
},
|
2038 |
+
{
|
2039 |
+
"name": "sebastian/resource-operations",
|
2040 |
+
"version": "1.0.0",
|
2041 |
+
"source": {
|
2042 |
+
"type": "git",
|
2043 |
+
"url": "https://github.com/sebastianbergmann/resource-operations.git",
|
2044 |
+
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
|
2045 |
+
},
|
2046 |
+
"dist": {
|
2047 |
+
"type": "zip",
|
2048 |
+
"url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
2049 |
+
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
2050 |
+
"shasum": ""
|
2051 |
+
},
|
2052 |
+
"require": {
|
2053 |
+
"php": ">=5.6.0"
|
2054 |
+
},
|
2055 |
+
"type": "library",
|
2056 |
+
"extra": {
|
2057 |
+
"branch-alias": {
|
2058 |
+
"dev-master": "1.0.x-dev"
|
2059 |
+
}
|
2060 |
+
},
|
2061 |
+
"autoload": {
|
2062 |
+
"classmap": [
|
2063 |
+
"src/"
|
2064 |
+
]
|
2065 |
+
},
|
2066 |
+
"notification-url": "https://packagist.org/downloads/",
|
2067 |
+
"license": [
|
2068 |
+
"BSD-3-Clause"
|
2069 |
+
],
|
2070 |
+
"authors": [
|
2071 |
+
{
|
2072 |
+
"name": "Sebastian Bergmann",
|
2073 |
+
"email": "sebastian@phpunit.de"
|
2074 |
+
}
|
2075 |
+
],
|
2076 |
+
"description": "Provides a list of PHP built-in functions that operate on resources",
|
2077 |
+
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
|
2078 |
+
"time": "2015-07-28T20:34:47+00:00"
|
2079 |
+
},
|
2080 |
+
{
|
2081 |
+
"name": "sebastian/version",
|
2082 |
+
"version": "2.0.1",
|
2083 |
+
"source": {
|
2084 |
+
"type": "git",
|
2085 |
+
"url": "https://github.com/sebastianbergmann/version.git",
|
2086 |
+
"reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
|
2087 |
+
},
|
2088 |
+
"dist": {
|
2089 |
+
"type": "zip",
|
2090 |
+
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
|
2091 |
+
"reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
|
2092 |
+
"shasum": ""
|
2093 |
+
},
|
2094 |
+
"require": {
|
2095 |
+
"php": ">=5.6"
|
2096 |
+
},
|
2097 |
+
"type": "library",
|
2098 |
+
"extra": {
|
2099 |
+
"branch-alias": {
|
2100 |
+
"dev-master": "2.0.x-dev"
|
2101 |
+
}
|
2102 |
+
},
|
2103 |
+
"autoload": {
|
2104 |
+
"classmap": [
|
2105 |
+
"src/"
|
2106 |
+
]
|
2107 |
+
},
|
2108 |
+
"notification-url": "https://packagist.org/downloads/",
|
2109 |
+
"license": [
|
2110 |
+
"BSD-3-Clause"
|
2111 |
+
],
|
2112 |
+
"authors": [
|
2113 |
+
{
|
2114 |
+
"name": "Sebastian Bergmann",
|
2115 |
+
"email": "sebastian@phpunit.de",
|
2116 |
+
"role": "lead"
|
2117 |
+
}
|
2118 |
+
],
|
2119 |
+
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
2120 |
+
"homepage": "https://github.com/sebastianbergmann/version",
|
2121 |
+
"time": "2016-10-03T07:35:21+00:00"
|
2122 |
+
},
|
2123 |
+
{
|
2124 |
+
"name": "squizlabs/php_codesniffer",
|
2125 |
+
"version": "3.4.2",
|
2126 |
+
"source": {
|
2127 |
+
"type": "git",
|
2128 |
+
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
2129 |
+
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
|
2130 |
+
},
|
2131 |
+
"dist": {
|
2132 |
+
"type": "zip",
|
2133 |
+
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
|
2134 |
+
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
|
2135 |
+
"shasum": ""
|
2136 |
+
},
|
2137 |
+
"require": {
|
2138 |
+
"ext-simplexml": "*",
|
2139 |
+
"ext-tokenizer": "*",
|
2140 |
+
"ext-xmlwriter": "*",
|
2141 |
+
"php": ">=5.4.0"
|
2142 |
+
},
|
2143 |
+
"require-dev": {
|
2144 |
+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
2145 |
+
},
|
2146 |
+
"bin": [
|
2147 |
+
"bin/phpcs",
|
2148 |
+
"bin/phpcbf"
|
2149 |
+
],
|
2150 |
+
"type": "library",
|
2151 |
+
"extra": {
|
2152 |
+
"branch-alias": {
|
2153 |
+
"dev-master": "3.x-dev"
|
2154 |
+
}
|
2155 |
+
},
|
2156 |
+
"notification-url": "https://packagist.org/downloads/",
|
2157 |
+
"license": [
|
2158 |
+
"BSD-3-Clause"
|
2159 |
+
],
|
2160 |
+
"authors": [
|
2161 |
+
{
|
2162 |
+
"name": "Greg Sherwood",
|
2163 |
+
"role": "lead"
|
2164 |
+
}
|
2165 |
+
],
|
2166 |
+
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
2167 |
+
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
|
2168 |
+
"keywords": [
|
2169 |
+
"phpcs",
|
2170 |
+
"standards"
|
2171 |
+
],
|
2172 |
+
"time": "2019-04-10T23:49:02+00:00"
|
2173 |
+
},
|
2174 |
+
{
|
2175 |
+
"name": "symfony/console",
|
2176 |
+
"version": "v4.3.4",
|
2177 |
+
"source": {
|
2178 |
+
"type": "git",
|
2179 |
+
"url": "https://github.com/symfony/console.git",
|
2180 |
+
"reference": "de63799239b3881b8a08f8481b22348f77ed7b36"
|
2181 |
+
},
|
2182 |
+
"dist": {
|
2183 |
+
"type": "zip",
|
2184 |
+
"url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36",
|
2185 |
+
"reference": "de63799239b3881b8a08f8481b22348f77ed7b36",
|
2186 |
+
"shasum": ""
|
2187 |
+
},
|
2188 |
+
"require": {
|
2189 |
+
"php": "^7.1.3",
|
2190 |
+
"symfony/polyfill-mbstring": "~1.0",
|
2191 |
+
"symfony/polyfill-php73": "^1.8",
|
2192 |
+
"symfony/service-contracts": "^1.1"
|
2193 |
+
},
|
2194 |
+
"conflict": {
|
2195 |
+
"symfony/dependency-injection": "<3.4",
|
2196 |
+
"symfony/event-dispatcher": "<4.3",
|
2197 |
+
"symfony/process": "<3.3"
|
2198 |
+
},
|
2199 |
+
"provide": {
|
2200 |
+
"psr/log-implementation": "1.0"
|
2201 |
+
},
|
2202 |
+
"require-dev": {
|
2203 |
+
"psr/log": "~1.0",
|
2204 |
+
"symfony/config": "~3.4|~4.0",
|
2205 |
+
"symfony/dependency-injection": "~3.4|~4.0",
|
2206 |
+
"symfony/event-dispatcher": "^4.3",
|
2207 |
+
"symfony/lock": "~3.4|~4.0",
|
2208 |
+
"symfony/process": "~3.4|~4.0",
|
2209 |
+
"symfony/var-dumper": "^4.3"
|
2210 |
+
},
|
2211 |
+
"suggest": {
|
2212 |
+
"psr/log": "For using the console logger",
|
2213 |
+
"symfony/event-dispatcher": "",
|
2214 |
+
"symfony/lock": "",
|
2215 |
+
"symfony/process": ""
|
2216 |
+
},
|
2217 |
+
"type": "library",
|
2218 |
+
"extra": {
|
2219 |
+
"branch-alias": {
|
2220 |
+
"dev-master": "4.3-dev"
|
2221 |
+
}
|
2222 |
+
},
|
2223 |
+
"autoload": {
|
2224 |
+
"psr-4": {
|
2225 |
+
"Symfony\\Component\\Console\\": ""
|
2226 |
+
},
|
2227 |
+
"exclude-from-classmap": [
|
2228 |
+
"/Tests/"
|
2229 |
+
]
|
2230 |
+
},
|
2231 |
+
"notification-url": "https://packagist.org/downloads/",
|
2232 |
+
"license": [
|
2233 |
+
"MIT"
|
2234 |
+
],
|
2235 |
+
"authors": [
|
2236 |
+
{
|
2237 |
+
"name": "Fabien Potencier",
|
2238 |
+
"email": "fabien@symfony.com"
|
2239 |
+
},
|
2240 |
+
{
|
2241 |
+
"name": "Symfony Community",
|
2242 |
+
"homepage": "https://symfony.com/contributors"
|
2243 |
+
}
|
2244 |
+
],
|
2245 |
+
"description": "Symfony Console Component",
|
2246 |
+
"homepage": "https://symfony.com",
|
2247 |
+
"time": "2019-08-26T08:26:39+00:00"
|
2248 |
+
},
|
2249 |
+
{
|
2250 |
+
"name": "symfony/finder",
|
2251 |
+
"version": "v4.3.4",
|
2252 |
+
"source": {
|
2253 |
+
"type": "git",
|
2254 |
+
"url": "https://github.com/symfony/finder.git",
|
2255 |
+
"reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2"
|
2256 |
+
},
|
2257 |
+
"dist": {
|
2258 |
+
"type": "zip",
|
2259 |
+
"url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2",
|
2260 |
+
"reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2",
|
2261 |
+
"shasum": ""
|
2262 |
+
},
|
2263 |
+
"require": {
|
2264 |
+
"php": "^7.1.3"
|
2265 |
+
},
|
2266 |
+
"type": "library",
|
2267 |
+
"extra": {
|
2268 |
+
"branch-alias": {
|
2269 |
+
"dev-master": "4.3-dev"
|
2270 |
+
}
|
2271 |
+
},
|
2272 |
+
"autoload": {
|
2273 |
+
"psr-4": {
|
2274 |
+
"Symfony\\Component\\Finder\\": ""
|
2275 |
+
},
|
2276 |
+
"exclude-from-classmap": [
|
2277 |
+
"/Tests/"
|
2278 |
+
]
|
2279 |
+
},
|
2280 |
+
"notification-url": "https://packagist.org/downloads/",
|
2281 |
+
"license": [
|
2282 |
+
"MIT"
|
2283 |
+
],
|
2284 |
+
"authors": [
|
2285 |
+
{
|
2286 |
+
"name": "Fabien Potencier",
|
2287 |
+
"email": "fabien@symfony.com"
|
2288 |
+
},
|
2289 |
+
{
|
2290 |
+
"name": "Symfony Community",
|
2291 |
+
"homepage": "https://symfony.com/contributors"
|
2292 |
+
}
|
2293 |
+
],
|
2294 |
+
"description": "Symfony Finder Component",
|
2295 |
+
"homepage": "https://symfony.com",
|
2296 |
+
"time": "2019-08-14T12:26:46+00:00"
|
2297 |
+
},
|
2298 |
+
{
|
2299 |
+
"name": "symfony/polyfill-ctype",
|
2300 |
+
"version": "v1.12.0",
|
2301 |
+
"source": {
|
2302 |
+
"type": "git",
|
2303 |
+
"url": "https://github.com/symfony/polyfill-ctype.git",
|
2304 |
+
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
|
2305 |
+
},
|
2306 |
+
"dist": {
|
2307 |
+
"type": "zip",
|
2308 |
+
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
|
2309 |
+
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
|
2310 |
+
"shasum": ""
|
2311 |
+
},
|
2312 |
+
"require": {
|
2313 |
+
"php": ">=5.3.3"
|
2314 |
+
},
|
2315 |
+
"suggest": {
|
2316 |
+
"ext-ctype": "For best performance"
|
2317 |
+
},
|
2318 |
+
"type": "library",
|
2319 |
+
"extra": {
|
2320 |
+
"branch-alias": {
|
2321 |
+
"dev-master": "1.12-dev"
|
2322 |
+
}
|
2323 |
+
},
|
2324 |
+
"autoload": {
|
2325 |
+
"psr-4": {
|
2326 |
+
"Symfony\\Polyfill\\Ctype\\": ""
|
2327 |
+
},
|
2328 |
+
"files": [
|
2329 |
+
"bootstrap.php"
|
2330 |
+
]
|
2331 |
+
},
|
2332 |
+
"notification-url": "https://packagist.org/downloads/",
|
2333 |
+
"license": [
|
2334 |
+
"MIT"
|
2335 |
+
],
|
2336 |
+
"authors": [
|
2337 |
+
{
|
2338 |
+
"name": "Gert de Pagter",
|
2339 |
+
"email": "BackEndTea@gmail.com"
|
2340 |
+
},
|
2341 |
+
{
|
2342 |
+
"name": "Symfony Community",
|
2343 |
+
"homepage": "https://symfony.com/contributors"
|
2344 |
+
}
|
2345 |
+
],
|
2346 |
+
"description": "Symfony polyfill for ctype functions",
|
2347 |
+
"homepage": "https://symfony.com",
|
2348 |
+
"keywords": [
|
2349 |
+
"compatibility",
|
2350 |
+
"ctype",
|
2351 |
+
"polyfill",
|
2352 |
+
"portable"
|
2353 |
+
],
|
2354 |
+
"time": "2019-08-06T08:03:45+00:00"
|
2355 |
+
},
|
2356 |
+
{
|
2357 |
+
"name": "symfony/polyfill-mbstring",
|
2358 |
+
"version": "v1.12.0",
|
2359 |
+
"source": {
|
2360 |
+
"type": "git",
|
2361 |
+
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
2362 |
+
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
|
2363 |
+
},
|
2364 |
+
"dist": {
|
2365 |
+
"type": "zip",
|
2366 |
+
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
|
2367 |
+
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
|
2368 |
+
"shasum": ""
|
2369 |
+
},
|
2370 |
+
"require": {
|
2371 |
+
"php": ">=5.3.3"
|
2372 |
+
},
|
2373 |
+
"suggest": {
|
2374 |
+
"ext-mbstring": "For best performance"
|
2375 |
+
},
|
2376 |
+
"type": "library",
|
2377 |
+
"extra": {
|
2378 |
+
"branch-alias": {
|
2379 |
+
"dev-master": "1.12-dev"
|
2380 |
+
}
|
2381 |
+
},
|
2382 |
+
"autoload": {
|
2383 |
+
"psr-4": {
|
2384 |
+
"Symfony\\Polyfill\\Mbstring\\": ""
|
2385 |
+
},
|
2386 |
+
"files": [
|
2387 |
+
"bootstrap.php"
|
2388 |
+
]
|
2389 |
+
},
|
2390 |
+
"notification-url": "https://packagist.org/downloads/",
|
2391 |
+
"license": [
|
2392 |
+
"MIT"
|
2393 |
+
],
|
2394 |
+
"authors": [
|
2395 |
+
{
|
2396 |
+
"name": "Nicolas Grekas",
|
2397 |
+
"email": "p@tchwork.com"
|
2398 |
+
},
|
2399 |
+
{
|
2400 |
+
"name": "Symfony Community",
|
2401 |
+
"homepage": "https://symfony.com/contributors"
|
2402 |
+
}
|
2403 |
+
],
|
2404 |
+
"description": "Symfony polyfill for the Mbstring extension",
|
2405 |
+
"homepage": "https://symfony.com",
|
2406 |
+
"keywords": [
|
2407 |
+
"compatibility",
|
2408 |
+
"mbstring",
|
2409 |
+
"polyfill",
|
2410 |
+
"portable",
|
2411 |
+
"shim"
|
2412 |
+
],
|
2413 |
+
"time": "2019-08-06T08:03:45+00:00"
|
2414 |
+
},
|
2415 |
+
{
|
2416 |
+
"name": "symfony/polyfill-php73",
|
2417 |
+
"version": "v1.12.0",
|
2418 |
+
"source": {
|
2419 |
+
"type": "git",
|
2420 |
+
"url": "https://github.com/symfony/polyfill-php73.git",
|
2421 |
+
"reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188"
|
2422 |
+
},
|
2423 |
+
"dist": {
|
2424 |
+
"type": "zip",
|
2425 |
+
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188",
|
2426 |
+
"reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188",
|
2427 |
+
"shasum": ""
|
2428 |
+
},
|
2429 |
+
"require": {
|
2430 |
+
"php": ">=5.3.3"
|
2431 |
+
},
|
2432 |
+
"type": "library",
|
2433 |
+
"extra": {
|
2434 |
+
"branch-alias": {
|
2435 |
+
"dev-master": "1.12-dev"
|
2436 |
+
}
|
2437 |
+
},
|
2438 |
+
"autoload": {
|
2439 |
+
"psr-4": {
|
2440 |
+
"Symfony\\Polyfill\\Php73\\": ""
|
2441 |
+
},
|
2442 |
+
"files": [
|
2443 |
+
"bootstrap.php"
|
2444 |
+
],
|
2445 |
+
"classmap": [
|
2446 |
+
"Resources/stubs"
|
2447 |
+
]
|
2448 |
+
},
|
2449 |
+
"notification-url": "https://packagist.org/downloads/",
|
2450 |
+
"license": [
|
2451 |
+
"MIT"
|
2452 |
+
],
|
2453 |
+
"authors": [
|
2454 |
+
{
|
2455 |
+
"name": "Nicolas Grekas",
|
2456 |
+
"email": "p@tchwork.com"
|
2457 |
+
},
|
2458 |
+
{
|
2459 |
+
"name": "Symfony Community",
|
2460 |
+
"homepage": "https://symfony.com/contributors"
|
2461 |
+
}
|
2462 |
+
],
|
2463 |
+
"description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
|
2464 |
+
"homepage": "https://symfony.com",
|
2465 |
+
"keywords": [
|
2466 |
+
"compatibility",
|
2467 |
+
"polyfill",
|
2468 |
+
"portable",
|
2469 |
+
"shim"
|
2470 |
+
],
|
2471 |
+
"time": "2019-08-06T08:03:45+00:00"
|
2472 |
+
},
|
2473 |
+
{
|
2474 |
+
"name": "symfony/service-contracts",
|
2475 |
+
"version": "v1.1.6",
|
2476 |
+
"source": {
|
2477 |
+
"type": "git",
|
2478 |
+
"url": "https://github.com/symfony/service-contracts.git",
|
2479 |
+
"reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3"
|
2480 |
+
},
|
2481 |
+
"dist": {
|
2482 |
+
"type": "zip",
|
2483 |
+
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3",
|
2484 |
+
"reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3",
|
2485 |
+
"shasum": ""
|
2486 |
+
},
|
2487 |
+
"require": {
|
2488 |
+
"php": "^7.1.3",
|
2489 |
+
"psr/container": "^1.0"
|
2490 |
+
},
|
2491 |
+
"suggest": {
|
2492 |
+
"symfony/service-implementation": ""
|
2493 |
+
},
|
2494 |
+
"type": "library",
|
2495 |
+
"extra": {
|
2496 |
+
"branch-alias": {
|
2497 |
+
"dev-master": "1.1-dev"
|
2498 |
+
}
|
2499 |
+
},
|
2500 |
+
"autoload": {
|
2501 |
+
"psr-4": {
|
2502 |
+
"Symfony\\Contracts\\Service\\": ""
|
2503 |
+
}
|
2504 |
+
},
|
2505 |
+
"notification-url": "https://packagist.org/downloads/",
|
2506 |
+
"license": [
|
2507 |
+
"MIT"
|
2508 |
+
],
|
2509 |
+
"authors": [
|
2510 |
+
{
|
2511 |
+
"name": "Nicolas Grekas",
|
2512 |
+
"email": "p@tchwork.com"
|
2513 |
+
},
|
2514 |
+
{
|
2515 |
+
"name": "Symfony Community",
|
2516 |
+
"homepage": "https://symfony.com/contributors"
|
2517 |
+
}
|
2518 |
+
],
|
2519 |
+
"description": "Generic abstractions related to writing services",
|
2520 |
+
"homepage": "https://symfony.com",
|
2521 |
+
"keywords": [
|
2522 |
+
"abstractions",
|
2523 |
+
"contracts",
|
2524 |
+
"decoupling",
|
2525 |
+
"interfaces",
|
2526 |
+
"interoperability",
|
2527 |
+
"standards"
|
2528 |
+
],
|
2529 |
+
"time": "2019-08-20T14:44:19+00:00"
|
2530 |
+
},
|
2531 |
+
{
|
2532 |
+
"name": "symfony/yaml",
|
2533 |
+
"version": "v4.3.4",
|
2534 |
+
"source": {
|
2535 |
+
"type": "git",
|
2536 |
+
"url": "https://github.com/symfony/yaml.git",
|
2537 |
+
"reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686"
|
2538 |
+
},
|
2539 |
+
"dist": {
|
2540 |
+
"type": "zip",
|
2541 |
+
"url": "https://api.github.com/repos/symfony/yaml/zipball/5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
|
2542 |
+
"reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
|
2543 |
+
"shasum": ""
|
2544 |
+
},
|
2545 |
+
"require": {
|
2546 |
+
"php": "^7.1.3",
|
2547 |
+
"symfony/polyfill-ctype": "~1.8"
|
2548 |
+
},
|
2549 |
+
"conflict": {
|
2550 |
+
"symfony/console": "<3.4"
|
2551 |
+
},
|
2552 |
+
"require-dev": {
|
2553 |
+
"symfony/console": "~3.4|~4.0"
|
2554 |
+
},
|
2555 |
+
"suggest": {
|
2556 |
+
"symfony/console": "For validating YAML files using the lint command"
|
2557 |
+
},
|
2558 |
+
"type": "library",
|
2559 |
+
"extra": {
|
2560 |
+
"branch-alias": {
|
2561 |
+
"dev-master": "4.3-dev"
|
2562 |
+
}
|
2563 |
+
},
|
2564 |
+
"autoload": {
|
2565 |
+
"psr-4": {
|
2566 |
+
"Symfony\\Component\\Yaml\\": ""
|
2567 |
+
},
|
2568 |
+
"exclude-from-classmap": [
|
2569 |
+
"/Tests/"
|
2570 |
+
]
|
2571 |
+
},
|
2572 |
+
"notification-url": "https://packagist.org/downloads/",
|
2573 |
+
"license": [
|
2574 |
+
"MIT"
|
2575 |
+
],
|
2576 |
+
"authors": [
|
2577 |
+
{
|
2578 |
+
"name": "Fabien Potencier",
|
2579 |
+
"email": "fabien@symfony.com"
|
2580 |
+
},
|
2581 |
+
{
|
2582 |
+
"name": "Symfony Community",
|
2583 |
+
"homepage": "https://symfony.com/contributors"
|
2584 |
+
}
|
2585 |
+
],
|
2586 |
+
"description": "Symfony Yaml Component",
|
2587 |
+
"homepage": "https://symfony.com",
|
2588 |
+
"time": "2019-08-20T14:27:59+00:00"
|
2589 |
+
},
|
2590 |
+
{
|
2591 |
+
"name": "webmozart/assert",
|
2592 |
+
"version": "1.5.0",
|
2593 |
+
"source": {
|
2594 |
+
"type": "git",
|
2595 |
+
"url": "https://github.com/webmozart/assert.git",
|
2596 |
+
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
|
2597 |
+
},
|
2598 |
+
"dist": {
|
2599 |
+
"type": "zip",
|
2600 |
+
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
|
2601 |
+
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
|
2602 |
+
"shasum": ""
|
2603 |
+
},
|
2604 |
+
"require": {
|
2605 |
+
"php": "^5.3.3 || ^7.0",
|
2606 |
+
"symfony/polyfill-ctype": "^1.8"
|
2607 |
+
},
|
2608 |
+
"require-dev": {
|
2609 |
+
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
|
2610 |
+
},
|
2611 |
+
"type": "library",
|
2612 |
+
"extra": {
|
2613 |
+
"branch-alias": {
|
2614 |
+
"dev-master": "1.3-dev"
|
2615 |
+
}
|
2616 |
+
},
|
2617 |
+
"autoload": {
|
2618 |
+
"psr-4": {
|
2619 |
+
"Webmozart\\Assert\\": "src/"
|
2620 |
+
}
|
2621 |
+
},
|
2622 |
+
"notification-url": "https://packagist.org/downloads/",
|
2623 |
+
"license": [
|
2624 |
+
"MIT"
|
2625 |
+
],
|
2626 |
+
"authors": [
|
2627 |
+
{
|
2628 |
+
"name": "Bernhard Schussek",
|
2629 |
+
"email": "bschussek@gmail.com"
|
2630 |
+
}
|
2631 |
+
],
|
2632 |
+
"description": "Assertions to validate method input/output with nice error messages.",
|
2633 |
+
"keywords": [
|
2634 |
+
"assert",
|
2635 |
+
"check",
|
2636 |
+
"validate"
|
2637 |
+
],
|
2638 |
+
"time": "2019-08-24T08:43:50+00:00"
|
2639 |
+
},
|
2640 |
+
{
|
2641 |
+
"name": "wp-coding-standards/wpcs",
|
2642 |
+
"version": "2.1.1",
|
2643 |
+
"source": {
|
2644 |
+
"type": "git",
|
2645 |
+
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
|
2646 |
+
"reference": "bd9c33152115e6741e3510ff7189605b35167908"
|
2647 |
+
},
|
2648 |
+
"dist": {
|
2649 |
+
"type": "zip",
|
2650 |
+
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908",
|
2651 |
+
"reference": "bd9c33152115e6741e3510ff7189605b35167908",
|
2652 |
+
"shasum": ""
|
2653 |
+
},
|
2654 |
+
"require": {
|
2655 |
+
"php": ">=5.4",
|
2656 |
+
"squizlabs/php_codesniffer": "^3.3.1"
|
2657 |
+
},
|
2658 |
+
"require-dev": {
|
2659 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
2660 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
2661 |
+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
2662 |
+
},
|
2663 |
+
"suggest": {
|
2664 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
|
2665 |
+
},
|
2666 |
+
"type": "phpcodesniffer-standard",
|
2667 |
+
"notification-url": "https://packagist.org/downloads/",
|
2668 |
+
"license": [
|
2669 |
+
"MIT"
|
2670 |
+
],
|
2671 |
+
"authors": [
|
2672 |
+
{
|
2673 |
+
"name": "Contributors",
|
2674 |
+
"homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
|
2675 |
+
}
|
2676 |
+
],
|
2677 |
+
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
|
2678 |
+
"keywords": [
|
2679 |
+
"phpcs",
|
2680 |
+
"standards",
|
2681 |
+
"wordpress"
|
2682 |
+
],
|
2683 |
+
"time": "2019-05-21T02:50:00+00:00"
|
2684 |
+
}
|
2685 |
+
],
|
2686 |
+
"aliases": [],
|
2687 |
+
"minimum-stability": "stable",
|
2688 |
+
"stability-flags": [],
|
2689 |
+
"prefer-stable": false,
|
2690 |
+
"prefer-lowest": false,
|
2691 |
+
"platform": {
|
2692 |
+
"php": ">=5.6"
|
2693 |
+
},
|
2694 |
+
"platform-dev": []
|
2695 |
+
}
|
readme.txt
CHANGED
@@ -1,299 +1,304 @@
|
|
1 |
-
=== Lazy Load by WP Rocket ===
|
2 |
-
Contributors: wp_rocket, wp_media
|
3 |
-
Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube
|
4 |
-
Requires at least: 4.7
|
5 |
-
Tested up to: 5.2
|
6 |
-
Requires PHP: 5.6
|
7 |
-
Stable tag: 2.3
|
8 |
-
|
9 |
-
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
Lazy Load by WP Rocket displays images and/or iframes on a page only when they are visible to the user. This reduces the number of HTTP requests mechanism and improves the loading time.
|
14 |
-
|
15 |
-
This plugin works on thumbnails, all images in a post content or in a widget text, avatars, smilies and iframes. No JavaScript library such as jQuery is used and the script weight is less than 10KB.
|
16 |
-
|
17 |
-
You can also replace Youtube iframes by a preview thumbnail to further speed up the loading time of your website.
|
18 |
-
|
19 |
-
= Dependencies =
|
20 |
-
|
21 |
-
Lazyload script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)
|
22 |
-
|
23 |
-
= Related Plugins =
|
24 |
-
* [Imagify](https://imagify.io/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best Image Optimizer to speed up your website with lighter images.
|
25 |
-
* [WP Rocket](https://wp-rocket.me/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best caching plugin to speed-up your WordPress website.
|
26 |
-
* [Heartbeat Control by WP Rocket](https://wordpress.org/plugins/heartbeat-control/): Heartbeat Control by WP Rocket: Best plugin to control the WordPress Heartbeat API and reduce CPU usage.
|
27 |
-
|
28 |
-
== Installation ==
|
29 |
-
|
30 |
-
1. Upload the complete `rocket-lazy-load` folder to the `/wp-content/plugins/` directory
|
31 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress
|
32 |
-
|
33 |
-
== Frequently Asked Questions ==
|
34 |
-
|
35 |
-
= How can I deactivate Lazy Load on some pages? =
|
36 |
-
|
37 |
-
You can use the `do_rocket_lazyload` filter.
|
38 |
-
|
39 |
-
Here is an example to put in functions.php files that disable lazyload on posts:
|
40 |
-
|
41 |
-
`
|
42 |
-
add_action( 'wp', 'deactivate_rocket_lazyload_on_single' );
|
43 |
-
function deactivate_rocket_lazyload_on_single() {
|
44 |
-
if ( is_single() ) {
|
45 |
-
add_filter( 'do_rocket_lazyload', '__return_false' );
|
46 |
-
}
|
47 |
-
}
|
48 |
-
`
|
49 |
-
|
50 |
-
= How can I deactivate Lazy Load on some images? =
|
51 |
-
|
52 |
-
Simply add a `data-no-lazy="1"` property in you `img` or `iframe` tag.
|
53 |
-
|
54 |
-
You can also use the filters `rocket_lazyload_excluded_attributes` or `rocket_lazyload_excluded_src` to exclude specific patterns.
|
55 |
-
|
56 |
-
For iframes, the filter is `rocket_lazyload_iframe_excluded_patterns`.
|
57 |
-
|
58 |
-
= How can I change the threshold to trigger the load? =
|
59 |
-
|
60 |
-
You can use the `rocket_lazyload_threshold` filter.
|
61 |
-
|
62 |
-
Code sample:
|
63 |
-
|
64 |
-
`
|
65 |
-
function rocket_lazyload_custom_threshold( $threshold ) {
|
66 |
-
return 100;
|
67 |
-
}
|
68 |
-
add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );
|
69 |
-
`
|
70 |
-
|
71 |
-
= I use plugin X and my images don't show anymore =
|
72 |
-
|
73 |
-
Some plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.
|
74 |
-
|
75 |
-
= How can I lazyload a background-image? =
|
76 |
-
|
77 |
-
The plugin will automatically lazyload background-images set with a `style` attribute to a `div` element:
|
78 |
-
|
79 |
-
`<div style="background-image: url(image.jpg);">`
|
80 |
-
|
81 |
-
You can also apply it manually. The element you want to apply lazyload on must have this specific markup:
|
82 |
-
|
83 |
-
`<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
|
84 |
-
|
85 |
-
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
86 |
-
|
87 |
-
== Changelog ==
|
88 |
-
= 2.3 =
|
89 |
-
|
90 |
-
Bugfix:
|
91 |
-
Bugfix:
|
92 |
-
|
93 |
-
= 2.
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
*
|
100 |
-
|
101 |
-
|
102 |
-
* Bugfix:
|
103 |
-
* Bugfix:
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
* Bugfix:
|
108 |
-
* Bugfix:
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
*
|
114 |
-
*
|
115 |
-
*
|
116 |
-
|
117 |
-
= 2.
|
118 |
-
*
|
119 |
-
*
|
120 |
-
* Enhancement:
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
=
|
125 |
-
*
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
*
|
134 |
-
|
135 |
-
|
136 |
-
* Enhancement:
|
137 |
-
*
|
138 |
-
|
139 |
-
|
140 |
-
=
|
141 |
-
*
|
142 |
-
* Bugfix:
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
*
|
147 |
-
*
|
148 |
-
|
149 |
-
= 2.
|
150 |
-
* Enhancement:
|
151 |
-
* Enhancement:
|
152 |
-
*
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
*
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
* Bugfix:
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
* Bugfix:
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
*
|
177 |
-
|
178 |
-
|
179 |
-
*
|
180 |
-
*
|
181 |
-
*
|
182 |
-
*
|
183 |
-
|
184 |
-
|
185 |
-
*
|
186 |
-
*
|
187 |
-
*
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
*
|
193 |
-
*
|
194 |
-
*
|
195 |
-
|
196 |
-
|
197 |
-
*
|
198 |
-
* Enhancement:
|
199 |
-
*
|
200 |
-
*
|
201 |
-
*
|
202 |
-
*
|
203 |
-
|
204 |
-
|
205 |
-
* Fix
|
206 |
-
* Prevent lazyload on
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
*
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
*
|
215 |
-
*
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
*
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
*
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
*
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
*
|
248 |
-
*
|
249 |
-
|
250 |
-
|
251 |
-
*
|
252 |
-
|
253 |
-
|
254 |
-
*
|
255 |
-
*
|
256 |
-
* Don't lazyload
|
257 |
-
|
258 |
-
= 1.2 =
|
259 |
-
* 2017-08-22
|
260 |
-
*
|
261 |
-
*
|
262 |
-
|
263 |
-
= 1.
|
264 |
-
* 2017-
|
265 |
-
*
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
*
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
*
|
277 |
-
*
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
*
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
*
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
*
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
*
|
294 |
-
*
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
*
|
299 |
-
*
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Lazy Load by WP Rocket ===
|
2 |
+
Contributors: wp_rocket, wp_media
|
3 |
+
Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube
|
4 |
+
Requires at least: 4.7
|
5 |
+
Tested up to: 5.2
|
6 |
+
Requires PHP: 5.6
|
7 |
+
Stable tag: 2.3.1
|
8 |
+
|
9 |
+
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
Lazy Load by WP Rocket displays images and/or iframes on a page only when they are visible to the user. This reduces the number of HTTP requests mechanism and improves the loading time.
|
14 |
+
|
15 |
+
This plugin works on thumbnails, all images in a post content or in a widget text, avatars, smilies and iframes. No JavaScript library such as jQuery is used and the script weight is less than 10KB.
|
16 |
+
|
17 |
+
You can also replace Youtube iframes by a preview thumbnail to further speed up the loading time of your website.
|
18 |
+
|
19 |
+
= Dependencies =
|
20 |
+
|
21 |
+
Lazyload script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)
|
22 |
+
|
23 |
+
= Related Plugins =
|
24 |
+
* [Imagify](https://imagify.io/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best Image Optimizer to speed up your website with lighter images.
|
25 |
+
* [WP Rocket](https://wp-rocket.me/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best caching plugin to speed-up your WordPress website.
|
26 |
+
* [Heartbeat Control by WP Rocket](https://wordpress.org/plugins/heartbeat-control/): Heartbeat Control by WP Rocket: Best plugin to control the WordPress Heartbeat API and reduce CPU usage.
|
27 |
+
|
28 |
+
== Installation ==
|
29 |
+
|
30 |
+
1. Upload the complete `rocket-lazy-load` folder to the `/wp-content/plugins/` directory
|
31 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
32 |
+
|
33 |
+
== Frequently Asked Questions ==
|
34 |
+
|
35 |
+
= How can I deactivate Lazy Load on some pages? =
|
36 |
+
|
37 |
+
You can use the `do_rocket_lazyload` filter.
|
38 |
+
|
39 |
+
Here is an example to put in functions.php files that disable lazyload on posts:
|
40 |
+
|
41 |
+
`
|
42 |
+
add_action( 'wp', 'deactivate_rocket_lazyload_on_single' );
|
43 |
+
function deactivate_rocket_lazyload_on_single() {
|
44 |
+
if ( is_single() ) {
|
45 |
+
add_filter( 'do_rocket_lazyload', '__return_false' );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
`
|
49 |
+
|
50 |
+
= How can I deactivate Lazy Load on some images? =
|
51 |
+
|
52 |
+
Simply add a `data-no-lazy="1"` property in you `img` or `iframe` tag.
|
53 |
+
|
54 |
+
You can also use the filters `rocket_lazyload_excluded_attributes` or `rocket_lazyload_excluded_src` to exclude specific patterns.
|
55 |
+
|
56 |
+
For iframes, the filter is `rocket_lazyload_iframe_excluded_patterns`.
|
57 |
+
|
58 |
+
= How can I change the threshold to trigger the load? =
|
59 |
+
|
60 |
+
You can use the `rocket_lazyload_threshold` filter.
|
61 |
+
|
62 |
+
Code sample:
|
63 |
+
|
64 |
+
`
|
65 |
+
function rocket_lazyload_custom_threshold( $threshold ) {
|
66 |
+
return 100;
|
67 |
+
}
|
68 |
+
add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );
|
69 |
+
`
|
70 |
+
|
71 |
+
= I use plugin X and my images don't show anymore =
|
72 |
+
|
73 |
+
Some plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.
|
74 |
+
|
75 |
+
= How can I lazyload a background-image? =
|
76 |
+
|
77 |
+
The plugin will automatically lazyload background-images set with a `style` attribute to a `div` element:
|
78 |
+
|
79 |
+
`<div style="background-image: url(image.jpg);">`
|
80 |
+
|
81 |
+
You can also apply it manually. The element you want to apply lazyload on must have this specific markup:
|
82 |
+
|
83 |
+
`<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
|
84 |
+
|
85 |
+
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
86 |
+
|
87 |
+
== Changelog ==
|
88 |
+
= 2.3.1 =
|
89 |
+
Bugfix: Prevent a conflict with WP Rocket
|
90 |
+
Bugfix: apply loading="lazy" on Youtube thumbnail
|
91 |
+
Bugfix: Add autoplay attribute on iframe loaded with Youtube thumbnail
|
92 |
+
|
93 |
+
= 2.3 =
|
94 |
+
Enhancement: Add support for browser native lazyload
|
95 |
+
Bugfix: Prevent broken image in some cases for picture element
|
96 |
+
Bugfix: Prevent wrong lazy attributes for srcset and sizes on an image inside a picture element
|
97 |
+
|
98 |
+
= 2.2.3 =
|
99 |
+
* Enhancement: Improve compatibility for the picture element
|
100 |
+
* Enhancement: Apply lazyload on background images set on section, span and li elements
|
101 |
+
* Enhancement: also pass $width and $height values to the rocket_lazyload_placeholder filter
|
102 |
+
* Bugfix: Use 0 instead of 1 for the default placeholder dimensions to improve compatibility
|
103 |
+
* Bugfix: Improve infinite scroll support
|
104 |
+
* Bugfix: Exclude Enfold avia-background-fixed background images and data-large_image from lazyload
|
105 |
+
|
106 |
+
= 2.2.2 =
|
107 |
+
* Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues
|
108 |
+
* Bugfix: Correctly handle responsive videos using fitVids again
|
109 |
+
|
110 |
+
= 2.2.1 =
|
111 |
+
* Enhancement: add a way to customize the lazyload script options
|
112 |
+
* Bugfix: Prevent error on Internet Explorer 11
|
113 |
+
* Bugfix: Prevent conflict with WooCommerce variation swatches
|
114 |
+
* Bugfix: Prevent empty `src` when the image is an inline base64
|
115 |
+
* Bugfix: Prevent issue when the original `src` attribute uses single quotes
|
116 |
+
|
117 |
+
= 2.2 =
|
118 |
+
* Enhancement: Update lazyload script to the latest version
|
119 |
+
* Enhancement: Use the dimensions of the original image for the placeholder size when possible, to reduce content reflow
|
120 |
+
* Enhancement: Ignore images using the new loading attribute introduce by Chrome for browser-native lazyload
|
121 |
+
|
122 |
+
= 2.1.5 =
|
123 |
+
* Bugfix: Prevent matching with the wrong data when a data-style attribute is on a div for background images
|
124 |
+
* Remove data-cfasync="false" by default
|
125 |
+
* Enhancement: Add filter rocket_lazyload_script_tag to modify the lazyload script HTML if needed
|
126 |
+
* Enhancement: Add data-no-minify attribute to the lazyload script tag to prevent it from being combined by JS combiners
|
127 |
+
* Enhancement: Improve MutationObserver code to only call the lazyload update method if an image/iframe or element with .rocket-lazyload is contained in the new node(s) added to the DOM
|
128 |
+
|
129 |
+
= 2.1.4 =
|
130 |
+
* Regression fix: Correctly exclude scripts from lazyload again
|
131 |
+
|
132 |
+
= 2.1.3 =
|
133 |
+
* Bugfix: Ignore content inside noscript tags to prevent modifying them and causing some display issues
|
134 |
+
|
135 |
+
= 2.1.2 =
|
136 |
+
* Enhancement: Update lazyload script to the latest version
|
137 |
+
* Enhancement: Add a way to lazyload the Youtube thumbnail image
|
138 |
+
* Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution
|
139 |
+
* Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead
|
140 |
+
* Enhancement: Add data-cfasync="false" to the lazyload script tag
|
141 |
+
* Enhancement: Prevent lazyload on the Oxygen Builder page editor
|
142 |
+
* Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier
|
143 |
+
|
144 |
+
|
145 |
+
= 2.1.1 =
|
146 |
+
* Bugfix: Correctly apply lazyload on `picture` elements
|
147 |
+
* Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute
|
148 |
+
|
149 |
+
= 2.1 =
|
150 |
+
* Enhancement: Update lazyload script to the latest version
|
151 |
+
* Enhancement: Apply lazyload on picture elements found on the page
|
152 |
+
* Enhancement: Apply lazyload on div elements with a background image found on the page. See FAQ for more info.
|
153 |
+
|
154 |
+
= 2.0.4 =
|
155 |
+
* Enhancement: Add filter for iframe lazyload pattern exclusion
|
156 |
+
* Enhancement: Auto-exclude soliloquy-image pattern from lazyload
|
157 |
+
* Bugfix: Prevent issue when an image/iframe is duplicated on the same page
|
158 |
+
* Bugfix: Prevent W3C validation error for the SVG placeholder
|
159 |
+
|
160 |
+
= 2.0.3.2 =
|
161 |
+
* Bugfix: Correctly ignore inline scripts with line breaks inside
|
162 |
+
|
163 |
+
= 2.0.3.1 =
|
164 |
+
* Bugfix: Correct an issue preventing lazyload from working
|
165 |
+
|
166 |
+
= 2.0.3 =
|
167 |
+
* Bugfix: Prevent incorrect display if JavaScript is disabled
|
168 |
+
* Bugfix: Don't apply lazyload on Divi/Extra/Beaver Builder Editor pages
|
169 |
+
* Bugfix: Use the correct URL for each iframe when multiple iframes are on the same page
|
170 |
+
* Bugfix: Ignore content inside inline script tags to prevent applying lazyload in it
|
171 |
+
|
172 |
+
= 2.0.2 =
|
173 |
+
* Bugfix: Fix an error in the compatibility for the AMP plugin
|
174 |
+
|
175 |
+
= 2.0.1 =
|
176 |
+
* Bugfix: Prevent a fatal error on case sensitive operating systems
|
177 |
+
|
178 |
+
= 2.0 =
|
179 |
+
* Enhancement: Lazyload is now applied on the template_redirect hook, which should allow the plugin to apply the optimization on more images and encountering less conflicts at the same time
|
180 |
+
* Enhancement: Specifically target with the lazyload script images/iframes elements with a data-lazy-src attribute
|
181 |
+
* Enhancement: Update lazyload script to the latest version
|
182 |
+
* Enhancement: Possibility to apply lazyload on background-images with a specific markup, see FAQ
|
183 |
+
* Enhancement: Use a svg image as placeholder instead of a base64 gif
|
184 |
+
* Bugfix: Only use MutationObserver if available in the browser
|
185 |
+
* Bugfix: When using the Youtube thumbnail option, correctly format the Youtube query if the video URL is encoded
|
186 |
+
* Bugfix: Improve iframe matching to prevent unexpected results
|
187 |
+
* Bugfix: Update CSS for the Youtube thumbnail option to prevent issue with the Gutenberg embeds block
|
188 |
+
|
189 |
+
= 1.4.9 =
|
190 |
+
* Enhancement: Update lazyload script to the latest available version
|
191 |
+
* Enhancement: Use lazy-sizes to prevent W3C validation error when sizes is defined but srcset is not
|
192 |
+
* Enhancement: Parse images or iframes only if the element is selected to be lazyloaded in the options
|
193 |
+
* Fix: Prevent warning for lazyload+v in Google Search Console
|
194 |
+
* Fix: Prevent PHP Notice with WooCommerce for product images
|
195 |
+
|
196 |
+
= 1.4.8 =
|
197 |
+
* Notice: Minimum WordPress version required is now 4.7
|
198 |
+
* Enhancement: Update lazyload script version
|
199 |
+
* Enhancement: Remove placeholder image to improve perceived loading time
|
200 |
+
* Enhancement: Compatibility with Youtube privacy URL
|
201 |
+
* Enhancement: Update play image to match Youtube logo
|
202 |
+
* Enhancement: Support Youtube URL parameters
|
203 |
+
* Enhancement: Lazyload images displayed with wp_get_attachment_image(). /!\ no fallback if JavaScript is disabled
|
204 |
+
* Fix: Use the correct size set in srcset for the lazyloaded image
|
205 |
+
* Fix: Prevent Youtube thumbnail replacement on playlists
|
206 |
+
* Fix: Prevent iframe lazyload on AMP pages
|
207 |
+
* Fix: Correct text domain for translations (thanks @ Chantal Coolsma)
|
208 |
+
|
209 |
+
= 1.4.7 =
|
210 |
+
* Fix compatibility with infinite scroll
|
211 |
+
* Prevent lazyload on masterSlider images
|
212 |
+
|
213 |
+
= 1.4.6 =
|
214 |
+
* Correctly include version 8.5.2 of lazyload script
|
215 |
+
* Prevent 404 error on lazyload script if URL contains "-v"
|
216 |
+
|
217 |
+
= 1.4.5 =
|
218 |
+
* Rename Setting Page Name in WP Menu
|
219 |
+
* New Product Banner in Settings Page
|
220 |
+
* Conditionally load a different version of the script depending on browser support of IntersectionObserver
|
221 |
+
* Fix a bug where images initially hidden are not correctly displayed when coming into view (slider, tabs, accordion)
|
222 |
+
|
223 |
+
= 1.4.4 =
|
224 |
+
* Admin Redesign
|
225 |
+
|
226 |
+
= 1.4.3 =
|
227 |
+
* Plugin is compatible again with PHP < 5.4
|
228 |
+
|
229 |
+
= 1.4.2 =
|
230 |
+
* Update lazyload script to bring back compatibility with IE9/10
|
231 |
+
|
232 |
+
= 1.4.1 =
|
233 |
+
* Fix bug caused by a too aggressive cleanup
|
234 |
+
|
235 |
+
= 1.4 =
|
236 |
+
* New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page
|
237 |
+
|
238 |
+
= 1.3.3 =
|
239 |
+
* 2017-09-16
|
240 |
+
* Prevent scripts and styles being removed during html parsing
|
241 |
+
|
242 |
+
= 1.3.2 =
|
243 |
+
* 2017-09-12
|
244 |
+
* Fix images not displaying in certain conditions because image attributes exclusion was not working correctly
|
245 |
+
|
246 |
+
= 1.3.1 =
|
247 |
+
* 2017-09-07
|
248 |
+
* Don't apply lazyload on Divi slider
|
249 |
+
|
250 |
+
= 1.3 =
|
251 |
+
* 2017-09-01
|
252 |
+
* Improve HTML parsing of images and iframes to be faster and more efficient
|
253 |
+
* Make the lazyload compatible with fitVids for iframes
|
254 |
+
* Don't apply lazyload on AMP pages (compatible with AMP plugin from Automattic)
|
255 |
+
* Use about:blank as default iframe placeholder to prevent warning in browser console
|
256 |
+
* Don't apply lazyload on upPrev thumbnail
|
257 |
+
|
258 |
+
= 1.2.1 =
|
259 |
+
* 2017-08-22
|
260 |
+
* Fix missing lazyload script
|
261 |
+
* Don't lazyload for images in REST API requests
|
262 |
+
|
263 |
+
= 1.2 =
|
264 |
+
* 2017-08-22
|
265 |
+
* Update lazyload script to latest version
|
266 |
+
* Change the way the script is loaded
|
267 |
+
|
268 |
+
= 1.1.1 =
|
269 |
+
* 2017-02-13
|
270 |
+
* Bug fix: Remove use of short tag to prevent 500 error on some installations
|
271 |
+
|
272 |
+
= 1.1 =
|
273 |
+
* 2017-02-12
|
274 |
+
* *New*
|
275 |
+
* JS library updated
|
276 |
+
* Support for iFrame
|
277 |
+
* Support for srcset and sizes
|
278 |
+
* New options page
|
279 |
+
|
280 |
+
= 1.0.4 =
|
281 |
+
* 2015-04-28
|
282 |
+
* Bug Fix: Resolved a conflict between LazyLoad & Emoji since WordPress 4.2
|
283 |
+
|
284 |
+
= 1.0.3 =
|
285 |
+
* 2015-01-08
|
286 |
+
* Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.
|
287 |
+
|
288 |
+
= 1.0.2 =
|
289 |
+
* 2014-12-28
|
290 |
+
* Improvement: Add « rocket_lazyload_html » filter to manage the output that will be printed.
|
291 |
+
|
292 |
+
= 1.0.1.1 =
|
293 |
+
* 2014-07-25
|
294 |
+
* Fix stupid error with new regex in 1.0.1
|
295 |
+
|
296 |
+
= 1.0.1 =
|
297 |
+
* 2014-07-16
|
298 |
+
* Bug Fix: when a IMG tag or content (widget or post) contains the string "data-no-lazy", all IMG tags were ignored instead of one.
|
299 |
+
* Security fix: The preg_replace() could lead to a XSS vuln, thanks to Alexander Concha
|
300 |
+
* Code compliance
|
301 |
+
|
302 |
+
= 1.0 =
|
303 |
+
* 2014-01-01
|
304 |
+
* Initial release.
|
rocket-lazy-load.php
CHANGED
@@ -1,78 +1,78 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Lazy Load by WP Rocket
|
4 |
-
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
5 |
-
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
6 |
-
* Version: 2.3
|
7 |
-
* Author: WP Rocket
|
8 |
-
* Author URI: https://wp-rocket.me
|
9 |
-
* Text Domain: rocket-lazy-load
|
10 |
-
* Domain Path: /languages
|
11 |
-
*
|
12 |
-
* @package RocketLazyloadPlugin
|
13 |
-
*
|
14 |
-
* Copyright 2015-2019 WP Media
|
15 |
-
*
|
16 |
-
* This program is free software; you can redistribute it and/or modify
|
17 |
-
* it under the terms of the GNU General Public License as published by
|
18 |
-
* the Free Software Foundation; either version 2 of the License, or
|
19 |
-
* (at your option) any later version.
|
20 |
-
*
|
21 |
-
* This program is distributed in the hope that it will be useful,
|
22 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
* GNU General Public License for more details.
|
25 |
-
*
|
26 |
-
* You should have received a copy of the GNU General Public License
|
27 |
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
28 |
-
*/
|
29 |
-
|
30 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
31 |
-
|
32 |
-
define('ROCKET_LL_VERSION', '2.3');
|
33 |
-
define('ROCKET_LL_WP_VERSION', '4.7');
|
34 |
-
define('ROCKET_LL_PHP_VERSION', '5.6');
|
35 |
-
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
36 |
-
define('ROCKET_LL_PATH', realpath(plugin_dir_path(__FILE__)) . '/');
|
37 |
-
define('ROCKET_LL_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets/');
|
38 |
-
define('ROCKET_LL_FRONT_JS_URL', ROCKET_LL_ASSETS_URL . 'js/');
|
39 |
-
define('ROCKET_LL_INT_MAX', PHP_INT_MAX - 15);
|
40 |
-
|
41 |
-
require ROCKET_LL_PATH . 'src/rocket-lazyload-requirements-check.php';
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Loads plugin translations
|
45 |
-
*
|
46 |
-
* @since 2.0
|
47 |
-
* @author Remy Perona
|
48 |
-
*
|
49 |
-
* @return void
|
50 |
-
*/
|
51 |
-
function rocket_lazyload_textdomain()
|
52 |
-
{
|
53 |
-
// Load translations from the languages directory.
|
54 |
-
$locale = get_locale();
|
55 |
-
|
56 |
-
// This filter is documented in /wp-includes/l10n.php.
|
57 |
-
$locale = apply_filters('plugin_locale', $locale, 'rocket-lazy-load'); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
|
58 |
-
load_textdomain('rocket-lazy-load', WP_LANG_DIR . '/plugins/rocket-lazy-load-' . $locale . '.mo');
|
59 |
-
|
60 |
-
load_plugin_textdomain('rocket-lazy-load', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
61 |
-
}
|
62 |
-
|
63 |
-
add_action('plugins_loaded', 'rocket_lazyload_textdomain');
|
64 |
-
|
65 |
-
$rocket_lazyload_requirement_checks = new Rocket_Lazyload_Requirements_Check(
|
66 |
-
array(
|
67 |
-
'plugin_name' => 'Lazy Load by WP Rocket',
|
68 |
-
'plugin_version' => ROCKET_LL_VERSION,
|
69 |
-
'wp_version' => ROCKET_LL_WP_VERSION,
|
70 |
-
'php_version' => ROCKET_LL_PHP_VERSION,
|
71 |
-
)
|
72 |
-
);
|
73 |
-
|
74 |
-
if ($rocket_lazyload_requirement_checks->check()) {
|
75 |
-
require ROCKET_LL_PATH . 'main.php';
|
76 |
-
}
|
77 |
-
|
78 |
-
unset($rocket_lazyload_requirement_checks);
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Lazy Load by WP Rocket
|
4 |
+
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
5 |
+
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
6 |
+
* Version: 2.3.1
|
7 |
+
* Author: WP Rocket
|
8 |
+
* Author URI: https://wp-rocket.me
|
9 |
+
* Text Domain: rocket-lazy-load
|
10 |
+
* Domain Path: /languages
|
11 |
+
*
|
12 |
+
* @package RocketLazyloadPlugin
|
13 |
+
*
|
14 |
+
* Copyright 2015-2019 WP Media
|
15 |
+
*
|
16 |
+
* This program is free software; you can redistribute it and/or modify
|
17 |
+
* it under the terms of the GNU General Public License as published by
|
18 |
+
* the Free Software Foundation; either version 2 of the License, or
|
19 |
+
* (at your option) any later version.
|
20 |
+
*
|
21 |
+
* This program is distributed in the hope that it will be useful,
|
22 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
* GNU General Public License for more details.
|
25 |
+
*
|
26 |
+
* You should have received a copy of the GNU General Public License
|
27 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
28 |
+
*/
|
29 |
+
|
30 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
31 |
+
|
32 |
+
define('ROCKET_LL_VERSION', '2.3.1');
|
33 |
+
define('ROCKET_LL_WP_VERSION', '4.7');
|
34 |
+
define('ROCKET_LL_PHP_VERSION', '5.6');
|
35 |
+
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
36 |
+
define('ROCKET_LL_PATH', realpath(plugin_dir_path(__FILE__)) . '/');
|
37 |
+
define('ROCKET_LL_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets/');
|
38 |
+
define('ROCKET_LL_FRONT_JS_URL', ROCKET_LL_ASSETS_URL . 'js/');
|
39 |
+
define('ROCKET_LL_INT_MAX', PHP_INT_MAX - 15);
|
40 |
+
|
41 |
+
require ROCKET_LL_PATH . 'src/rocket-lazyload-requirements-check.php';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Loads plugin translations
|
45 |
+
*
|
46 |
+
* @since 2.0
|
47 |
+
* @author Remy Perona
|
48 |
+
*
|
49 |
+
* @return void
|
50 |
+
*/
|
51 |
+
function rocket_lazyload_textdomain()
|
52 |
+
{
|
53 |
+
// Load translations from the languages directory.
|
54 |
+
$locale = get_locale();
|
55 |
+
|
56 |
+
// This filter is documented in /wp-includes/l10n.php.
|
57 |
+
$locale = apply_filters('plugin_locale', $locale, 'rocket-lazy-load'); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
|
58 |
+
load_textdomain('rocket-lazy-load', WP_LANG_DIR . '/plugins/rocket-lazy-load-' . $locale . '.mo');
|
59 |
+
|
60 |
+
load_plugin_textdomain('rocket-lazy-load', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
61 |
+
}
|
62 |
+
|
63 |
+
add_action('plugins_loaded', 'rocket_lazyload_textdomain');
|
64 |
+
|
65 |
+
$rocket_lazyload_requirement_checks = new Rocket_Lazyload_Requirements_Check(
|
66 |
+
array(
|
67 |
+
'plugin_name' => 'Lazy Load by WP Rocket',
|
68 |
+
'plugin_version' => ROCKET_LL_VERSION,
|
69 |
+
'wp_version' => ROCKET_LL_WP_VERSION,
|
70 |
+
'php_version' => ROCKET_LL_PHP_VERSION,
|
71 |
+
)
|
72 |
+
);
|
73 |
+
|
74 |
+
if ($rocket_lazyload_requirement_checks->check()) {
|
75 |
+
require ROCKET_LL_PATH . 'main.php';
|
76 |
+
}
|
77 |
+
|
78 |
+
unset($rocket_lazyload_requirement_checks);
|
src/Admin/AdminPage.php
CHANGED
@@ -1,176 +1,176 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Page Class
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Admin;
|
9 |
-
|
10 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
-
|
12 |
-
use RocketLazyLoadPlugin\Options\Options;
|
13 |
-
use RocketLazyLoadPlugin\Options\OptionArray;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Admin page configuration
|
17 |
-
*
|
18 |
-
* @since 2.0
|
19 |
-
* @author Remy Perona
|
20 |
-
*/
|
21 |
-
class AdminPage
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Plugin slug
|
25 |
-
*
|
26 |
-
* @since 2.0
|
27 |
-
* @author Remy Perona
|
28 |
-
*
|
29 |
-
* @var string
|
30 |
-
*/
|
31 |
-
private $slug = 'rocket_lazyload';
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Options instance
|
35 |
-
*
|
36 |
-
* @since 2.0
|
37 |
-
* @author Remy Perona
|
38 |
-
*
|
39 |
-
* @var Options
|
40 |
-
*/
|
41 |
-
private $options;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* OptionArray instance
|
45 |
-
*
|
46 |
-
* @since 2.0
|
47 |
-
* @author Remy Perona
|
48 |
-
*
|
49 |
-
* @var OptionArray
|
50 |
-
*/
|
51 |
-
private $option_array;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Template path
|
55 |
-
*
|
56 |
-
* @since 2.0
|
57 |
-
* @author Remy Perona
|
58 |
-
*
|
59 |
-
* @var string
|
60 |
-
*/
|
61 |
-
private $template_path;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Constructor
|
65 |
-
*
|
66 |
-
* @since 2.0
|
67 |
-
* @author Remy Perona
|
68 |
-
*
|
69 |
-
* @param Options $options Options instance.
|
70 |
-
* @param OptionArray $option_array OptionArray instance.
|
71 |
-
* @param string $template_path Template path.
|
72 |
-
*/
|
73 |
-
public function __construct(Options $options, OptionArray $option_array, $template_path)
|
74 |
-
{
|
75 |
-
$this->options = $options;
|
76 |
-
$this->option_array = $option_array;
|
77 |
-
$this->template_path = $template_path;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Registers plugin settings with WordPress
|
82 |
-
*
|
83 |
-
* @since 2.0
|
84 |
-
* @author Remy Perona
|
85 |
-
*
|
86 |
-
* @return void
|
87 |
-
*/
|
88 |
-
public function configure()
|
89 |
-
{
|
90 |
-
register_setting($this->getSlug(), $this->options->getOptionName('_options'));
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Gets the settings page title
|
95 |
-
*
|
96 |
-
* @since 2.0
|
97 |
-
* @author Remy Perona
|
98 |
-
*
|
99 |
-
* @return string
|
100 |
-
*/
|
101 |
-
public function getPageTitle()
|
102 |
-
{
|
103 |
-
return __('LazyLoad by WP Rocket', 'rocket-lazy-load');
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Gets the settings submenu title
|
108 |
-
*
|
109 |
-
* @since 2.0
|
110 |
-
* @author Remy Perona
|
111 |
-
*
|
112 |
-
* @return string
|
113 |
-
*/
|
114 |
-
public function getMenuTitle()
|
115 |
-
{
|
116 |
-
return __('LazyLoad', 'rocket-lazy-load');
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Gets the plugin slug
|
121 |
-
*
|
122 |
-
* @since 2.0
|
123 |
-
* @author Remy Perona
|
124 |
-
*
|
125 |
-
* @return string
|
126 |
-
*/
|
127 |
-
public function getSlug()
|
128 |
-
{
|
129 |
-
return $this->slug;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Gets the plugin required capability
|
134 |
-
*
|
135 |
-
* @since 2.0
|
136 |
-
* @author Remy Perona
|
137 |
-
*
|
138 |
-
* @return string
|
139 |
-
*/
|
140 |
-
public function getCapability()
|
141 |
-
{
|
142 |
-
return 'manage_options';
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Renders the admin page template
|
147 |
-
*
|
148 |
-
* @since 2.0
|
149 |
-
* @author Remy Perona
|
150 |
-
*
|
151 |
-
* @return void
|
152 |
-
*/
|
153 |
-
public function renderPage()
|
154 |
-
{
|
155 |
-
$this->renderTemplate('admin-page');
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Renders the given template if it's readable.
|
160 |
-
*
|
161 |
-
* @since 2.0
|
162 |
-
* @author Remy Perona
|
163 |
-
*
|
164 |
-
* @param string $template Template name.
|
165 |
-
*/
|
166 |
-
protected function renderTemplate($template)
|
167 |
-
{
|
168 |
-
$template_path = $this->template_path . $template . '.php';
|
169 |
-
|
170 |
-
if (! is_readable($template_path)) {
|
171 |
-
return;
|
172 |
-
}
|
173 |
-
|
174 |
-
include $template_path;
|
175 |
-
}
|
176 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Page Class
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Admin;
|
9 |
+
|
10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
+
|
12 |
+
use RocketLazyLoadPlugin\Options\Options;
|
13 |
+
use RocketLazyLoadPlugin\Options\OptionArray;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Admin page configuration
|
17 |
+
*
|
18 |
+
* @since 2.0
|
19 |
+
* @author Remy Perona
|
20 |
+
*/
|
21 |
+
class AdminPage
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Plugin slug
|
25 |
+
*
|
26 |
+
* @since 2.0
|
27 |
+
* @author Remy Perona
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $slug = 'rocket_lazyload';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Options instance
|
35 |
+
*
|
36 |
+
* @since 2.0
|
37 |
+
* @author Remy Perona
|
38 |
+
*
|
39 |
+
* @var Options
|
40 |
+
*/
|
41 |
+
private $options;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* OptionArray instance
|
45 |
+
*
|
46 |
+
* @since 2.0
|
47 |
+
* @author Remy Perona
|
48 |
+
*
|
49 |
+
* @var OptionArray
|
50 |
+
*/
|
51 |
+
private $option_array;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Template path
|
55 |
+
*
|
56 |
+
* @since 2.0
|
57 |
+
* @author Remy Perona
|
58 |
+
*
|
59 |
+
* @var string
|
60 |
+
*/
|
61 |
+
private $template_path;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Constructor
|
65 |
+
*
|
66 |
+
* @since 2.0
|
67 |
+
* @author Remy Perona
|
68 |
+
*
|
69 |
+
* @param Options $options Options instance.
|
70 |
+
* @param OptionArray $option_array OptionArray instance.
|
71 |
+
* @param string $template_path Template path.
|
72 |
+
*/
|
73 |
+
public function __construct(Options $options, OptionArray $option_array, $template_path)
|
74 |
+
{
|
75 |
+
$this->options = $options;
|
76 |
+
$this->option_array = $option_array;
|
77 |
+
$this->template_path = $template_path;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Registers plugin settings with WordPress
|
82 |
+
*
|
83 |
+
* @since 2.0
|
84 |
+
* @author Remy Perona
|
85 |
+
*
|
86 |
+
* @return void
|
87 |
+
*/
|
88 |
+
public function configure()
|
89 |
+
{
|
90 |
+
register_setting($this->getSlug(), $this->options->getOptionName('_options'));
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Gets the settings page title
|
95 |
+
*
|
96 |
+
* @since 2.0
|
97 |
+
* @author Remy Perona
|
98 |
+
*
|
99 |
+
* @return string
|
100 |
+
*/
|
101 |
+
public function getPageTitle()
|
102 |
+
{
|
103 |
+
return __('LazyLoad by WP Rocket', 'rocket-lazy-load');
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Gets the settings submenu title
|
108 |
+
*
|
109 |
+
* @since 2.0
|
110 |
+
* @author Remy Perona
|
111 |
+
*
|
112 |
+
* @return string
|
113 |
+
*/
|
114 |
+
public function getMenuTitle()
|
115 |
+
{
|
116 |
+
return __('LazyLoad', 'rocket-lazy-load');
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Gets the plugin slug
|
121 |
+
*
|
122 |
+
* @since 2.0
|
123 |
+
* @author Remy Perona
|
124 |
+
*
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
public function getSlug()
|
128 |
+
{
|
129 |
+
return $this->slug;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Gets the plugin required capability
|
134 |
+
*
|
135 |
+
* @since 2.0
|
136 |
+
* @author Remy Perona
|
137 |
+
*
|
138 |
+
* @return string
|
139 |
+
*/
|
140 |
+
public function getCapability()
|
141 |
+
{
|
142 |
+
return 'manage_options';
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Renders the admin page template
|
147 |
+
*
|
148 |
+
* @since 2.0
|
149 |
+
* @author Remy Perona
|
150 |
+
*
|
151 |
+
* @return void
|
152 |
+
*/
|
153 |
+
public function renderPage()
|
154 |
+
{
|
155 |
+
$this->renderTemplate('admin-page');
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Renders the given template if it's readable.
|
160 |
+
*
|
161 |
+
* @since 2.0
|
162 |
+
* @author Remy Perona
|
163 |
+
*
|
164 |
+
* @param string $template Template name.
|
165 |
+
*/
|
166 |
+
protected function renderTemplate($template)
|
167 |
+
{
|
168 |
+
$template_path = $this->template_path . $template . '.php';
|
169 |
+
|
170 |
+
if (! is_readable($template_path)) {
|
171 |
+
return;
|
172 |
+
}
|
173 |
+
|
174 |
+
include $template_path;
|
175 |
+
}
|
176 |
+
}
|
src/Admin/ImagifyNotice.php
CHANGED
@@ -1,72 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Imagify Notice Class
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Admin;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Imagify Notice display
|
12 |
-
*
|
13 |
-
* @since 2.0
|
14 |
-
* @author Remy Perona
|
15 |
-
*/
|
16 |
-
class ImagifyNotice
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Template path
|
20 |
-
*
|
21 |
-
* @since 2.0
|
22 |
-
* @author Remy Perona
|
23 |
-
*
|
24 |
-
* @var string
|
25 |
-
*/
|
26 |
-
private $template_path;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Constructor
|
30 |
-
*
|
31 |
-
* @since 2.0
|
32 |
-
* @author Remy Perona
|
33 |
-
*
|
34 |
-
* @param string $template_path Template path.
|
35 |
-
*/
|
36 |
-
public function __construct($template_path)
|
37 |
-
{
|
38 |
-
$this->template_path = $template_path;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Renders the Imagify notice
|
43 |
-
*
|
44 |
-
* @since 2.0
|
45 |
-
* @author Remy Perona
|
46 |
-
*
|
47 |
-
* @return void
|
48 |
-
*/
|
49 |
-
public function displayNotice()
|
50 |
-
{
|
51 |
-
$this->renderTemplate('imagify-notice');
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Renders the given template if it's readable.
|
56 |
-
*
|
57 |
-
* @since 2.0
|
58 |
-
* @author Remy Perona
|
59 |
-
*
|
60 |
-
* @param string $template Template name.
|
61 |
-
*/
|
62 |
-
protected function renderTemplate($template)
|
63 |
-
{
|
64 |
-
$template_path = $this->template_path . $template . '.php';
|
65 |
-
|
66 |
-
if (! is_readable($template_path)) {
|
67 |
-
return;
|
68 |
-
}
|
69 |
-
|
70 |
-
include $template_path;
|
71 |
-
}
|
72 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Imagify Notice Class
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Admin;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Imagify Notice display
|
12 |
+
*
|
13 |
+
* @since 2.0
|
14 |
+
* @author Remy Perona
|
15 |
+
*/
|
16 |
+
class ImagifyNotice
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Template path
|
20 |
+
*
|
21 |
+
* @since 2.0
|
22 |
+
* @author Remy Perona
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
private $template_path;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor
|
30 |
+
*
|
31 |
+
* @since 2.0
|
32 |
+
* @author Remy Perona
|
33 |
+
*
|
34 |
+
* @param string $template_path Template path.
|
35 |
+
*/
|
36 |
+
public function __construct($template_path)
|
37 |
+
{
|
38 |
+
$this->template_path = $template_path;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Renders the Imagify notice
|
43 |
+
*
|
44 |
+
* @since 2.0
|
45 |
+
* @author Remy Perona
|
46 |
+
*
|
47 |
+
* @return void
|
48 |
+
*/
|
49 |
+
public function displayNotice()
|
50 |
+
{
|
51 |
+
$this->renderTemplate('imagify-notice');
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Renders the given template if it's readable.
|
56 |
+
*
|
57 |
+
* @since 2.0
|
58 |
+
* @author Remy Perona
|
59 |
+
*
|
60 |
+
* @param string $template Template name.
|
61 |
+
*/
|
62 |
+
protected function renderTemplate($template)
|
63 |
+
{
|
64 |
+
$template_path = $this->template_path . $template . '.php';
|
65 |
+
|
66 |
+
if (! is_readable($template_path)) {
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
|
70 |
+
include $template_path;
|
71 |
+
}
|
72 |
+
}
|
src/Dependencies/Interop/Container/ContainerInterface.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Interop\Container;
|
7 |
+
|
8 |
+
use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerInterface as PsrContainerInterface;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Describes the interface of a container that exposes methods to read its entries.
|
12 |
+
*/
|
13 |
+
interface ContainerInterface extends PsrContainerInterface
|
14 |
+
{
|
15 |
+
}
|
src/Dependencies/Interop/Container/Exception/ContainerException.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
|
7 |
+
|
8 |
+
use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerExceptionInterface as PsrContainerException;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Base interface representing a generic exception in a container.
|
12 |
+
*/
|
13 |
+
interface ContainerException extends PsrContainerException
|
14 |
+
{
|
15 |
+
}
|
src/Dependencies/Interop/Container/Exception/NotFoundException.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
|
7 |
+
|
8 |
+
use RocketLazyLoadPlugin\Dependencies\Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* No entry was found in the container.
|
12 |
+
*/
|
13 |
+
interface NotFoundException extends ContainerException, PsrNotFoundException
|
14 |
+
{
|
15 |
+
}
|
src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
|
6 |
+
use ReflectionFunctionAbstract;
|
7 |
+
|
8 |
+
interface ArgumentResolverInterface extends ImmutableContainerAwareInterface
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Resolve an array of arguments to their concrete implementations.
|
12 |
+
*
|
13 |
+
* @param array $arguments
|
14 |
+
* @return array
|
15 |
+
*/
|
16 |
+
public function resolveArguments(array $arguments);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Resolves the correct arguments to be passed to a method.
|
20 |
+
*
|
21 |
+
* @param \ReflectionFunctionAbstract $method
|
22 |
+
* @param array $args
|
23 |
+
* @return array
|
24 |
+
*/
|
25 |
+
public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []);
|
26 |
+
}
|
src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ReflectionContainer;
|
7 |
+
use ReflectionFunctionAbstract;
|
8 |
+
use ReflectionParameter;
|
9 |
+
|
10 |
+
trait ArgumentResolverTrait
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* {@inheritdoc}
|
14 |
+
*/
|
15 |
+
public function resolveArguments(array $arguments)
|
16 |
+
{
|
17 |
+
foreach ($arguments as &$arg) {
|
18 |
+
if ($arg instanceof RawArgumentInterface) {
|
19 |
+
$arg = $arg->getValue();
|
20 |
+
continue;
|
21 |
+
}
|
22 |
+
|
23 |
+
if (! is_string($arg)) {
|
24 |
+
continue;
|
25 |
+
}
|
26 |
+
|
27 |
+
$container = $this->getContainer();
|
28 |
+
|
29 |
+
if (is_null($container) && $this instanceof ReflectionContainer) {
|
30 |
+
$container = $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
if (! is_null($container) && $container->has($arg)) {
|
34 |
+
$arg = $container->get($arg);
|
35 |
+
|
36 |
+
if ($arg instanceof RawArgumentInterface) {
|
37 |
+
$arg = $arg->getValue();
|
38 |
+
}
|
39 |
+
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
return $arguments;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* {@inheritdoc}
|
49 |
+
*/
|
50 |
+
public function reflectArguments(ReflectionFunctionAbstract $method, array $args = [])
|
51 |
+
{
|
52 |
+
$arguments = array_map(function (ReflectionParameter $param) use ($method, $args) {
|
53 |
+
$name = $param->getName();
|
54 |
+
$class = $param->getClass();
|
55 |
+
|
56 |
+
if (array_key_exists($name, $args)) {
|
57 |
+
return $args[$name];
|
58 |
+
}
|
59 |
+
|
60 |
+
if (! is_null($class)) {
|
61 |
+
return $class->getName();
|
62 |
+
}
|
63 |
+
|
64 |
+
if ($param->isDefaultValueAvailable()) {
|
65 |
+
return $param->getDefaultValue();
|
66 |
+
}
|
67 |
+
|
68 |
+
throw new NotFoundException(sprintf(
|
69 |
+
'Unable to resolve a value for parameter (%s) in the function/method (%s)',
|
70 |
+
$name,
|
71 |
+
$method->getName()
|
72 |
+
));
|
73 |
+
}, $method->getParameters());
|
74 |
+
|
75 |
+
return $this->resolveArguments($arguments);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
|
80 |
+
*/
|
81 |
+
abstract public function getContainer();
|
82 |
+
}
|
src/Dependencies/League/Container/Argument/RawArgument.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
|
4 |
+
|
5 |
+
class RawArgument implements RawArgumentInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @var mixed
|
9 |
+
*/
|
10 |
+
protected $value;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* {@inheritdoc}
|
14 |
+
*/
|
15 |
+
public function __construct($value)
|
16 |
+
{
|
17 |
+
$this->value = $value;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* {@inheritdoc}
|
22 |
+
*/
|
23 |
+
public function getValue()
|
24 |
+
{
|
25 |
+
return $this->value;
|
26 |
+
}
|
27 |
+
}
|
src/Dependencies/League/Container/Argument/RawArgumentInterface.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
|
4 |
+
|
5 |
+
interface RawArgumentInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Return the value of the raw argument.
|
9 |
+
*
|
10 |
+
* @return mixed
|
11 |
+
*/
|
12 |
+
public function getValue();
|
13 |
+
}
|
src/Dependencies/League/Container/Container.php
ADDED
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\RawArgumentInterface;
|
7 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactory;
|
8 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface;
|
9 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface;
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
|
11 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregate;
|
12 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface;
|
13 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregate;
|
14 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface;
|
15 |
+
|
16 |
+
class Container implements ContainerInterface
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface
|
20 |
+
*/
|
21 |
+
protected $definitionFactory;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
|
25 |
+
*/
|
26 |
+
protected $definitions = [];
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
|
30 |
+
*/
|
31 |
+
protected $sharedDefinitions = [];
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface
|
35 |
+
*/
|
36 |
+
protected $inflectors;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface
|
40 |
+
*/
|
41 |
+
protected $providers;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var array
|
45 |
+
*/
|
46 |
+
protected $shared = [];
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface[]
|
50 |
+
*/
|
51 |
+
protected $delegates = [];
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Constructor.
|
55 |
+
*
|
56 |
+
* @param \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers
|
57 |
+
* @param \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface|null $inflectors
|
58 |
+
* @param \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface|null $definitionFactory
|
59 |
+
*/
|
60 |
+
public function __construct(
|
61 |
+
ServiceProviderAggregateInterface $providers = null,
|
62 |
+
InflectorAggregateInterface $inflectors = null,
|
63 |
+
DefinitionFactoryInterface $definitionFactory = null
|
64 |
+
) {
|
65 |
+
// set required dependencies
|
66 |
+
$this->providers = (is_null($providers))
|
67 |
+
? (new ServiceProviderAggregate)->setContainer($this)
|
68 |
+
: $providers->setContainer($this);
|
69 |
+
|
70 |
+
$this->inflectors = (is_null($inflectors))
|
71 |
+
? (new InflectorAggregate)->setContainer($this)
|
72 |
+
: $inflectors->setContainer($this);
|
73 |
+
|
74 |
+
$this->definitionFactory = (is_null($definitionFactory))
|
75 |
+
? (new DefinitionFactory)->setContainer($this)
|
76 |
+
: $definitionFactory->setContainer($this);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* {@inheritdoc}
|
81 |
+
*/
|
82 |
+
public function get($alias, array $args = [])
|
83 |
+
{
|
84 |
+
try {
|
85 |
+
return $this->getFromThisContainer($alias, $args);
|
86 |
+
} catch (NotFoundException $exception) {
|
87 |
+
if ($this->providers->provides($alias)) {
|
88 |
+
$this->providers->register($alias);
|
89 |
+
|
90 |
+
return $this->getFromThisContainer($alias, $args);
|
91 |
+
}
|
92 |
+
|
93 |
+
$resolved = $this->getFromDelegate($alias, $args);
|
94 |
+
|
95 |
+
return $this->inflectors->inflect($resolved);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* {@inheritdoc}
|
101 |
+
*/
|
102 |
+
public function has($alias)
|
103 |
+
{
|
104 |
+
if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) {
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
|
108 |
+
if ($this->providers->provides($alias)) {
|
109 |
+
return true;
|
110 |
+
}
|
111 |
+
|
112 |
+
return $this->hasInDelegate($alias);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns a boolean to determine if the container has a shared instance of an alias.
|
117 |
+
*
|
118 |
+
* @param string $alias
|
119 |
+
* @param boolean $resolved
|
120 |
+
* @return boolean
|
121 |
+
*/
|
122 |
+
public function hasShared($alias, $resolved = false)
|
123 |
+
{
|
124 |
+
$shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared;
|
125 |
+
|
126 |
+
return (array_key_exists($alias, $shared));
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* {@inheritdoc}
|
131 |
+
*/
|
132 |
+
public function add($alias, $concrete = null, $share = false)
|
133 |
+
{
|
134 |
+
unset($this->shared[$alias]);
|
135 |
+
unset($this->definitions[$alias]);
|
136 |
+
unset($this->sharedDefinitions[$alias]);
|
137 |
+
|
138 |
+
if (is_null($concrete)) {
|
139 |
+
$concrete = $alias;
|
140 |
+
}
|
141 |
+
|
142 |
+
$definition = $this->definitionFactory->getDefinition($alias, $concrete);
|
143 |
+
|
144 |
+
if ($definition instanceof DefinitionInterface) {
|
145 |
+
if ($share === false) {
|
146 |
+
$this->definitions[$alias] = $definition;
|
147 |
+
} else {
|
148 |
+
$this->sharedDefinitions[$alias] = $definition;
|
149 |
+
}
|
150 |
+
|
151 |
+
return $definition;
|
152 |
+
}
|
153 |
+
|
154 |
+
// dealing with a value that cannot build a definition
|
155 |
+
$this->shared[$alias] = $concrete;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* {@inheritdoc}
|
160 |
+
*/
|
161 |
+
public function share($alias, $concrete = null)
|
162 |
+
{
|
163 |
+
return $this->add($alias, $concrete, true);
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* {@inheritdoc}
|
168 |
+
*/
|
169 |
+
public function addServiceProvider($provider)
|
170 |
+
{
|
171 |
+
$this->providers->add($provider);
|
172 |
+
|
173 |
+
return $this;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* {@inheritdoc}
|
178 |
+
*/
|
179 |
+
public function extend($alias)
|
180 |
+
{
|
181 |
+
if ($this->providers->provides($alias)) {
|
182 |
+
$this->providers->register($alias);
|
183 |
+
}
|
184 |
+
|
185 |
+
if (array_key_exists($alias, $this->definitions)) {
|
186 |
+
return $this->definitions[$alias];
|
187 |
+
}
|
188 |
+
|
189 |
+
if (array_key_exists($alias, $this->sharedDefinitions)) {
|
190 |
+
return $this->sharedDefinitions[$alias];
|
191 |
+
}
|
192 |
+
|
193 |
+
throw new NotFoundException(
|
194 |
+
sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias)
|
195 |
+
);
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* {@inheritdoc}
|
200 |
+
*/
|
201 |
+
public function inflector($type, callable $callback = null)
|
202 |
+
{
|
203 |
+
return $this->inflectors->add($type, $callback);
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* {@inheritdoc}
|
208 |
+
*/
|
209 |
+
public function call(callable $callable, array $args = [])
|
210 |
+
{
|
211 |
+
return (new ReflectionContainer)->setContainer($this)->call($callable, $args);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Delegate a backup container to be checked for services if it
|
216 |
+
* cannot be resolved via this container.
|
217 |
+
*
|
218 |
+
* @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
|
219 |
+
* @return $this
|
220 |
+
*/
|
221 |
+
public function delegate(InteropContainerInterface $container)
|
222 |
+
{
|
223 |
+
$this->delegates[] = $container;
|
224 |
+
|
225 |
+
if ($container instanceof ImmutableContainerAwareInterface) {
|
226 |
+
$container->setContainer($this);
|
227 |
+
}
|
228 |
+
|
229 |
+
return $this;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Returns true if service is registered in one of the delegated backup containers.
|
234 |
+
*
|
235 |
+
* @param string $alias
|
236 |
+
* @return boolean
|
237 |
+
*/
|
238 |
+
public function hasInDelegate($alias)
|
239 |
+
{
|
240 |
+
foreach ($this->delegates as $container) {
|
241 |
+
if ($container->has($alias)) {
|
242 |
+
return true;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
return false;
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Attempt to get a service from the stack of delegated backup containers.
|
251 |
+
*
|
252 |
+
* @param string $alias
|
253 |
+
* @param array $args
|
254 |
+
* @return mixed
|
255 |
+
*/
|
256 |
+
protected function getFromDelegate($alias, array $args = [])
|
257 |
+
{
|
258 |
+
foreach ($this->delegates as $container) {
|
259 |
+
if ($container->has($alias)) {
|
260 |
+
return $container->get($alias, $args);
|
261 |
+
}
|
262 |
+
|
263 |
+
continue;
|
264 |
+
}
|
265 |
+
|
266 |
+
throw new NotFoundException(
|
267 |
+
sprintf('Alias (%s) is not being managed by the container', $alias)
|
268 |
+
);
|
269 |
+
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Get a service that has been registered in this container.
|
274 |
+
*
|
275 |
+
* @param string $alias
|
276 |
+
* @param array $args
|
277 |
+
* @return mixed
|
278 |
+
*/
|
279 |
+
protected function getFromThisContainer($alias, array $args = [])
|
280 |
+
{
|
281 |
+
if ($this->hasShared($alias, true)) {
|
282 |
+
$shared = $this->inflectors->inflect($this->shared[$alias]);
|
283 |
+
if ($shared instanceof RawArgumentInterface) {
|
284 |
+
return $shared->getValue();
|
285 |
+
}
|
286 |
+
return $shared;
|
287 |
+
}
|
288 |
+
|
289 |
+
if (array_key_exists($alias, $this->sharedDefinitions)) {
|
290 |
+
$shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build());
|
291 |
+
$this->shared[$alias] = $shared;
|
292 |
+
return $shared;
|
293 |
+
}
|
294 |
+
|
295 |
+
if (array_key_exists($alias, $this->definitions)) {
|
296 |
+
return $this->inflectors->inflect(
|
297 |
+
$this->definitions[$alias]->build($args)
|
298 |
+
);
|
299 |
+
}
|
300 |
+
|
301 |
+
throw new NotFoundException(
|
302 |
+
sprintf('Alias (%s) is not being managed by the container', $alias)
|
303 |
+
);
|
304 |
+
}
|
305 |
+
}
|
src/Dependencies/League/Container/ContainerAwareInterface.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
interface ContainerAwareInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Set a container
|
9 |
+
*
|
10 |
+
* @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
|
11 |
+
*/
|
12 |
+
public function setContainer(ContainerInterface $container);
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get the container
|
16 |
+
*
|
17 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
|
18 |
+
*/
|
19 |
+
public function getContainer();
|
20 |
+
}
|
src/Dependencies/League/Container/ContainerAwareTrait.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
trait ContainerAwareTrait
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @var \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
|
9 |
+
*/
|
10 |
+
protected $container;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Set a container.
|
14 |
+
*
|
15 |
+
* @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
|
16 |
+
* @return $this
|
17 |
+
*/
|
18 |
+
public function setContainer(ContainerInterface $container)
|
19 |
+
{
|
20 |
+
$this->container = $container;
|
21 |
+
|
22 |
+
return $this;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Get the container.
|
27 |
+
*
|
28 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
|
29 |
+
*/
|
30 |
+
public function getContainer()
|
31 |
+
{
|
32 |
+
return $this->container;
|
33 |
+
}
|
34 |
+
}
|
src/Dependencies/League/Container/ContainerInterface.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
interface ContainerInterface extends ImmutableContainerInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Add an item to the container.
|
9 |
+
*
|
10 |
+
* @param string $alias
|
11 |
+
* @param mixed|null $concrete
|
12 |
+
* @param boolean $share
|
13 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
|
14 |
+
*/
|
15 |
+
public function add($alias, $concrete = null, $share = false);
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Convenience method to add an item to the container as a shared item.
|
19 |
+
*
|
20 |
+
* @param string $alias
|
21 |
+
* @param mixed|null $concrete
|
22 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
|
23 |
+
*/
|
24 |
+
public function share($alias, $concrete = null);
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Add a service provider to the container.
|
28 |
+
*
|
29 |
+
* @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
|
30 |
+
* @return void
|
31 |
+
*/
|
32 |
+
public function addServiceProvider($provider);
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns a definition of an item to be extended.
|
36 |
+
*
|
37 |
+
* @param string $alias
|
38 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
|
39 |
+
*/
|
40 |
+
public function extend($alias);
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Allows for manipulation of specific types on resolution.
|
44 |
+
*
|
45 |
+
* @param string $type
|
46 |
+
* @param callable|null $callback
|
47 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector|void
|
48 |
+
*/
|
49 |
+
public function inflector($type, callable $callback = null);
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Invoke a callable via the container.
|
53 |
+
*
|
54 |
+
* @param callable $callable
|
55 |
+
* @param array $args
|
56 |
+
* @return mixed
|
57 |
+
*/
|
58 |
+
public function call(callable $callable, array $args = []);
|
59 |
+
}
|
src/Dependencies/League/Container/Definition/AbstractDefinition.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
|
7 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
|
8 |
+
|
9 |
+
abstract class AbstractDefinition implements ArgumentResolverInterface, DefinitionInterface
|
10 |
+
{
|
11 |
+
use ArgumentResolverTrait;
|
12 |
+
use ImmutableContainerAwareTrait;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
protected $alias;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var mixed
|
21 |
+
*/
|
22 |
+
protected $concrete;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
+
protected $arguments = [];
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Constructor.
|
31 |
+
*
|
32 |
+
* @param string $alias
|
33 |
+
* @param mixed $concrete
|
34 |
+
*/
|
35 |
+
public function __construct($alias, $concrete)
|
36 |
+
{
|
37 |
+
$this->alias = $alias;
|
38 |
+
$this->concrete = $concrete;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* {@inheritdoc}
|
43 |
+
*/
|
44 |
+
public function withArgument($arg)
|
45 |
+
{
|
46 |
+
$this->arguments[] = $arg;
|
47 |
+
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* {@inheritdoc}
|
53 |
+
*/
|
54 |
+
public function withArguments(array $args)
|
55 |
+
{
|
56 |
+
foreach ($args as $arg) {
|
57 |
+
$this->withArgument($arg);
|
58 |
+
}
|
59 |
+
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
}
|
src/Dependencies/League/Container/Definition/CallableDefinition.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
class CallableDefinition extends AbstractDefinition
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* {@inheritdoc}
|
9 |
+
*/
|
10 |
+
public function build(array $args = [])
|
11 |
+
{
|
12 |
+
$args = (empty($args)) ? $this->arguments : $args;
|
13 |
+
$resolved = $this->resolveArguments($args);
|
14 |
+
|
15 |
+
if (is_array($this->concrete) && is_string($this->concrete[0])) {
|
16 |
+
$this->concrete[0] = ($this->getContainer()->has($this->concrete[0]))
|
17 |
+
? $this->getContainer()->get($this->concrete[0])
|
18 |
+
: $this->concrete[0];
|
19 |
+
}
|
20 |
+
|
21 |
+
return call_user_func_array($this->concrete, $resolved);
|
22 |
+
}
|
23 |
+
}
|
src/Dependencies/League/Container/Definition/ClassDefinition.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
use ReflectionClass;
|
6 |
+
|
7 |
+
class ClassDefinition extends AbstractDefinition implements ClassDefinitionInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var array
|
11 |
+
*/
|
12 |
+
protected $methods = [];
|
13 |
+
|
14 |
+
/**
|
15 |
+
* {@inheritdoc}
|
16 |
+
*/
|
17 |
+
public function withMethodCall($method, array $args = [])
|
18 |
+
{
|
19 |
+
$this->methods[] = [
|
20 |
+
'method' => $method,
|
21 |
+
'arguments' => $args
|
22 |
+
];
|
23 |
+
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritdoc}
|
29 |
+
*/
|
30 |
+
public function withMethodCalls(array $methods = [])
|
31 |
+
{
|
32 |
+
foreach ($methods as $method => $args) {
|
33 |
+
$this->withMethodCall($method, $args);
|
34 |
+
}
|
35 |
+
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* {@inheritdoc}
|
41 |
+
*/
|
42 |
+
public function build(array $args = [])
|
43 |
+
{
|
44 |
+
$args = (empty($args)) ? $this->arguments : $args;
|
45 |
+
$resolved = $this->resolveArguments($args);
|
46 |
+
$reflection = new ReflectionClass($this->concrete);
|
47 |
+
$instance = $reflection->newInstanceArgs($resolved);
|
48 |
+
|
49 |
+
return $this->invokeMethods($instance);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Invoke methods on resolved instance.
|
54 |
+
*
|
55 |
+
* @param object $instance
|
56 |
+
* @return object
|
57 |
+
*/
|
58 |
+
protected function invokeMethods($instance)
|
59 |
+
{
|
60 |
+
foreach ($this->methods as $method) {
|
61 |
+
$args = $this->resolveArguments($method['arguments']);
|
62 |
+
call_user_func_array([$instance, $method['method']], $args);
|
63 |
+
}
|
64 |
+
|
65 |
+
return $instance;
|
66 |
+
}
|
67 |
+
}
|
src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
interface ClassDefinitionInterface extends DefinitionInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Add a method to be invoked
|
9 |
+
*
|
10 |
+
* @param string $method
|
11 |
+
* @param array $args
|
12 |
+
* @return $this
|
13 |
+
*/
|
14 |
+
public function withMethodCall($method, array $args = []);
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Add multiple methods to be invoked
|
18 |
+
*
|
19 |
+
* @param array $methods
|
20 |
+
* @return $this
|
21 |
+
*/
|
22 |
+
public function withMethodCalls(array $methods = []);
|
23 |
+
}
|
src/Dependencies/League/Container/Definition/DefinitionFactory.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
|
6 |
+
|
7 |
+
class DefinitionFactory implements DefinitionFactoryInterface
|
8 |
+
{
|
9 |
+
use ImmutableContainerAwareTrait;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* {@inheritdoc}
|
13 |
+
*/
|
14 |
+
public function getDefinition($alias, $concrete)
|
15 |
+
{
|
16 |
+
if (is_callable($concrete)) {
|
17 |
+
return (new CallableDefinition($alias, $concrete))->setContainer($this->getContainer());
|
18 |
+
}
|
19 |
+
|
20 |
+
if (is_string($concrete) && class_exists($concrete)) {
|
21 |
+
return (new ClassDefinition($alias, $concrete))->setContainer($this->getContainer());
|
22 |
+
}
|
23 |
+
|
24 |
+
// if the item is not definable we just return the value to be stored
|
25 |
+
// in the container as an arbitrary value/instance
|
26 |
+
return $concrete;
|
27 |
+
}
|
28 |
+
}
|
src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
|
6 |
+
|
7 |
+
interface DefinitionFactoryInterface extends ImmutableContainerAwareInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Return a definition based on type of concrete.
|
11 |
+
*
|
12 |
+
* @param string $alias
|
13 |
+
* @param mixed $concrete
|
14 |
+
* @return mixed
|
15 |
+
*/
|
16 |
+
public function getDefinition($alias, $concrete);
|
17 |
+
}
|
src/Dependencies/League/Container/Definition/DefinitionInterface.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
|
4 |
+
|
5 |
+
interface DefinitionInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Handle instantiation and manipulation of value and return.
|
9 |
+
*
|
10 |
+
* @param array $args
|
11 |
+
* @return mixed
|
12 |
+
*/
|
13 |
+
public function build(array $args = []);
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Add an argument to be injected.
|
17 |
+
*
|
18 |
+
* @param mixed $arg
|
19 |
+
* @return $this
|
20 |
+
*/
|
21 |
+
public function withArgument($arg);
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Add multiple arguments to be injected.
|
25 |
+
*
|
26 |
+
* @param array $args
|
27 |
+
* @return $this
|
28 |
+
*/
|
29 |
+
public function withArguments(array $args);
|
30 |
+
}
|
src/Dependencies/League/Container/Exception/NotFoundException.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Exception;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface;
|
6 |
+
use InvalidArgumentException;
|
7 |
+
|
8 |
+
class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
|
9 |
+
{
|
10 |
+
}
|
src/Dependencies/League/Container/ImmutableContainerAwareInterface.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
+
|
7 |
+
interface ImmutableContainerAwareInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Set a container
|
11 |
+
*
|
12 |
+
* @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
|
13 |
+
*/
|
14 |
+
public function setContainer(InteropContainerInterface $container);
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get the container
|
18 |
+
*
|
19 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
|
20 |
+
*/
|
21 |
+
public function getContainer();
|
22 |
+
}
|
src/Dependencies/League/Container/ImmutableContainerAwareTrait.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
+
|
7 |
+
trait ImmutableContainerAwareTrait
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface
|
11 |
+
*/
|
12 |
+
protected $container;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Set a container.
|
16 |
+
*
|
17 |
+
* @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
|
18 |
+
* @return $this
|
19 |
+
*/
|
20 |
+
public function setContainer(InteropContainerInterface $container)
|
21 |
+
{
|
22 |
+
$this->container = $container;
|
23 |
+
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get the container.
|
29 |
+
*
|
30 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
|
31 |
+
*/
|
32 |
+
public function getContainer()
|
33 |
+
{
|
34 |
+
return $this->container;
|
35 |
+
}
|
36 |
+
}
|
src/Dependencies/League/Container/ImmutableContainerInterface.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
+
|
7 |
+
interface ImmutableContainerInterface extends InteropContainerInterface
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
src/Dependencies/League/Container/Inflector/Inflector.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
|
7 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
|
8 |
+
|
9 |
+
class Inflector implements ArgumentResolverInterface
|
10 |
+
{
|
11 |
+
use ArgumentResolverTrait;
|
12 |
+
use ImmutableContainerAwareTrait;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var array
|
16 |
+
*/
|
17 |
+
protected $methods = [];
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var array
|
21 |
+
*/
|
22 |
+
protected $properties = [];
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Defines a method to be invoked on the subject object.
|
26 |
+
*
|
27 |
+
* @param string $name
|
28 |
+
* @param array $args
|
29 |
+
* @return $this
|
30 |
+
*/
|
31 |
+
public function invokeMethod($name, array $args)
|
32 |
+
{
|
33 |
+
$this->methods[$name] = $args;
|
34 |
+
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Defines multiple methods to be invoked on the subject object.
|
40 |
+
*
|
41 |
+
* @param array $methods
|
42 |
+
* @return $this
|
43 |
+
*/
|
44 |
+
public function invokeMethods(array $methods)
|
45 |
+
{
|
46 |
+
foreach ($methods as $name => $args) {
|
47 |
+
$this->invokeMethod($name, $args);
|
48 |
+
}
|
49 |
+
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Defines a property to be set on the subject object.
|
55 |
+
*
|
56 |
+
* @param string $property
|
57 |
+
* @param mixed $value
|
58 |
+
* @return $this
|
59 |
+
*/
|
60 |
+
public function setProperty($property, $value)
|
61 |
+
{
|
62 |
+
$this->properties[$property] = $value;
|
63 |
+
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Defines multiple properties to be set on the subject object.
|
69 |
+
*
|
70 |
+
* @param array $properties
|
71 |
+
* @return $this
|
72 |
+
*/
|
73 |
+
public function setProperties(array $properties)
|
74 |
+
{
|
75 |
+
foreach ($properties as $property => $value) {
|
76 |
+
$this->setProperty($property, $value);
|
77 |
+
}
|
78 |
+
|
79 |
+
return $this;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Apply inflections to an object.
|
84 |
+
*
|
85 |
+
* @param object $object
|
86 |
+
* @return void
|
87 |
+
*/
|
88 |
+
public function inflect($object)
|
89 |
+
{
|
90 |
+
$properties = $this->resolveArguments(array_values($this->properties));
|
91 |
+
$properties = array_combine(array_keys($this->properties), $properties);
|
92 |
+
|
93 |
+
foreach ($properties as $property => $value) {
|
94 |
+
$object->{$property} = $value;
|
95 |
+
}
|
96 |
+
|
97 |
+
foreach ($this->methods as $method => $args) {
|
98 |
+
$args = $this->resolveArguments($args);
|
99 |
+
|
100 |
+
call_user_func_array([$object, $method], $args);
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
src/Dependencies/League/Container/Inflector/InflectorAggregate.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
|
6 |
+
|
7 |
+
class InflectorAggregate implements InflectorAggregateInterface
|
8 |
+
{
|
9 |
+
use ImmutableContainerAwareTrait;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $inflectors = [];
|
15 |
+
|
16 |
+
/**
|
17 |
+
* {@inheritdoc}
|
18 |
+
*/
|
19 |
+
public function add($type, callable $callback = null)
|
20 |
+
{
|
21 |
+
if (is_null($callback)) {
|
22 |
+
$inflector = new Inflector;
|
23 |
+
$this->inflectors[$type] = $inflector;
|
24 |
+
|
25 |
+
return $inflector;
|
26 |
+
}
|
27 |
+
|
28 |
+
$this->inflectors[$type] = $callback;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
public function inflect($object)
|
35 |
+
{
|
36 |
+
foreach ($this->inflectors as $type => $inflector) {
|
37 |
+
if (! $object instanceof $type) {
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
|
41 |
+
if ($inflector instanceof Inflector) {
|
42 |
+
$inflector->setContainer($this->getContainer());
|
43 |
+
$inflector->inflect($object);
|
44 |
+
continue;
|
45 |
+
}
|
46 |
+
|
47 |
+
// must be dealing with a callable as the inflector
|
48 |
+
call_user_func_array($inflector, [$object]);
|
49 |
+
}
|
50 |
+
|
51 |
+
return $object;
|
52 |
+
}
|
53 |
+
}
|
src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
|
6 |
+
|
7 |
+
interface InflectorAggregateInterface extends ImmutableContainerAwareInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Add an inflector to the aggregate.
|
11 |
+
*
|
12 |
+
* @param string $type
|
13 |
+
* @param callable $callback
|
14 |
+
* @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector
|
15 |
+
*/
|
16 |
+
public function add($type, callable $callback = null);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Applies all inflectors to an object.
|
20 |
+
*
|
21 |
+
* @param object $object
|
22 |
+
* @return object
|
23 |
+
*/
|
24 |
+
public function inflect($object);
|
25 |
+
}
|
src/Dependencies/League/Container/ReflectionContainer.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
|
7 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
|
8 |
+
use ReflectionClass;
|
9 |
+
use ReflectionFunction;
|
10 |
+
use ReflectionMethod;
|
11 |
+
|
12 |
+
class ReflectionContainer implements
|
13 |
+
ArgumentResolverInterface,
|
14 |
+
ImmutableContainerInterface
|
15 |
+
{
|
16 |
+
use ArgumentResolverTrait;
|
17 |
+
use ImmutableContainerAwareTrait;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* {@inheritdoc}
|
21 |
+
*/
|
22 |
+
public function get($alias, array $args = [])
|
23 |
+
{
|
24 |
+
if (! $this->has($alias)) {
|
25 |
+
throw new NotFoundException(
|
26 |
+
sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias)
|
27 |
+
);
|
28 |
+
}
|
29 |
+
|
30 |
+
$reflector = new ReflectionClass($alias);
|
31 |
+
$construct = $reflector->getConstructor();
|
32 |
+
|
33 |
+
if ($construct === null) {
|
34 |
+
return new $alias;
|
35 |
+
}
|
36 |
+
|
37 |
+
return $reflector->newInstanceArgs(
|
38 |
+
$this->reflectArguments($construct, $args)
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* {@inheritdoc}
|
44 |
+
*/
|
45 |
+
public function has($alias)
|
46 |
+
{
|
47 |
+
return class_exists($alias);
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Invoke a callable via the container.
|
52 |
+
*
|
53 |
+
* @param callable $callable
|
54 |
+
* @param array $args
|
55 |
+
* @return mixed
|
56 |
+
*/
|
57 |
+
public function call(callable $callable, array $args = [])
|
58 |
+
{
|
59 |
+
if (is_string($callable) && strpos($callable, '::') !== false) {
|
60 |
+
$callable = explode('::', $callable);
|
61 |
+
}
|
62 |
+
|
63 |
+
if (is_array($callable)) {
|
64 |
+
if (is_string($callable[0])) {
|
65 |
+
$callable[0] = $this->getContainer()->get($callable[0]);
|
66 |
+
}
|
67 |
+
|
68 |
+
$reflection = new ReflectionMethod($callable[0], $callable[1]);
|
69 |
+
|
70 |
+
if ($reflection->isStatic()) {
|
71 |
+
$callable[0] = null;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
|
75 |
+
}
|
76 |
+
|
77 |
+
if (is_object($callable)) {
|
78 |
+
$reflection = new ReflectionMethod($callable, '__invoke');
|
79 |
+
|
80 |
+
return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
|
81 |
+
}
|
82 |
+
|
83 |
+
$reflection = new ReflectionFunction($callable);
|
84 |
+
|
85 |
+
return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
|
86 |
+
}
|
87 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
|
6 |
+
|
7 |
+
abstract class AbstractServiceProvider implements ServiceProviderInterface
|
8 |
+
{
|
9 |
+
use ContainerAwareTrait;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $provides = [];
|
15 |
+
|
16 |
+
/**
|
17 |
+
* {@inheritdoc}
|
18 |
+
*/
|
19 |
+
public function provides($alias = null)
|
20 |
+
{
|
21 |
+
if (! is_null($alias)) {
|
22 |
+
return (in_array($alias, $this->provides));
|
23 |
+
}
|
24 |
+
|
25 |
+
return $this->provides;
|
26 |
+
}
|
27 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
abstract class AbstractSignatureServiceProvider
|
6 |
+
extends AbstractServiceProvider
|
7 |
+
implements SignatureServiceProviderInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var string
|
11 |
+
*/
|
12 |
+
protected $signature;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* {@inheritdoc}
|
16 |
+
*/
|
17 |
+
public function withSignature($signature)
|
18 |
+
{
|
19 |
+
$this->signature = $signature;
|
20 |
+
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* {@inheritdoc}
|
26 |
+
*/
|
27 |
+
public function getSignature()
|
28 |
+
{
|
29 |
+
return (is_null($this->signature)) ? get_class($this) : $this->signature;
|
30 |
+
}
|
31 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
interface BootableServiceProviderInterface extends ServiceProviderInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Method will be invoked on registration of a service provider implementing
|
9 |
+
* this interface. Provides ability for eager loading of Service Providers.
|
10 |
+
*
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public function boot();
|
14 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
|
6 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
|
7 |
+
|
8 |
+
class ServiceProviderAggregate implements ServiceProviderAggregateInterface
|
9 |
+
{
|
10 |
+
use ContainerAwareTrait;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var array
|
14 |
+
*/
|
15 |
+
protected $providers = [];
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
protected $registered = [];
|
21 |
+
|
22 |
+
/**
|
23 |
+
* {@inheritdoc}
|
24 |
+
*/
|
25 |
+
public function add($provider)
|
26 |
+
{
|
27 |
+
if (is_string($provider) && class_exists($provider)) {
|
28 |
+
$provider = new $provider;
|
29 |
+
}
|
30 |
+
|
31 |
+
if ($provider instanceof ContainerAwareInterface) {
|
32 |
+
$provider->setContainer($this->getContainer());
|
33 |
+
}
|
34 |
+
|
35 |
+
if ($provider instanceof BootableServiceProviderInterface) {
|
36 |
+
$provider->boot();
|
37 |
+
}
|
38 |
+
|
39 |
+
if ($provider instanceof ServiceProviderInterface) {
|
40 |
+
foreach ($provider->provides() as $service) {
|
41 |
+
$this->providers[$service] = $provider;
|
42 |
+
}
|
43 |
+
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
throw new \InvalidArgumentException(
|
48 |
+
'A service provider must be a fully qualified class name or instance ' .
|
49 |
+
'of (\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface)'
|
50 |
+
);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* {@inheritdoc}
|
55 |
+
*/
|
56 |
+
public function provides($service)
|
57 |
+
{
|
58 |
+
return array_key_exists($service, $this->providers);
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* {@inheritdoc}
|
63 |
+
*/
|
64 |
+
public function register($service)
|
65 |
+
{
|
66 |
+
if (! array_key_exists($service, $this->providers)) {
|
67 |
+
throw new \InvalidArgumentException(
|
68 |
+
sprintf('(%s) is not provided by a service provider', $service)
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
$provider = $this->providers[$service];
|
73 |
+
$signature = get_class($provider);
|
74 |
+
|
75 |
+
if ($provider instanceof SignatureServiceProviderInterface) {
|
76 |
+
$signature = $provider->getSignature();
|
77 |
+
}
|
78 |
+
|
79 |
+
// ensure that the provider hasn't already been invoked by any other service request
|
80 |
+
if (in_array($signature, $this->registered)) {
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
$provider->register();
|
85 |
+
|
86 |
+
$this->registered[] = $signature;
|
87 |
+
}
|
88 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
|
6 |
+
|
7 |
+
interface ServiceProviderAggregateInterface extends ContainerAwareInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Add a service provider to the aggregate.
|
11 |
+
*
|
12 |
+
* @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
|
13 |
+
* @return $this
|
14 |
+
*/
|
15 |
+
public function add($provider);
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Determines whether a service is provided by the aggregate.
|
19 |
+
*
|
20 |
+
* @param string $service
|
21 |
+
* @return boolean
|
22 |
+
*/
|
23 |
+
public function provides($service);
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Invokes the register method of a provider that provides a specific service.
|
27 |
+
*
|
28 |
+
* @param string $service
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
public function register($service);
|
32 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
|
6 |
+
|
7 |
+
interface ServiceProviderInterface extends ContainerAwareInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Returns a boolean if checking whether this provider provides a specific
|
11 |
+
* service or returns an array of provided services if no argument passed.
|
12 |
+
*
|
13 |
+
* @param string $service
|
14 |
+
* @return boolean|array
|
15 |
+
*/
|
16 |
+
public function provides($service = null);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Use the register method to register items with the container via the
|
20 |
+
* protected $this->container property or the `getContainer` method
|
21 |
+
* from the ContainerAwareTrait.
|
22 |
+
*
|
23 |
+
* @return void
|
24 |
+
*/
|
25 |
+
public function register();
|
26 |
+
}
|
src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
|
4 |
+
|
5 |
+
interface SignatureServiceProviderInterface
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Set a custom signature for the service provider. This enables
|
9 |
+
* registering the same service provider multiple times.
|
10 |
+
*
|
11 |
+
* @param string $signature
|
12 |
+
* @return self
|
13 |
+
*/
|
14 |
+
public function withSignature($signature);
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The signature of the service provider uniquely identifies it, so
|
18 |
+
* that we can quickly determine if it has already been registered.
|
19 |
+
* Defaults to get_class($provider).
|
20 |
+
*
|
21 |
+
* @return string
|
22 |
+
*/
|
23 |
+
public function getSignature();
|
24 |
+
}
|
src/Dependencies/Psr/Container/ContainerExceptionInterface.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Base interface representing a generic exception in a container.
|
10 |
+
*/
|
11 |
+
interface ContainerExceptionInterface
|
12 |
+
{
|
13 |
+
}
|
src/Dependencies/Psr/Container/ContainerInterface.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Describes the interface of a container that exposes methods to read its entries.
|
10 |
+
*/
|
11 |
+
interface ContainerInterface
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Finds an entry of the container by its identifier and returns it.
|
15 |
+
*
|
16 |
+
* @param string $id Identifier of the entry to look for.
|
17 |
+
*
|
18 |
+
* @throws NotFoundExceptionInterface No entry was found for **this** identifier.
|
19 |
+
* @throws ContainerExceptionInterface Error while retrieving the entry.
|
20 |
+
*
|
21 |
+
* @return mixed Entry.
|
22 |
+
*/
|
23 |
+
public function get($id);
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Returns true if the container can return an entry for the given identifier.
|
27 |
+
* Returns false otherwise.
|
28 |
+
*
|
29 |
+
* `has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
30 |
+
* It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
|
31 |
+
*
|
32 |
+
* @param string $id Identifier of the entry to look for.
|
33 |
+
*
|
34 |
+
* @return bool
|
35 |
+
*/
|
36 |
+
public function has($id);
|
37 |
+
}
|
src/Dependencies/Psr/Container/NotFoundExceptionInterface.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* No entry was found in the container.
|
10 |
+
*/
|
11 |
+
interface NotFoundExceptionInterface extends ContainerExceptionInterface
|
12 |
+
{
|
13 |
+
}
|
src/Dependencies/RocketLazyload/Assets.php
ADDED
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handle the lazyload required assets: inline CSS and JS
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class containing the methods to return or print the assets needed for lazyloading
|
12 |
+
*/
|
13 |
+
class Assets
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Inserts the lazyload script in the HTML
|
17 |
+
*
|
18 |
+
* @param array $args Array of arguments to populate the lazyload script tag.
|
19 |
+
* @return void
|
20 |
+
*/
|
21 |
+
public function insertLazyloadScript($args = [])
|
22 |
+
{
|
23 |
+
echo $this->getLazyloadScript($args);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Gets the inline lazyload script configuration
|
28 |
+
*
|
29 |
+
* @param array $args Array of arguments to populate the lazyload script options.
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getInlineLazyloadScript($args = [])
|
33 |
+
{
|
34 |
+
$defaults = [
|
35 |
+
'elements' => [
|
36 |
+
'img',
|
37 |
+
'iframe',
|
38 |
+
],
|
39 |
+
'threshold' => 300,
|
40 |
+
'options' => [],
|
41 |
+
];
|
42 |
+
|
43 |
+
$allowed_options = [
|
44 |
+
'container' => 1,
|
45 |
+
'thresholds' => 1,
|
46 |
+
'data_bg' => 1,
|
47 |
+
'class_error' => 1,
|
48 |
+
'load_delay' => 1,
|
49 |
+
'auto_unobserve' => 1,
|
50 |
+
'callback_enter' => 1,
|
51 |
+
'callback_exit' => 1,
|
52 |
+
'callback_reveal' => 1,
|
53 |
+
'callback_error' => 1,
|
54 |
+
'callback_finish' => 1,
|
55 |
+
'use_native' => 1,
|
56 |
+
];
|
57 |
+
|
58 |
+
$args = wp_parse_args($args, $defaults);
|
59 |
+
$script = '';
|
60 |
+
|
61 |
+
$args['options'] = array_intersect_key($args['options'], $allowed_options);
|
62 |
+
|
63 |
+
$script .= 'window.lazyLoadOptions = {
|
64 |
+
elements_selector: "' . esc_attr(implode(',', $args['elements'])) . '",
|
65 |
+
data_src: "lazy-src",
|
66 |
+
data_srcset: "lazy-srcset",
|
67 |
+
data_sizes: "lazy-sizes",
|
68 |
+
class_loading: "lazyloading",
|
69 |
+
class_loaded: "lazyloaded",
|
70 |
+
threshold: ' . esc_attr($args['threshold']) . ',
|
71 |
+
callback_loaded: function(element) {
|
72 |
+
if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
|
73 |
+
if (element.classList.contains("lazyloaded") ) {
|
74 |
+
if (typeof window.jQuery != "undefined") {
|
75 |
+
if (jQuery.fn.fitVids) {
|
76 |
+
jQuery(element).parent().fitVids();
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}';
|
82 |
+
|
83 |
+
if (! empty($args['options'])) {
|
84 |
+
$script .= ',' . PHP_EOL;
|
85 |
+
|
86 |
+
foreach ($args['options'] as $option => $value) {
|
87 |
+
$script .= $option . ': ' . $value . ',';
|
88 |
+
}
|
89 |
+
|
90 |
+
$script = rtrim($script, ',');
|
91 |
+
}
|
92 |
+
|
93 |
+
$script .= '};';
|
94 |
+
|
95 |
+
$script .= '
|
96 |
+
window.addEventListener(\'LazyLoad::Initialized\', function (e) {
|
97 |
+
var lazyLoadInstance = e.detail.instance;
|
98 |
+
|
99 |
+
if (window.MutationObserver) {
|
100 |
+
var observer = new MutationObserver(function(mutations) {
|
101 |
+
var image_count = 0;
|
102 |
+
var iframe_count = 0;
|
103 |
+
var rocketlazy_count = 0;
|
104 |
+
|
105 |
+
mutations.forEach(function(mutation) {
|
106 |
+
for (i = 0; i < mutation.addedNodes.length; i++) {
|
107 |
+
if (typeof mutation.addedNodes[i].getElementsByTagName !== \'function\') {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
|
111 |
+
if (typeof mutation.addedNodes[i].getElementsByClassName !== \'function\') {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
images = mutation.addedNodes[i].getElementsByTagName(\'img\');
|
116 |
+
is_image = mutation.addedNodes[i].tagName == "IMG";
|
117 |
+
iframes = mutation.addedNodes[i].getElementsByTagName(\'iframe\');
|
118 |
+
is_iframe = mutation.addedNodes[i].tagName == "IFRAME";
|
119 |
+
rocket_lazy = mutation.addedNodes[i].getElementsByClassName(\'rocket-lazyload\');
|
120 |
+
|
121 |
+
image_count += images.length;
|
122 |
+
iframe_count += iframes.length;
|
123 |
+
rocketlazy_count += rocket_lazy.length;
|
124 |
+
|
125 |
+
if(is_image){
|
126 |
+
image_count += 1;
|
127 |
+
}
|
128 |
+
|
129 |
+
if(is_iframe){
|
130 |
+
iframe_count += 1;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
} );
|
134 |
+
|
135 |
+
if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){
|
136 |
+
lazyLoadInstance.update();
|
137 |
+
}
|
138 |
+
} );
|
139 |
+
|
140 |
+
var b = document.getElementsByTagName("body")[0];
|
141 |
+
var config = { childList: true, subtree: true };
|
142 |
+
|
143 |
+
observer.observe(b, config);
|
144 |
+
}
|
145 |
+
}, false);';
|
146 |
+
|
147 |
+
return $script;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Returns the lazyload inline script
|
152 |
+
*
|
153 |
+
* @param array $args Array of arguments to populate the lazyload script options.
|
154 |
+
* @return string
|
155 |
+
*/
|
156 |
+
public function getLazyloadScript($args = [])
|
157 |
+
{
|
158 |
+
$defaults = [
|
159 |
+
'base_url' => '',
|
160 |
+
'version' => '',
|
161 |
+
'polyfill' => false,
|
162 |
+
];
|
163 |
+
|
164 |
+
$args = wp_parse_args($args, $defaults);
|
165 |
+
$min = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
|
166 |
+
$script = '';
|
167 |
+
|
168 |
+
if (isset($args['polyfill']) && $args['polyfill']) {
|
169 |
+
$script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Filters the script tag for the lazyload script
|
174 |
+
*
|
175 |
+
* @since 2.2.6
|
176 |
+
*
|
177 |
+
* @param $script_tag HTML tag for the lazyload script.
|
178 |
+
*/
|
179 |
+
$script .= apply_filters('rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>');
|
180 |
+
|
181 |
+
return $script;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Inserts in the HTML the script to replace the Youtube thumbnail by the iframe.
|
186 |
+
*
|
187 |
+
* @param array $args Array of arguments to populate the script options.
|
188 |
+
* @return void
|
189 |
+
*/
|
190 |
+
public function insertYoutubeThumbnailScript($args = [])
|
191 |
+
{
|
192 |
+
echo $this->getYoutubeThumbnailScript($args);
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Returns the Youtube Thumbnail inline script
|
197 |
+
*
|
198 |
+
* @param array $args Array of arguments to populate the script options.
|
199 |
+
* @return string
|
200 |
+
*/
|
201 |
+
public function getYoutubeThumbnailScript($args = [])
|
202 |
+
{
|
203 |
+
$defaults = [
|
204 |
+
'resolution' => 'hqdefault',
|
205 |
+
'lazy_image' => false,
|
206 |
+
];
|
207 |
+
|
208 |
+
$allowed_resolutions = [
|
209 |
+
'default' => [
|
210 |
+
'width' => 120,
|
211 |
+
'height' => 90,
|
212 |
+
],
|
213 |
+
'mqdefault' => [
|
214 |
+
'width' => 320,
|
215 |
+
'height' => 180,
|
216 |
+
],
|
217 |
+
'hqdefault' => [
|
218 |
+
'width' => 480,
|
219 |
+
'height' => 360,
|
220 |
+
],
|
221 |
+
'sddefault' => [
|
222 |
+
'width' => 640,
|
223 |
+
'height' => 480,
|
224 |
+
],
|
225 |
+
|
226 |
+
'maxresdefault' => [
|
227 |
+
'width' => 1280,
|
228 |
+
'height' => 720,
|
229 |
+
],
|
230 |
+
];
|
231 |
+
|
232 |
+
$args['resolution'] = ( isset($args['resolution']) && isset($allowed_resolutions[ $args['resolution'] ]) ) ? $args['resolution'] : 'hqdefault';
|
233 |
+
|
234 |
+
$args = wp_parse_args($args, $defaults);
|
235 |
+
|
236 |
+
$image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
|
237 |
+
|
238 |
+
if (isset($args['lazy_image']) && $args['lazy_image']) {
|
239 |
+
$image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
|
240 |
+
}
|
241 |
+
|
242 |
+
return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\”allow\”, \”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\”),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Inserts the CSS to style the Youtube thumbnail container
|
247 |
+
*
|
248 |
+
* @param array $args Array of arguments to populate the CSS.
|
249 |
+
* @return void
|
250 |
+
*/
|
251 |
+
public function insertYoutubeThumbnailCSS($args = [])
|
252 |
+
{
|
253 |
+
wp_register_style('rocket-lazyload', false);
|
254 |
+
wp_enqueue_style('rocket-lazyload');
|
255 |
+
wp_add_inline_style('rocket-lazyload', $this->getYoutubeThumbnailCSS($args));
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Returns the CSS for the Youtube Thumbnail
|
260 |
+
*
|
261 |
+
* @param array $args Array of arguments to populate the CSS.
|
262 |
+
* @return string
|
263 |
+
*/
|
264 |
+
public function getYoutubeThumbnailCSS($args = [])
|
265 |
+
{
|
266 |
+
$defaults = [
|
267 |
+
'base_url' => '',
|
268 |
+
'responsive_embeds' => true,
|
269 |
+
];
|
270 |
+
|
271 |
+
$args = wp_parse_args($args, $defaults);
|
272 |
+
|
273 |
+
$css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}';
|
274 |
+
|
275 |
+
if ($args['responsive_embeds']) {
|
276 |
+
$css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}';
|
277 |
+
}
|
278 |
+
|
279 |
+
return $css;
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Inserts the CSS needed when Javascript is not enabled to keep the display correct
|
284 |
+
*/
|
285 |
+
public function insertNoJSCSS()
|
286 |
+
{
|
287 |
+
echo $this->getNoJSCSS();
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Returns the CSS to correctly display images when JavaScript is disabled
|
292 |
+
*
|
293 |
+
* @return string
|
294 |
+
*/
|
295 |
+
public function getNoJSCSS()
|
296 |
+
{
|
297 |
+
return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
|
298 |
+
}
|
299 |
+
}
|
src/Dependencies/RocketLazyload/Iframe.php
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles lazyloading of iframes
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* A class to provide the methods needed to lazyload iframes in WP Rocket and Lazyload by WP Rocket
|
12 |
+
*/
|
13 |
+
class Iframe
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Finds iframes in the HTML provided and call the methods to lazyload them
|
17 |
+
*
|
18 |
+
* @param string $html Original HTML.
|
19 |
+
* @param string $buffer Content to parse.
|
20 |
+
* @param array $args Array of arguments to use.
|
21 |
+
* @return string
|
22 |
+
*/
|
23 |
+
public function lazyloadIframes($html, $buffer, $args = [])
|
24 |
+
{
|
25 |
+
$defaults = [
|
26 |
+
'youtube' => false,
|
27 |
+
];
|
28 |
+
|
29 |
+
$args = wp_parse_args($args, $defaults);
|
30 |
+
|
31 |
+
if (! preg_match_all('@<iframe(?<atts>\s.+)>.*</iframe>@iUs', $buffer, $iframes, PREG_SET_ORDER) ) {
|
32 |
+
return $html;
|
33 |
+
}
|
34 |
+
|
35 |
+
$iframes = array_unique($iframes, SORT_REGULAR);
|
36 |
+
|
37 |
+
foreach ($iframes as $iframe) {
|
38 |
+
if ($this->isIframeExcluded($iframe)) {
|
39 |
+
continue;
|
40 |
+
}
|
41 |
+
|
42 |
+
// Given the previous regex pattern, $iframe['atts'] starts with a whitespace character.
|
43 |
+
if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $iframe['atts'], $atts)) {
|
44 |
+
continue;
|
45 |
+
}
|
46 |
+
|
47 |
+
$iframe['src'] = trim($atts['src']);
|
48 |
+
|
49 |
+
if ('' === $iframe['src']) {
|
50 |
+
continue;
|
51 |
+
}
|
52 |
+
|
53 |
+
if ($args['youtube']) {
|
54 |
+
$iframe_lazyload = $this->replaceYoutubeThumbnail($iframe);
|
55 |
+
}
|
56 |
+
|
57 |
+
if (empty($iframe_lazyload)) {
|
58 |
+
$iframe_lazyload = $this->replaceIframe($iframe);
|
59 |
+
}
|
60 |
+
|
61 |
+
$html = str_replace($iframe[0], $iframe_lazyload, $html);
|
62 |
+
|
63 |
+
unset($iframe_lazyload);
|
64 |
+
}
|
65 |
+
|
66 |
+
return $html;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Checks if the provided iframe is excluded from lazyload
|
71 |
+
*
|
72 |
+
* @param array $iframe Array of matched patterns.
|
73 |
+
* @return boolean
|
74 |
+
*/
|
75 |
+
public function isIframeExcluded($iframe)
|
76 |
+
{
|
77 |
+
|
78 |
+
foreach ($this->getExcludedPatterns() as $excluded_pattern) {
|
79 |
+
if (strpos($iframe[0], $excluded_pattern) !== false) {
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Gets patterns excluded from lazyload for iframes
|
89 |
+
*
|
90 |
+
* @since 2.1.1
|
91 |
+
*
|
92 |
+
* @return array
|
93 |
+
*/
|
94 |
+
private function getExcludedPatterns()
|
95 |
+
{
|
96 |
+
/**
|
97 |
+
* Filters the patterns excluded from lazyload for iframes
|
98 |
+
*
|
99 |
+
* @since 2.1.1
|
100 |
+
*
|
101 |
+
* @param array $excluded_patterns Array of excluded patterns.
|
102 |
+
*/
|
103 |
+
return apply_filters(
|
104 |
+
'rocket_lazyload_iframe_excluded_patterns',
|
105 |
+
[
|
106 |
+
'gform_ajax_frame',
|
107 |
+
'data-no-lazy=',
|
108 |
+
'recaptcha/api/fallback',
|
109 |
+
'loading="eager"',
|
110 |
+
]
|
111 |
+
);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Applies lazyload on the iframe provided
|
116 |
+
*
|
117 |
+
* @param array $iframe Array of matched elements.
|
118 |
+
* @return string
|
119 |
+
*/
|
120 |
+
private function replaceIframe($iframe)
|
121 |
+
{
|
122 |
+
/**
|
123 |
+
* Filter the LazyLoad placeholder on src attribute
|
124 |
+
*
|
125 |
+
* @since 1.0
|
126 |
+
*
|
127 |
+
* @param string $placeholder placeholder that will be printed.
|
128 |
+
*/
|
129 |
+
$placeholder = apply_filters('rocket_lazyload_placeholder', 'about:blank');
|
130 |
+
|
131 |
+
$placeholder_atts = str_replace($iframe['src'], $placeholder, $iframe['atts']);
|
132 |
+
$iframe_lazyload = str_replace($iframe['atts'], $placeholder_atts . ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url($iframe['src']) . '"', $iframe[0]);
|
133 |
+
|
134 |
+
if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $iframe_lazyload)) {
|
135 |
+
$iframe_lazyload = str_replace('<iframe', '<iframe loading="lazy"', $iframe_lazyload);
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Filter the LazyLoad HTML output on iframes
|
140 |
+
*
|
141 |
+
* @since 1.0
|
142 |
+
*
|
143 |
+
* @param array $html Output that will be printed.
|
144 |
+
*/
|
145 |
+
$iframe_lazyload = apply_filters('rocket_lazyload_iframe_html', $iframe_lazyload);
|
146 |
+
$iframe_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
|
147 |
+
|
148 |
+
return $iframe_lazyload;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Replaces the iframe provided by the Youtube thumbnail
|
153 |
+
*
|
154 |
+
* @param array $iframe Array of matched elements.
|
155 |
+
* @return bool|string
|
156 |
+
*/
|
157 |
+
private function replaceYoutubeThumbnail($iframe)
|
158 |
+
{
|
159 |
+
$youtube_id = $this->getYoutubeIDFromURL($iframe['src']);
|
160 |
+
|
161 |
+
if (! $youtube_id) {
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
|
165 |
+
$query = wp_parse_url(htmlspecialchars_decode($iframe['src']), PHP_URL_QUERY);
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Filter the LazyLoad HTML output on Youtube iframes
|
169 |
+
*
|
170 |
+
* @since 2.11
|
171 |
+
*
|
172 |
+
* @param array $html Output that will be printed.
|
173 |
+
*/
|
174 |
+
$youtube_lazyload = apply_filters('rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-id="' . esc_attr($youtube_id) . '" data-query="' . esc_attr($query) . '"></div>');
|
175 |
+
$youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
|
176 |
+
|
177 |
+
return $youtube_lazyload;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Gets the Youtube ID from the URL provided
|
182 |
+
*
|
183 |
+
* @param string $url URL to search.
|
184 |
+
* @return bool|string
|
185 |
+
*/
|
186 |
+
public function getYoutubeIDFromURL($url)
|
187 |
+
{
|
188 |
+
$pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be|youtube\.com|youtube-nocookie\.com)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
|
189 |
+
$result = preg_match($pattern, $url, $matches);
|
190 |
+
|
191 |
+
if (! $result) {
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
// exclude playlist.
|
196 |
+
if ('videoseries' === $matches[1]) {
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
|
200 |
+
return $matches[1];
|
201 |
+
}
|
202 |
+
}
|
src/Dependencies/RocketLazyload/Image.php
ADDED
@@ -0,0 +1,474 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles lazyloading of images
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* A class to provide the methods needed to lazyload images in WP Rocket and Lazyload by WP Rocket
|
12 |
+
*/
|
13 |
+
class Image
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Finds the images to be lazyloaded and call the callback method to replace them.
|
17 |
+
*
|
18 |
+
* @param string $html Original HTML.
|
19 |
+
* @param string $buffer Content to parse.
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function lazyloadImages($html, $buffer)
|
23 |
+
{
|
24 |
+
if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER)) {
|
25 |
+
return $html;
|
26 |
+
}
|
27 |
+
|
28 |
+
$images = array_unique($images, SORT_REGULAR);
|
29 |
+
|
30 |
+
foreach ($images as $image) {
|
31 |
+
$image = $this->canLazyload($image);
|
32 |
+
|
33 |
+
if (! $image) {
|
34 |
+
continue;
|
35 |
+
}
|
36 |
+
|
37 |
+
$image_lazyload = $this->replaceImage($image);
|
38 |
+
$image_lazyload .= $this->noscript($image[0]);
|
39 |
+
$html = str_replace($image[0], $image_lazyload, $html);
|
40 |
+
|
41 |
+
unset($image_lazyload);
|
42 |
+
}
|
43 |
+
|
44 |
+
return $html;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Applies lazyload on background images defined in style attributes
|
49 |
+
*
|
50 |
+
* @param string $html Original HTML.
|
51 |
+
* @param string $buffer Content to parse.
|
52 |
+
* @return string
|
53 |
+
*/
|
54 |
+
public function lazyloadBackgroundImages($html, $buffer)
|
55 |
+
{
|
56 |
+
if (! preg_match_all('#<(?<tag>div|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER)) {
|
57 |
+
return $html;
|
58 |
+
}
|
59 |
+
|
60 |
+
foreach ($elements as $element) {
|
61 |
+
if ($this->isExcluded($element['before'] . $element['after'], $this->getExcludedAttributes())) {
|
62 |
+
continue;
|
63 |
+
}
|
64 |
+
|
65 |
+
if (! preg_match('#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url)) {
|
66 |
+
continue;
|
67 |
+
}
|
68 |
+
|
69 |
+
$url['url'] = trim($url['url'], '\'" ');
|
70 |
+
|
71 |
+
if ($this->isExcluded($url['url'], $this->getExcludedSrc())) {
|
72 |
+
continue;
|
73 |
+
}
|
74 |
+
|
75 |
+
$lazy_bg = $this->addLazyCLass($element[0]);
|
76 |
+
$lazy_bg = str_replace($url[0], '', $lazy_bg);
|
77 |
+
$lazy_bg = str_replace('<' . $element['tag'], '<' . $element['tag'] . ' data-bg="url(' . esc_attr($url['url']) . ')"', $lazy_bg);
|
78 |
+
|
79 |
+
$html = str_replace($element[0], $lazy_bg, $html);
|
80 |
+
unset($lazy_bg);
|
81 |
+
}
|
82 |
+
|
83 |
+
return $html;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Add the identifier class to the element
|
88 |
+
*
|
89 |
+
* @param string $element Element to add the class to.
|
90 |
+
* @return string
|
91 |
+
*/
|
92 |
+
private function addLazyClass($element)
|
93 |
+
{
|
94 |
+
if (preg_match('#class=["\']?(?<classes>[^"\'>]*)["\']?#is', $element, $class)) {
|
95 |
+
$classes = str_replace($class['classes'], $class['classes'] . ' rocket-lazyload', $class[0]);
|
96 |
+
$element = str_replace($class[0], $classes, $element);
|
97 |
+
|
98 |
+
return $element;
|
99 |
+
}
|
100 |
+
|
101 |
+
return preg_replace('#<(img|div|section|li|span)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Applies lazyload on picture elements found in the HTML.
|
106 |
+
*
|
107 |
+
* @param string $html Original HTML.
|
108 |
+
* @param string $buffer Content to parse.
|
109 |
+
* @return string
|
110 |
+
*/
|
111 |
+
public function lazyloadPictures($html, $buffer)
|
112 |
+
{
|
113 |
+
if (! preg_match_all('#<picture(?:.*)?>(?<sources>.*)</picture>#iUs', $buffer, $pictures, PREG_SET_ORDER)) {
|
114 |
+
return $html;
|
115 |
+
}
|
116 |
+
|
117 |
+
$pictures = array_unique($pictures, SORT_REGULAR);
|
118 |
+
$excluded = array_merge($this->getExcludedAttributes(), $this->getExcludedSrc());
|
119 |
+
|
120 |
+
foreach ($pictures as $picture) {
|
121 |
+
if ($this->isExcluded($picture[0], $excluded)) {
|
122 |
+
continue;
|
123 |
+
}
|
124 |
+
|
125 |
+
if (preg_match_all('#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER)) {
|
126 |
+
$sources = array_unique($sources, SORT_REGULAR);
|
127 |
+
|
128 |
+
$lazy_sources = 0;
|
129 |
+
|
130 |
+
foreach ($sources as $source) {
|
131 |
+
$lazyload_srcset = preg_replace('/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0]);
|
132 |
+
$html = str_replace($source[0], $lazyload_srcset, $html);
|
133 |
+
|
134 |
+
unset($lazyload_srcset);
|
135 |
+
$lazy_sources++;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
if (0 === $lazy_sources) {
|
140 |
+
continue;
|
141 |
+
}
|
142 |
+
|
143 |
+
if (! preg_match('#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img)) {
|
144 |
+
continue;
|
145 |
+
}
|
146 |
+
|
147 |
+
$img = $this->canLazyload($img);
|
148 |
+
|
149 |
+
if (! $img) {
|
150 |
+
continue;
|
151 |
+
}
|
152 |
+
|
153 |
+
$img_lazy = $this->replaceImage($img);
|
154 |
+
$html = str_replace($img[0], $img_lazy, $html);
|
155 |
+
|
156 |
+
unset($img_lazy);
|
157 |
+
}
|
158 |
+
|
159 |
+
return $html;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Checks if the image can be lazyloaded
|
164 |
+
*
|
165 |
+
* @param Array $image Array of image data coming from Regex.
|
166 |
+
* @return bool|Array
|
167 |
+
*/
|
168 |
+
private function canLazyload($image)
|
169 |
+
{
|
170 |
+
if ($this->isExcluded($image['atts'], $this->getExcludedAttributes())) {
|
171 |
+
return false;
|
172 |
+
}
|
173 |
+
|
174 |
+
// Given the previous regex pattern, $image['atts'] starts with a whitespace character.
|
175 |
+
if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $image['atts'], $atts)) {
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
|
179 |
+
$image['src'] = trim($atts['src']);
|
180 |
+
|
181 |
+
if ('' === $image['src']) {
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
if ($this->isExcluded($image['src'], $this->getExcludedSrc())) {
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
|
189 |
+
// Don't apply LazyLoad on images from WP Retina x2.
|
190 |
+
if (function_exists('wr2x_picture_rewrite')) {
|
191 |
+
if (wr2x_get_retina(trailingslashit(ABSPATH) . wr2x_get_pathinfo_from_image_src(trim($image['src'], '"')))) {
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
return $image;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Checks if the provided string matches with the provided excluded patterns
|
201 |
+
*
|
202 |
+
* @param string $string String to check.
|
203 |
+
* @param array $excluded_values Patterns to match against.
|
204 |
+
* @return boolean
|
205 |
+
*/
|
206 |
+
public function isExcluded($string, $excluded_values)
|
207 |
+
{
|
208 |
+
if (! is_array($excluded_values)) {
|
209 |
+
(array) $excluded_values;
|
210 |
+
}
|
211 |
+
|
212 |
+
if (empty($excluded_values)) {
|
213 |
+
return false;
|
214 |
+
}
|
215 |
+
|
216 |
+
foreach ($excluded_values as $excluded_value) {
|
217 |
+
if (strpos($string, $excluded_value) !== false) {
|
218 |
+
return true;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Returns the list of excluded attributes
|
227 |
+
*
|
228 |
+
* @return array
|
229 |
+
*/
|
230 |
+
public function getExcludedAttributes()
|
231 |
+
{
|
232 |
+
/**
|
233 |
+
* Filters the attributes used to prevent lazylad from being applied
|
234 |
+
*
|
235 |
+
* @since 1.0
|
236 |
+
* @author Remy Perona
|
237 |
+
*
|
238 |
+
* @param array $excluded_attributes An array of excluded attributes.
|
239 |
+
*/
|
240 |
+
return apply_filters(
|
241 |
+
'rocket_lazyload_excluded_attributes',
|
242 |
+
[
|
243 |
+
'data-src=',
|
244 |
+
'data-no-lazy=',
|
245 |
+
'data-lazy-original=',
|
246 |
+
'data-lazy-src=',
|
247 |
+
'data-lazysrc=',
|
248 |
+
'data-lazyload=',
|
249 |
+
'data-bgposition=',
|
250 |
+
'data-envira-src=',
|
251 |
+
'fullurl=',
|
252 |
+
'lazy-slider-img=',
|
253 |
+
'data-srcset=',
|
254 |
+
'class="ls-l',
|
255 |
+
'class="ls-bg',
|
256 |
+
'soliloquy-image',
|
257 |
+
'loading="eager"',
|
258 |
+
'swatch-img',
|
259 |
+
'data-height-percentage',
|
260 |
+
'data-large_image',
|
261 |
+
'avia-bg-style-fixed',
|
262 |
+
]
|
263 |
+
);
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Returns the list of excluded src
|
268 |
+
*
|
269 |
+
* @return array
|
270 |
+
*/
|
271 |
+
public function getExcludedSrc()
|
272 |
+
{
|
273 |
+
/**
|
274 |
+
* Filters the src used to prevent lazylad from being applied
|
275 |
+
*
|
276 |
+
* @since 1.0
|
277 |
+
* @author Remy Perona
|
278 |
+
*
|
279 |
+
* @param array $excluded_src An array of excluded src.
|
280 |
+
*/
|
281 |
+
return apply_filters(
|
282 |
+
'rocket_lazyload_excluded_src',
|
283 |
+
[
|
284 |
+
'/wpcf7_captcha/',
|
285 |
+
'timthumb.php?src',
|
286 |
+
'woocommerce/assets/images/placeholder.png',
|
287 |
+
]
|
288 |
+
);
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Replaces the original image by the lazyload one
|
293 |
+
*
|
294 |
+
* @param array $image Array of matches elements.
|
295 |
+
* @return string
|
296 |
+
*/
|
297 |
+
private function replaceImage($image)
|
298 |
+
{
|
299 |
+
$width = 0;
|
300 |
+
$height = 0;
|
301 |
+
|
302 |
+
if (preg_match('@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts)) {
|
303 |
+
$width = absint($atts['width']);
|
304 |
+
}
|
305 |
+
|
306 |
+
if (preg_match('@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts)) {
|
307 |
+
$height = absint($atts['height']);
|
308 |
+
}
|
309 |
+
|
310 |
+
$placeholder_atts = preg_replace('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder($width, $height) . '"', $image['atts']);
|
311 |
+
|
312 |
+
$image_lazyload = str_replace($image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0]);
|
313 |
+
|
314 |
+
if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload)) {
|
315 |
+
$image_lazyload = str_replace('<img', '<img loading="lazy"', $image_lazyload);
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Filter the LazyLoad HTML output
|
320 |
+
*
|
321 |
+
* @since 1.0
|
322 |
+
*
|
323 |
+
* @param string $html Output that will be printed
|
324 |
+
*/
|
325 |
+
$image_lazyload = apply_filters('rocket_lazyload_html', $image_lazyload);
|
326 |
+
|
327 |
+
return $image_lazyload;
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Returns the HTML tag wrapped inside noscript tags
|
332 |
+
*
|
333 |
+
* @param string $element Element to wrap.
|
334 |
+
* @return string
|
335 |
+
*/
|
336 |
+
private function noscript($element)
|
337 |
+
{
|
338 |
+
return '<noscript>' . $element . '</noscript>';
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Applies lazyload on srcset and sizes attributes
|
343 |
+
*
|
344 |
+
* @param string $html HTML image tag.
|
345 |
+
* @return string
|
346 |
+
*/
|
347 |
+
public function lazyloadResponsiveAttributes($html)
|
348 |
+
{
|
349 |
+
$html = preg_replace('/[\s|"|\'](srcset)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
|
350 |
+
$html = preg_replace('/[\s|"|\'](sizes)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
|
351 |
+
|
352 |
+
return $html;
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Finds patterns matching smiley and call the callback method to replace them with the image
|
357 |
+
*
|
358 |
+
* @param string $text Content to search in.
|
359 |
+
* @return string
|
360 |
+
*/
|
361 |
+
public function convertSmilies($text)
|
362 |
+
{
|
363 |
+
global $wp_smiliessearch;
|
364 |
+
|
365 |
+
if (! get_option('use_smilies') || empty($wp_smiliessearch)) {
|
366 |
+
return $text;
|
367 |
+
}
|
368 |
+
|
369 |
+
$output = '';
|
370 |
+
// HTML loop taken from texturize function, could possible be consolidated.
|
371 |
+
$textarr = preg_split('/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between.
|
372 |
+
$stop = count($textarr);// loop stuff.
|
373 |
+
|
374 |
+
// Ignore proessing of specific tags.
|
375 |
+
$tags_to_ignore = 'code|pre|style|script|textarea';
|
376 |
+
$ignore_block_element = '';
|
377 |
+
|
378 |
+
for ($i = 0; $i < $stop; $i++) {
|
379 |
+
$content = $textarr[ $i ];
|
380 |
+
|
381 |
+
// If we're in an ignore block, wait until we find its closing tag.
|
382 |
+
if ('' === $ignore_block_element && preg_match('/^<(' . $tags_to_ignore . ')>/', $content, $matches)) {
|
383 |
+
$ignore_block_element = $matches[1];
|
384 |
+
}
|
385 |
+
|
386 |
+
// If it's not a tag and not in ignore block.
|
387 |
+
if ('' === $ignore_block_element && strlen($content) > 0 && '<' !== $content[0]) {
|
388 |
+
$content = preg_replace_callback($wp_smiliessearch, [$this, 'translateSmiley'], $content);
|
389 |
+
}
|
390 |
+
|
391 |
+
// did we exit ignore block.
|
392 |
+
if ('' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content) {
|
393 |
+
$ignore_block_element = '';
|
394 |
+
}
|
395 |
+
|
396 |
+
$output .= $content;
|
397 |
+
}
|
398 |
+
|
399 |
+
return $output;
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Replace matches by smiley image, lazyloaded
|
404 |
+
*
|
405 |
+
* @param array $matches Array of matches.
|
406 |
+
* @return string
|
407 |
+
*/
|
408 |
+
private function translateSmiley($matches)
|
409 |
+
{
|
410 |
+
global $wpsmiliestrans;
|
411 |
+
|
412 |
+
if (count($matches) === 0) {
|
413 |
+
return '';
|
414 |
+
}
|
415 |
+
|
416 |
+
$smiley = trim(reset($matches));
|
417 |
+
$img = $wpsmiliestrans[ $smiley ];
|
418 |
+
|
419 |
+
$matches = [];
|
420 |
+
$ext = preg_match('/\.([^.]+)$/', $img, $matches) ? strtolower($matches[1]) : false;
|
421 |
+
$image_exts = ['jpg', 'jpeg', 'jpe', 'gif', 'png'];
|
422 |
+
|
423 |
+
// Don't convert smilies that aren't images - they're probably emoji.
|
424 |
+
if (! in_array($ext, $image_exts, true)) {
|
425 |
+
return $img;
|
426 |
+
}
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Filter the Smiley image URL before it's used in the image element.
|
430 |
+
*
|
431 |
+
* @since 2.9.0
|
432 |
+
*
|
433 |
+
* @param string $smiley_url URL for the smiley image.
|
434 |
+
* @param string $img Filename for the smiley image.
|
435 |
+
* @param string $site_url Site URL, as returned by site_url().
|
436 |
+
*/
|
437 |
+
$src_url = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url());
|
438 |
+
|
439 |
+
// Don't LazyLoad if process is stopped for these reasons.
|
440 |
+
if (is_feed() || is_preview()) {
|
441 |
+
return sprintf(' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url($src_url), esc_attr($smiley));
|
442 |
+
}
|
443 |
+
|
444 |
+
return sprintf(' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $this->getPlaceholder(), esc_url($src_url), esc_attr($smiley));
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* Returns the placeholder for the src attribute
|
449 |
+
*
|
450 |
+
* @since 1.2
|
451 |
+
* @author Remy Perona
|
452 |
+
*
|
453 |
+
* @param int $width Width of the placeholder image. Default 0.
|
454 |
+
* @param int $height Height of the placeholder image. Default 0.
|
455 |
+
* @return string
|
456 |
+
*/
|
457 |
+
public function getPlaceholder($width = 0, $height = 0)
|
458 |
+
{
|
459 |
+
$width = 0 === $width ? 0 : absint($width);
|
460 |
+
$height = 0 === $height ? 0 : absint($height);
|
461 |
+
|
462 |
+
$placeholder = str_replace(' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E");
|
463 |
+
/**
|
464 |
+
* Filter the image lazyLoad placeholder on src attribute
|
465 |
+
*
|
466 |
+
* @since 1.1
|
467 |
+
*
|
468 |
+
* @param string $placeholder Placeholder that will be printed.
|
469 |
+
* @param int $width Placeholder width.
|
470 |
+
* @param int $height Placeholder height.
|
471 |
+
*/
|
472 |
+
return apply_filters('rocket_lazyload_placeholder', $placeholder, $width, $height);
|
473 |
+
}
|
474 |
+
}
|
src/EventManagement/EventManager.php
CHANGED
@@ -1,145 +1,145 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Event Manager to interact with the WP plugin API
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
-
|
10 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
-
|
12 |
-
/**
|
13 |
-
* The event manager manages events using the WordPress plugin API.
|
14 |
-
*
|
15 |
-
* @since 3.1
|
16 |
-
* @author Carl Alexander <contact@carlalexander.ca>
|
17 |
-
*/
|
18 |
-
class EventManager
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Adds a callback to a specific hook of the WordPress plugin API.
|
22 |
-
*
|
23 |
-
* @uses add_filter()
|
24 |
-
*
|
25 |
-
* @param string $hook_name Name of the hook.
|
26 |
-
* @param callable $callback Callback function.
|
27 |
-
* @param int $priority Priority.
|
28 |
-
* @param int $accepted_args Number of arguments.
|
29 |
-
*/
|
30 |
-
public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1)
|
31 |
-
{
|
32 |
-
add_filter($hook_name, $callback, $priority, $accepted_args);
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Add an event subscriber.
|
37 |
-
*
|
38 |
-
* The event manager registers all the hooks that the given subscriber
|
39 |
-
* wants to register with the WordPress Plugin API.
|
40 |
-
*
|
41 |
-
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
42 |
-
*/
|
43 |
-
public function addSubscriber(SubscriberInterface $subscriber)
|
44 |
-
{
|
45 |
-
if ($subscriber instanceof EventManagerAwareSubscriberInterface) {
|
46 |
-
$subscriber->setEventManager($this);
|
47 |
-
}
|
48 |
-
|
49 |
-
foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
|
50 |
-
$this->addSubscriberCallback($subscriber, $hook_name, $parameters);
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Checks the WordPress plugin API to see if the given hook has
|
56 |
-
* the given callback. The priority of the callback will be returned
|
57 |
-
* or false. If no callback is given will return true or false if
|
58 |
-
* there's any callbacks registered to the hook.
|
59 |
-
*
|
60 |
-
* @uses has_filter()
|
61 |
-
*
|
62 |
-
* @param string $hook_name Hook name.
|
63 |
-
* @param mixed $callback Callback.
|
64 |
-
*
|
65 |
-
* @return bool|int
|
66 |
-
*/
|
67 |
-
public function hasCallback($hook_name, $callback = false)
|
68 |
-
{
|
69 |
-
return has_filter($hook_name, $callback);
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Removes the given callback from the given hook. The WordPress plugin API only
|
74 |
-
* removes the hook if the callback and priority match a registered hook.
|
75 |
-
*
|
76 |
-
* @uses remove_filter()
|
77 |
-
*
|
78 |
-
* @param string $hook_name Hook name.
|
79 |
-
* @param callable $callback Callback.
|
80 |
-
* @param int $priority Priority.
|
81 |
-
*
|
82 |
-
* @return bool
|
83 |
-
*/
|
84 |
-
public function removeCallback($hook_name, $callback, $priority = 10)
|
85 |
-
{
|
86 |
-
return remove_filter($hook_name, $callback, $priority);
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Remove an event subscriber.
|
91 |
-
*
|
92 |
-
* The event manager removes all the hooks that the given subscriber
|
93 |
-
* wants to register with the WordPress Plugin API.
|
94 |
-
*
|
95 |
-
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
96 |
-
*/
|
97 |
-
public function removeSubscriber(SubscriberInterface $subscriber)
|
98 |
-
{
|
99 |
-
foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
|
100 |
-
$this->removeSubscriberCallback($subscriber, $hook_name, $parameters);
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Adds the given subscriber's callback to a specific hook
|
106 |
-
* of the WordPress plugin API.
|
107 |
-
*
|
108 |
-
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
109 |
-
* @param string $hook_name Hook name.
|
110 |
-
* @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
|
111 |
-
*/
|
112 |
-
private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
|
113 |
-
{
|
114 |
-
if (is_string($parameters)) {
|
115 |
-
$this->addCallback($hook_name, [ $subscriber, $parameters ]);
|
116 |
-
} elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
|
117 |
-
foreach ($parameters as $parameter) {
|
118 |
-
$this->addSubscriberCallback($subscriber, $hook_name, $parameter);
|
119 |
-
}
|
120 |
-
} elseif (is_array($parameters) && isset($parameters[0])) {
|
121 |
-
$this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1);
|
122 |
-
}
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Removes the given subscriber's callback to a specific hook
|
127 |
-
* of the WordPress plugin API.
|
128 |
-
*
|
129 |
-
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
130 |
-
* @param string $hook_name Hook name.
|
131 |
-
* @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
|
132 |
-
*/
|
133 |
-
private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
|
134 |
-
{
|
135 |
-
if (is_string($parameters)) {
|
136 |
-
$this->removeCallback($hook_name, [ $subscriber, $parameters ]);
|
137 |
-
} elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
|
138 |
-
foreach ($parameters as $parameter) {
|
139 |
-
$this->removeSubscriberCallback($subscriber, $hook_name, $parameter);
|
140 |
-
}
|
141 |
-
} elseif (is_array($parameters) && isset($parameters[0])) {
|
142 |
-
$this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10);
|
143 |
-
}
|
144 |
-
}
|
145 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Event Manager to interact with the WP plugin API
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
+
|
10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
+
|
12 |
+
/**
|
13 |
+
* The event manager manages events using the WordPress plugin API.
|
14 |
+
*
|
15 |
+
* @since 3.1
|
16 |
+
* @author Carl Alexander <contact@carlalexander.ca>
|
17 |
+
*/
|
18 |
+
class EventManager
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Adds a callback to a specific hook of the WordPress plugin API.
|
22 |
+
*
|
23 |
+
* @uses add_filter()
|
24 |
+
*
|
25 |
+
* @param string $hook_name Name of the hook.
|
26 |
+
* @param callable $callback Callback function.
|
27 |
+
* @param int $priority Priority.
|
28 |
+
* @param int $accepted_args Number of arguments.
|
29 |
+
*/
|
30 |
+
public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1)
|
31 |
+
{
|
32 |
+
add_filter($hook_name, $callback, $priority, $accepted_args);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Add an event subscriber.
|
37 |
+
*
|
38 |
+
* The event manager registers all the hooks that the given subscriber
|
39 |
+
* wants to register with the WordPress Plugin API.
|
40 |
+
*
|
41 |
+
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
42 |
+
*/
|
43 |
+
public function addSubscriber(SubscriberInterface $subscriber)
|
44 |
+
{
|
45 |
+
if ($subscriber instanceof EventManagerAwareSubscriberInterface) {
|
46 |
+
$subscriber->setEventManager($this);
|
47 |
+
}
|
48 |
+
|
49 |
+
foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
|
50 |
+
$this->addSubscriberCallback($subscriber, $hook_name, $parameters);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Checks the WordPress plugin API to see if the given hook has
|
56 |
+
* the given callback. The priority of the callback will be returned
|
57 |
+
* or false. If no callback is given will return true or false if
|
58 |
+
* there's any callbacks registered to the hook.
|
59 |
+
*
|
60 |
+
* @uses has_filter()
|
61 |
+
*
|
62 |
+
* @param string $hook_name Hook name.
|
63 |
+
* @param mixed $callback Callback.
|
64 |
+
*
|
65 |
+
* @return bool|int
|
66 |
+
*/
|
67 |
+
public function hasCallback($hook_name, $callback = false)
|
68 |
+
{
|
69 |
+
return has_filter($hook_name, $callback);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Removes the given callback from the given hook. The WordPress plugin API only
|
74 |
+
* removes the hook if the callback and priority match a registered hook.
|
75 |
+
*
|
76 |
+
* @uses remove_filter()
|
77 |
+
*
|
78 |
+
* @param string $hook_name Hook name.
|
79 |
+
* @param callable $callback Callback.
|
80 |
+
* @param int $priority Priority.
|
81 |
+
*
|
82 |
+
* @return bool
|
83 |
+
*/
|
84 |
+
public function removeCallback($hook_name, $callback, $priority = 10)
|
85 |
+
{
|
86 |
+
return remove_filter($hook_name, $callback, $priority);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Remove an event subscriber.
|
91 |
+
*
|
92 |
+
* The event manager removes all the hooks that the given subscriber
|
93 |
+
* wants to register with the WordPress Plugin API.
|
94 |
+
*
|
95 |
+
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
96 |
+
*/
|
97 |
+
public function removeSubscriber(SubscriberInterface $subscriber)
|
98 |
+
{
|
99 |
+
foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
|
100 |
+
$this->removeSubscriberCallback($subscriber, $hook_name, $parameters);
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Adds the given subscriber's callback to a specific hook
|
106 |
+
* of the WordPress plugin API.
|
107 |
+
*
|
108 |
+
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
109 |
+
* @param string $hook_name Hook name.
|
110 |
+
* @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
|
111 |
+
*/
|
112 |
+
private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
|
113 |
+
{
|
114 |
+
if (is_string($parameters)) {
|
115 |
+
$this->addCallback($hook_name, [ $subscriber, $parameters ]);
|
116 |
+
} elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
|
117 |
+
foreach ($parameters as $parameter) {
|
118 |
+
$this->addSubscriberCallback($subscriber, $hook_name, $parameter);
|
119 |
+
}
|
120 |
+
} elseif (is_array($parameters) && isset($parameters[0])) {
|
121 |
+
$this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Removes the given subscriber's callback to a specific hook
|
127 |
+
* of the WordPress plugin API.
|
128 |
+
*
|
129 |
+
* @param SubscriberInterface $subscriber SubscriberInterface implementation.
|
130 |
+
* @param string $hook_name Hook name.
|
131 |
+
* @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
|
132 |
+
*/
|
133 |
+
private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
|
134 |
+
{
|
135 |
+
if (is_string($parameters)) {
|
136 |
+
$this->removeCallback($hook_name, [ $subscriber, $parameters ]);
|
137 |
+
} elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
|
138 |
+
foreach ($parameters as $parameter) {
|
139 |
+
$this->removeSubscriberCallback($subscriber, $hook_name, $parameter);
|
140 |
+
}
|
141 |
+
} elseif (is_array($parameters) && isset($parameters[0])) {
|
142 |
+
$this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
src/EventManagement/EventManagerAwareSubscriberInterface.php
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Interface for subscribers who need access to the event manager object
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
-
|
10 |
-
interface EventManagerAwareSubscriberInterface extends SubscriberInterface
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Set the WordPress event manager for the subscriber.
|
14 |
-
*
|
15 |
-
* @since 3.1
|
16 |
-
* @author Remy Perona
|
17 |
-
*
|
18 |
-
* @param EventManager $event_manager EventManager instance.
|
19 |
-
*/
|
20 |
-
public function setEventManager(EventManager $event_manager);
|
21 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Interface for subscribers who need access to the event manager object
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
+
|
10 |
+
interface EventManagerAwareSubscriberInterface extends SubscriberInterface
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Set the WordPress event manager for the subscriber.
|
14 |
+
*
|
15 |
+
* @since 3.1
|
16 |
+
* @author Remy Perona
|
17 |
+
*
|
18 |
+
* @param EventManager $event_manager EventManager instance.
|
19 |
+
*/
|
20 |
+
public function setEventManager(EventManager $event_manager);
|
21 |
+
}
|
src/EventManagement/SubscriberInterface.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Interface for subscribers
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* A Subscriber knows what specific WordPress events it wants to listen to.
|
12 |
-
*
|
13 |
-
* When an EventManager adds a Subscriber, it gets all the WordPress events that
|
14 |
-
* it wants to listen to. It then adds the subscriber as a listener for each of them.
|
15 |
-
*
|
16 |
-
* @author Carl Alexander <contact@carlalexander.ca>
|
17 |
-
*/
|
18 |
-
interface SubscriberInterface
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Returns an array of events that this subscriber wants to listen to.
|
22 |
-
*
|
23 |
-
* The array key is the event name. The value can be:
|
24 |
-
*
|
25 |
-
* * The method name
|
26 |
-
* * An array with the method name and priority
|
27 |
-
* * An array with the method name, priority and number of accepted arguments
|
28 |
-
*
|
29 |
-
* For instance:
|
30 |
-
*
|
31 |
-
* * array('hook_name' => 'method_name')
|
32 |
-
* * array('hook_name' => array('method_name', $priority))
|
33 |
-
* * array('hook_name' => array('method_name', $priority, $accepted_args))
|
34 |
-
* * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2)))
|
35 |
-
*
|
36 |
-
* @return array
|
37 |
-
*/
|
38 |
-
public function getSubscribedEvents();
|
39 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Interface for subscribers
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\EventManagement;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* A Subscriber knows what specific WordPress events it wants to listen to.
|
12 |
+
*
|
13 |
+
* When an EventManager adds a Subscriber, it gets all the WordPress events that
|
14 |
+
* it wants to listen to. It then adds the subscriber as a listener for each of them.
|
15 |
+
*
|
16 |
+
* @author Carl Alexander <contact@carlalexander.ca>
|
17 |
+
*/
|
18 |
+
interface SubscriberInterface
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Returns an array of events that this subscriber wants to listen to.
|
22 |
+
*
|
23 |
+
* The array key is the event name. The value can be:
|
24 |
+
*
|
25 |
+
* * The method name
|
26 |
+
* * An array with the method name and priority
|
27 |
+
* * An array with the method name, priority and number of accepted arguments
|
28 |
+
*
|
29 |
+
* For instance:
|
30 |
+
*
|
31 |
+
* * array('hook_name' => 'method_name')
|
32 |
+
* * array('hook_name' => array('method_name', $priority))
|
33 |
+
* * array('hook_name' => array('method_name', $priority, $accepted_args))
|
34 |
+
* * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2)))
|
35 |
+
*
|
36 |
+
* @return array
|
37 |
+
*/
|
38 |
+
public function getSubscribedEvents();
|
39 |
+
}
|
src/Options/AbstractOptions.php
CHANGED
@@ -1,69 +1,69 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Abstract class to interact with the WP options API
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Options;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Manages options using the WordPress options API.
|
12 |
-
*
|
13 |
-
* @since 2.0
|
14 |
-
* @author Remy Perona
|
15 |
-
*/
|
16 |
-
abstract class AbstractOptions
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Gets the option for the given name. Returns the default value if the value does not exist.
|
20 |
-
*
|
21 |
-
* @since 2.0
|
22 |
-
* @author Remy Perona
|
23 |
-
*
|
24 |
-
* @param string $name Name of the option to get.
|
25 |
-
* @param mixed $default Default value to return if the value does not exist.
|
26 |
-
*
|
27 |
-
* @return mixed
|
28 |
-
*/
|
29 |
-
abstract public function get($name, $default = null);
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Sets the value of an option. Update the value if the option for the given name already exists.
|
33 |
-
*
|
34 |
-
* @since 2.0
|
35 |
-
* @author Remy Perona
|
36 |
-
* @param string $name Name of the option to set.
|
37 |
-
* @param mixed $value Value to set for the option.
|
38 |
-
*
|
39 |
-
* @return void
|
40 |
-
*/
|
41 |
-
abstract public function set($name, $value);
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Deletes the option with the given name.
|
45 |
-
*
|
46 |
-
* @since 2.0
|
47 |
-
* @author Remy Perona
|
48 |
-
*
|
49 |
-
* @param string $name Name of the option to delete.
|
50 |
-
*
|
51 |
-
* @return void
|
52 |
-
*/
|
53 |
-
abstract public function delete($name);
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Checks if the option with the given name exists.
|
57 |
-
*
|
58 |
-
* @since 2.0
|
59 |
-
* @author Remy Perona
|
60 |
-
*
|
61 |
-
* @param string $name Name of the option to check.
|
62 |
-
*
|
63 |
-
* @return boolean True if the option exists, false otherwise
|
64 |
-
*/
|
65 |
-
public function has($name)
|
66 |
-
{
|
67 |
-
return null !== $this->get($name);
|
68 |
-
}
|
69 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Abstract class to interact with the WP options API
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Options;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Manages options using the WordPress options API.
|
12 |
+
*
|
13 |
+
* @since 2.0
|
14 |
+
* @author Remy Perona
|
15 |
+
*/
|
16 |
+
abstract class AbstractOptions
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Gets the option for the given name. Returns the default value if the value does not exist.
|
20 |
+
*
|
21 |
+
* @since 2.0
|
22 |
+
* @author Remy Perona
|
23 |
+
*
|
24 |
+
* @param string $name Name of the option to get.
|
25 |
+
* @param mixed $default Default value to return if the value does not exist.
|
26 |
+
*
|
27 |
+
* @return mixed
|
28 |
+
*/
|
29 |
+
abstract public function get($name, $default = null);
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Sets the value of an option. Update the value if the option for the given name already exists.
|
33 |
+
*
|
34 |
+
* @since 2.0
|
35 |
+
* @author Remy Perona
|
36 |
+
* @param string $name Name of the option to set.
|
37 |
+
* @param mixed $value Value to set for the option.
|
38 |
+
*
|
39 |
+
* @return void
|
40 |
+
*/
|
41 |
+
abstract public function set($name, $value);
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Deletes the option with the given name.
|
45 |
+
*
|
46 |
+
* @since 2.0
|
47 |
+
* @author Remy Perona
|
48 |
+
*
|
49 |
+
* @param string $name Name of the option to delete.
|
50 |
+
*
|
51 |
+
* @return void
|
52 |
+
*/
|
53 |
+
abstract public function delete($name);
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Checks if the option with the given name exists.
|
57 |
+
*
|
58 |
+
* @since 2.0
|
59 |
+
* @author Remy Perona
|
60 |
+
*
|
61 |
+
* @param string $name Name of the option to check.
|
62 |
+
*
|
63 |
+
* @return boolean True if the option exists, false otherwise
|
64 |
+
*/
|
65 |
+
public function has($name)
|
66 |
+
{
|
67 |
+
return null !== $this->get($name);
|
68 |
+
}
|
69 |
+
}
|
src/Options/OptionArray.php
CHANGED
@@ -1,111 +1,111 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Manages the plugin options data
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Options;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Manages the data inside an option.
|
12 |
-
*
|
13 |
-
* @since 2.0
|
14 |
-
* @author Remy Perona
|
15 |
-
*/
|
16 |
-
class OptionArray
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Option data
|
20 |
-
*
|
21 |
-
* @var Array Array of data inside the option
|
22 |
-
*/
|
23 |
-
private $options;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Constructor
|
27 |
-
*
|
28 |
-
* @param Array $options Array of data coming from an option.
|
29 |
-
*/
|
30 |
-
public function __construct($options)
|
31 |
-
{
|
32 |
-
$this->options = $options;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Checks if the provided key exists in the option data array.
|
37 |
-
*
|
38 |
-
* @since 2.0
|
39 |
-
* @author Remy Perona
|
40 |
-
*
|
41 |
-
* @param string $key key name.
|
42 |
-
* @return boolean
|
43 |
-
*/
|
44 |
-
public function has($key)
|
45 |
-
{
|
46 |
-
return isset($this->options[ $key ]);
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Gets the value associated with a specific key.
|
51 |
-
*
|
52 |
-
* @since 2.0
|
53 |
-
* @author Remy Perona
|
54 |
-
*
|
55 |
-
* @param string $key key name.
|
56 |
-
* @param mixed $default default value to return if key doesn't exist.
|
57 |
-
* @return mixed
|
58 |
-
*/
|
59 |
-
public function get($key, $default = '')
|
60 |
-
{
|
61 |
-
if (! $this->has($key)) {
|
62 |
-
return $default;
|
63 |
-
}
|
64 |
-
|
65 |
-
return $this->options[ $key ];
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Sets the value associated with a specific key.
|
70 |
-
*
|
71 |
-
* @since 2.0
|
72 |
-
* @author Remy Perona
|
73 |
-
*
|
74 |
-
* @param string $key key name.
|
75 |
-
* @param mixed $value Value to set.
|
76 |
-
* @return void
|
77 |
-
*/
|
78 |
-
public function set($key, $value)
|
79 |
-
{
|
80 |
-
$this->options[ $key ] = $value;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Sets multiple values.
|
85 |
-
*
|
86 |
-
* @since 2.0
|
87 |
-
* @author Remy Perona
|
88 |
-
*
|
89 |
-
* @param array $options An array of key/value pairs to set.
|
90 |
-
* @return void
|
91 |
-
*/
|
92 |
-
public function setValues($options)
|
93 |
-
{
|
94 |
-
foreach ($options as $key => $value) {
|
95 |
-
$this->set($key, $value);
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Gets the option array.
|
101 |
-
*
|
102 |
-
* @since 2.0
|
103 |
-
* @author Remy Perona
|
104 |
-
*
|
105 |
-
* @return array
|
106 |
-
*/
|
107 |
-
public function getOptions()
|
108 |
-
{
|
109 |
-
return $this->options;
|
110 |
-
}
|
111 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Manages the plugin options data
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Options;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Manages the data inside an option.
|
12 |
+
*
|
13 |
+
* @since 2.0
|
14 |
+
* @author Remy Perona
|
15 |
+
*/
|
16 |
+
class OptionArray
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Option data
|
20 |
+
*
|
21 |
+
* @var Array Array of data inside the option
|
22 |
+
*/
|
23 |
+
private $options;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Constructor
|
27 |
+
*
|
28 |
+
* @param Array $options Array of data coming from an option.
|
29 |
+
*/
|
30 |
+
public function __construct($options)
|
31 |
+
{
|
32 |
+
$this->options = $options;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Checks if the provided key exists in the option data array.
|
37 |
+
*
|
38 |
+
* @since 2.0
|
39 |
+
* @author Remy Perona
|
40 |
+
*
|
41 |
+
* @param string $key key name.
|
42 |
+
* @return boolean
|
43 |
+
*/
|
44 |
+
public function has($key)
|
45 |
+
{
|
46 |
+
return isset($this->options[ $key ]);
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Gets the value associated with a specific key.
|
51 |
+
*
|
52 |
+
* @since 2.0
|
53 |
+
* @author Remy Perona
|
54 |
+
*
|
55 |
+
* @param string $key key name.
|
56 |
+
* @param mixed $default default value to return if key doesn't exist.
|
57 |
+
* @return mixed
|
58 |
+
*/
|
59 |
+
public function get($key, $default = '')
|
60 |
+
{
|
61 |
+
if (! $this->has($key)) {
|
62 |
+
return $default;
|
63 |
+
}
|
64 |
+
|
65 |
+
return $this->options[ $key ];
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Sets the value associated with a specific key.
|
70 |
+
*
|
71 |
+
* @since 2.0
|
72 |
+
* @author Remy Perona
|
73 |
+
*
|
74 |
+
* @param string $key key name.
|
75 |
+
* @param mixed $value Value to set.
|
76 |
+
* @return void
|
77 |
+
*/
|
78 |
+
public function set($key, $value)
|
79 |
+
{
|
80 |
+
$this->options[ $key ] = $value;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Sets multiple values.
|
85 |
+
*
|
86 |
+
* @since 2.0
|
87 |
+
* @author Remy Perona
|
88 |
+
*
|
89 |
+
* @param array $options An array of key/value pairs to set.
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
public function setValues($options)
|
93 |
+
{
|
94 |
+
foreach ($options as $key => $value) {
|
95 |
+
$this->set($key, $value);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Gets the option array.
|
101 |
+
*
|
102 |
+
* @since 2.0
|
103 |
+
* @author Remy Perona
|
104 |
+
*
|
105 |
+
* @return array
|
106 |
+
*/
|
107 |
+
public function getOptions()
|
108 |
+
{
|
109 |
+
return $this->options;
|
110 |
+
}
|
111 |
+
}
|
src/Options/Options.php
CHANGED
@@ -1,106 +1,106 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Options Class
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Options;
|
9 |
-
|
10 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Interact with the WordPress Options API
|
14 |
-
*/
|
15 |
-
class Options extends AbstractOptions
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* The prefix used by Rocket Lazyload options.
|
19 |
-
*
|
20 |
-
* @since 2.0
|
21 |
-
* @author Remy Perona
|
22 |
-
*
|
23 |
-
* @var string
|
24 |
-
*/
|
25 |
-
private $prefix;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Constructor
|
29 |
-
*
|
30 |
-
* @since 2.0
|
31 |
-
* @author Remy Perona
|
32 |
-
*
|
33 |
-
* @param string $prefix options prefix.
|
34 |
-
*/
|
35 |
-
public function __construct($prefix = '')
|
36 |
-
{
|
37 |
-
$this->prefix = $prefix;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Gets the option name used to store the option in the WordPress database.
|
42 |
-
*
|
43 |
-
* @since 2.0
|
44 |
-
* @author Remy Perona
|
45 |
-
*
|
46 |
-
* @param string $name Unprefixed name of the option.
|
47 |
-
*
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getOptionName($name)
|
51 |
-
{
|
52 |
-
return $this->prefix . $name;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Gets the option for the given name. Returns the default value if the value does not exist.
|
57 |
-
*
|
58 |
-
* @since 2.0
|
59 |
-
* @author Remy Perona
|
60 |
-
*
|
61 |
-
* @param string $name Name of the option to get.
|
62 |
-
* @param mixed $default Default value to return if the value does not exist.
|
63 |
-
*
|
64 |
-
* @return mixed
|
65 |
-
*/
|
66 |
-
public function get($name, $default = null)
|
67 |
-
{
|
68 |
-
$option = get_option($this->getOptionName($name), $default);
|
69 |
-
|
70 |
-
if (is_array($default) && ! is_array($option)) {
|
71 |
-
$option = (array) $option;
|
72 |
-
}
|
73 |
-
|
74 |
-
return $option;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Sets the value of an option. Update the value if the option for the given name already exists.
|
79 |
-
*
|
80 |
-
* @since 2.0
|
81 |
-
* @author Remy Perona
|
82 |
-
* @param string $name Name of the option to set.
|
83 |
-
* @param mixed $value Value to set for the option.
|
84 |
-
*
|
85 |
-
* @return void
|
86 |
-
*/
|
87 |
-
public function set($name, $value)
|
88 |
-
{
|
89 |
-
update_option($this->getOptionName($name), $value);
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Deletes the option with the given name.
|
94 |
-
*
|
95 |
-
* @since 2.0
|
96 |
-
* @author Remy Perona
|
97 |
-
*
|
98 |
-
* @param string $name Name of the option to delete.
|
99 |
-
*
|
100 |
-
* @return void
|
101 |
-
*/
|
102 |
-
public function delete($name)
|
103 |
-
{
|
104 |
-
delete_option($this->getOptionName($name));
|
105 |
-
}
|
106 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Options Class
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Options;
|
9 |
+
|
10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Interact with the WordPress Options API
|
14 |
+
*/
|
15 |
+
class Options extends AbstractOptions
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* The prefix used by Rocket Lazyload options.
|
19 |
+
*
|
20 |
+
* @since 2.0
|
21 |
+
* @author Remy Perona
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
private $prefix;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Constructor
|
29 |
+
*
|
30 |
+
* @since 2.0
|
31 |
+
* @author Remy Perona
|
32 |
+
*
|
33 |
+
* @param string $prefix options prefix.
|
34 |
+
*/
|
35 |
+
public function __construct($prefix = '')
|
36 |
+
{
|
37 |
+
$this->prefix = $prefix;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Gets the option name used to store the option in the WordPress database.
|
42 |
+
*
|
43 |
+
* @since 2.0
|
44 |
+
* @author Remy Perona
|
45 |
+
*
|
46 |
+
* @param string $name Unprefixed name of the option.
|
47 |
+
*
|
48 |
+
* @return string
|
49 |
+
*/
|
50 |
+
public function getOptionName($name)
|
51 |
+
{
|
52 |
+
return $this->prefix . $name;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the option for the given name. Returns the default value if the value does not exist.
|
57 |
+
*
|
58 |
+
* @since 2.0
|
59 |
+
* @author Remy Perona
|
60 |
+
*
|
61 |
+
* @param string $name Name of the option to get.
|
62 |
+
* @param mixed $default Default value to return if the value does not exist.
|
63 |
+
*
|
64 |
+
* @return mixed
|
65 |
+
*/
|
66 |
+
public function get($name, $default = null)
|
67 |
+
{
|
68 |
+
$option = get_option($this->getOptionName($name), $default);
|
69 |
+
|
70 |
+
if (is_array($default) && ! is_array($option)) {
|
71 |
+
$option = (array) $option;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $option;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Sets the value of an option. Update the value if the option for the given name already exists.
|
79 |
+
*
|
80 |
+
* @since 2.0
|
81 |
+
* @author Remy Perona
|
82 |
+
* @param string $name Name of the option to set.
|
83 |
+
* @param mixed $value Value to set for the option.
|
84 |
+
*
|
85 |
+
* @return void
|
86 |
+
*/
|
87 |
+
public function set($name, $value)
|
88 |
+
{
|
89 |
+
update_option($this->getOptionName($name), $value);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Deletes the option with the given name.
|
94 |
+
*
|
95 |
+
* @since 2.0
|
96 |
+
* @author Remy Perona
|
97 |
+
*
|
98 |
+
* @param string $name Name of the option to delete.
|
99 |
+
*
|
100 |
+
* @return void
|
101 |
+
*/
|
102 |
+
public function delete($name)
|
103 |
+
{
|
104 |
+
delete_option($this->getOptionName($name));
|
105 |
+
}
|
106 |
+
}
|
src/Plugin.php
CHANGED
@@ -1,97 +1,97 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Initialize and load the plugin
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin;
|
9 |
-
|
10 |
-
use League\Container\Container;
|
11 |
-
use RocketLazyLoadPlugin\EventManagement\EventManager;
|
12 |
-
use RocketLazyLoadPlugin\Options\Options;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Plugin initialize
|
16 |
-
*
|
17 |
-
* @since 2.0
|
18 |
-
* @author Remy Perona
|
19 |
-
*/
|
20 |
-
class Plugin
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* Is the plugin loaded
|
24 |
-
*
|
25 |
-
* @since 2.0
|
26 |
-
* @author Remy Perona
|
27 |
-
*
|
28 |
-
* @var boolean
|
29 |
-
*/
|
30 |
-
private $loaded = false;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Checks if the plugin is loaded
|
34 |
-
*
|
35 |
-
* @since 2.0
|
36 |
-
* @author Remy Perona
|
37 |
-
*
|
38 |
-
* @return boolean
|
39 |
-
*/
|
40 |
-
private function isLoaded()
|
41 |
-
{
|
42 |
-
return $this->loaded;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Loads the plugin in WordPress
|
47 |
-
*
|
48 |
-
* @since 2.0
|
49 |
-
* @author Remy Perona
|
50 |
-
*
|
51 |
-
* @return void
|
52 |
-
*/
|
53 |
-
public function load()
|
54 |
-
{
|
55 |
-
if ($this->isLoaded()) {
|
56 |
-
return;
|
57 |
-
}
|
58 |
-
|
59 |
-
$container = new Container();
|
60 |
-
|
61 |
-
$container->add('template_path', ROCKET_LL_PATH . 'views/');
|
62 |
-
$container->add('plugin_basename', ROCKET_LL_BASENAME);
|
63 |
-
|
64 |
-
$container->add('options', function () {
|
65 |
-
return new Options('rocket_lazyload');
|
66 |
-
});
|
67 |
-
|
68 |
-
$container->add('event_manager', function () {
|
69 |
-
return new EventManager();
|
70 |
-
});
|
71 |
-
|
72 |
-
$service_providers = [
|
73 |
-
'RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider',
|
74 |
-
'RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider',
|
75 |
-
'RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider',
|
76 |
-
'RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider',
|
77 |
-
'RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider',
|
78 |
-
];
|
79 |
-
|
80 |
-
foreach ($service_providers as $service) {
|
81 |
-
$container->addServiceProvider($service);
|
82 |
-
}
|
83 |
-
|
84 |
-
$subscribers = [
|
85 |
-
'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
|
86 |
-
'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
|
87 |
-
'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
|
88 |
-
'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
|
89 |
-
];
|
90 |
-
|
91 |
-
foreach ($subscribers as $subscriber) {
|
92 |
-
$container->get('event_manager')->addSubscriber($container->get($subscriber));
|
93 |
-
}
|
94 |
-
|
95 |
-
$this->loaded = true;
|
96 |
-
}
|
97 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Initialize and load the plugin
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\Container;
|
11 |
+
use RocketLazyLoadPlugin\EventManagement\EventManager;
|
12 |
+
use RocketLazyLoadPlugin\Options\Options;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Plugin initialize
|
16 |
+
*
|
17 |
+
* @since 2.0
|
18 |
+
* @author Remy Perona
|
19 |
+
*/
|
20 |
+
class Plugin
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Is the plugin loaded
|
24 |
+
*
|
25 |
+
* @since 2.0
|
26 |
+
* @author Remy Perona
|
27 |
+
*
|
28 |
+
* @var boolean
|
29 |
+
*/
|
30 |
+
private $loaded = false;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Checks if the plugin is loaded
|
34 |
+
*
|
35 |
+
* @since 2.0
|
36 |
+
* @author Remy Perona
|
37 |
+
*
|
38 |
+
* @return boolean
|
39 |
+
*/
|
40 |
+
private function isLoaded()
|
41 |
+
{
|
42 |
+
return $this->loaded;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Loads the plugin in WordPress
|
47 |
+
*
|
48 |
+
* @since 2.0
|
49 |
+
* @author Remy Perona
|
50 |
+
*
|
51 |
+
* @return void
|
52 |
+
*/
|
53 |
+
public function load()
|
54 |
+
{
|
55 |
+
if ($this->isLoaded()) {
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
|
59 |
+
$container = new Container();
|
60 |
+
|
61 |
+
$container->add('template_path', ROCKET_LL_PATH . 'views/');
|
62 |
+
$container->add('plugin_basename', ROCKET_LL_BASENAME);
|
63 |
+
|
64 |
+
$container->add('options', function () {
|
65 |
+
return new Options('rocket_lazyload');
|
66 |
+
});
|
67 |
+
|
68 |
+
$container->add('event_manager', function () {
|
69 |
+
return new EventManager();
|
70 |
+
});
|
71 |
+
|
72 |
+
$service_providers = [
|
73 |
+
'RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider',
|
74 |
+
'RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider',
|
75 |
+
'RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider',
|
76 |
+
'RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider',
|
77 |
+
'RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider',
|
78 |
+
];
|
79 |
+
|
80 |
+
foreach ($service_providers as $service) {
|
81 |
+
$container->addServiceProvider($service);
|
82 |
+
}
|
83 |
+
|
84 |
+
$subscribers = [
|
85 |
+
'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
|
86 |
+
'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
|
87 |
+
'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
|
88 |
+
'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
|
89 |
+
];
|
90 |
+
|
91 |
+
foreach ($subscribers as $subscriber) {
|
92 |
+
$container->get('event_manager')->addSubscriber($container->get($subscriber));
|
93 |
+
}
|
94 |
+
|
95 |
+
$this->loaded = true;
|
96 |
+
}
|
97 |
+
}
|
src/ServiceProvider/AdminServiceProvider.php
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Service Provider for the admin page classes
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
-
|
10 |
-
use League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Adds the admin page to the container
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
* @author Remy Perona
|
17 |
-
*/
|
18 |
-
class AdminServiceProvider extends AbstractServiceProvider
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Data provided by the service provider
|
22 |
-
*
|
23 |
-
* @since 2.0
|
24 |
-
* @author Remy Perona
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $provides = [
|
29 |
-
'RocketLazyLoadPlugin\Admin\AdminPage',
|
30 |
-
];
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Registers the admin page in the container
|
34 |
-
*
|
35 |
-
* @since 2.0
|
36 |
-
* @author Remy Perona
|
37 |
-
*
|
38 |
-
* @return void
|
39 |
-
*/
|
40 |
-
public function register()
|
41 |
-
{
|
42 |
-
$this->getContainer()->add('RocketLazyLoadPlugin\Admin\AdminPage')
|
43 |
-
->withArgument($this->getContainer()->get('options'))
|
44 |
-
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
|
45 |
-
->withArgument($this->getContainer()->get('template_path'));
|
46 |
-
}
|
47 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Service Provider for the admin page classes
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Adds the admin page to the container
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
* @author Remy Perona
|
17 |
+
*/
|
18 |
+
class AdminServiceProvider extends AbstractServiceProvider
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Data provided by the service provider
|
22 |
+
*
|
23 |
+
* @since 2.0
|
24 |
+
* @author Remy Perona
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $provides = [
|
29 |
+
'RocketLazyLoadPlugin\Admin\AdminPage',
|
30 |
+
];
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Registers the admin page in the container
|
34 |
+
*
|
35 |
+
* @since 2.0
|
36 |
+
* @author Remy Perona
|
37 |
+
*
|
38 |
+
* @return void
|
39 |
+
*/
|
40 |
+
public function register()
|
41 |
+
{
|
42 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Admin\AdminPage')
|
43 |
+
->withArgument($this->getContainer()->get('options'))
|
44 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
|
45 |
+
->withArgument($this->getContainer()->get('template_path'));
|
46 |
+
}
|
47 |
+
}
|
src/ServiceProvider/ImagifyNoticeServiceProvider.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Service Provider for the imagify notice class
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
-
|
10 |
-
use League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Adds the Imagify notice to the container
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
* @author Remy Perona
|
17 |
-
*/
|
18 |
-
class ImagifyNoticeServiceProvider extends AbstractServiceProvider
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Data provided by the service provider
|
22 |
-
*
|
23 |
-
* @since 2.0
|
24 |
-
* @author Remy Perona
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $provides = [
|
29 |
-
'RocketLazyLoadPlugin\Admin\ImagifyNotice',
|
30 |
-
];
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Registers the Imagify notice in the container
|
34 |
-
*
|
35 |
-
* @since 2.0
|
36 |
-
* @author Remy Perona
|
37 |
-
*
|
38 |
-
* @return void
|
39 |
-
*/
|
40 |
-
public function register()
|
41 |
-
{
|
42 |
-
$this->getContainer()->add('RocketLazyLoadPlugin\Admin\ImagifyNotice')
|
43 |
-
->withArgument($this->getContainer()->get('template_path'));
|
44 |
-
}
|
45 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Service Provider for the imagify notice class
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Adds the Imagify notice to the container
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
* @author Remy Perona
|
17 |
+
*/
|
18 |
+
class ImagifyNoticeServiceProvider extends AbstractServiceProvider
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Data provided by the service provider
|
22 |
+
*
|
23 |
+
* @since 2.0
|
24 |
+
* @author Remy Perona
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $provides = [
|
29 |
+
'RocketLazyLoadPlugin\Admin\ImagifyNotice',
|
30 |
+
];
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Registers the Imagify notice in the container
|
34 |
+
*
|
35 |
+
* @since 2.0
|
36 |
+
* @author Remy Perona
|
37 |
+
*
|
38 |
+
* @return void
|
39 |
+
*/
|
40 |
+
public function register()
|
41 |
+
{
|
42 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Admin\ImagifyNotice')
|
43 |
+
->withArgument($this->getContainer()->get('template_path'));
|
44 |
+
}
|
45 |
+
}
|
src/ServiceProvider/LazyloadServiceProvider.php
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Service Provider for the lazyload library
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
-
|
10 |
-
use League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Adds the lazyload library to the container
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
* @author Remy Perona
|
17 |
-
*/
|
18 |
-
class LazyloadServiceProvider extends AbstractServiceProvider
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Data provided by the service provider
|
22 |
-
*
|
23 |
-
* @since 2.0
|
24 |
-
* @author Remy Perona
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $provides = [
|
29 |
-
'RocketLazyload\Assets',
|
30 |
-
'RocketLazyload\Image',
|
31 |
-
'RocketLazyload\Iframe',
|
32 |
-
];
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Registers the lazyload library in the container
|
36 |
-
*
|
37 |
-
* @since 2.0
|
38 |
-
* @author Remy Perona
|
39 |
-
*
|
40 |
-
* @return void
|
41 |
-
*/
|
42 |
-
public function register()
|
43 |
-
{
|
44 |
-
$this->getContainer()->add('RocketLazyload\Assets');
|
45 |
-
$this->getContainer()->add('RocketLazyload\Image');
|
46 |
-
$this->getContainer()->add('RocketLazyload\Iframe');
|
47 |
-
}
|
48 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Service Provider for the lazyload library
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Adds the lazyload library to the container
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
* @author Remy Perona
|
17 |
+
*/
|
18 |
+
class LazyloadServiceProvider extends AbstractServiceProvider
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Data provided by the service provider
|
22 |
+
*
|
23 |
+
* @since 2.0
|
24 |
+
* @author Remy Perona
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $provides = [
|
29 |
+
'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets',
|
30 |
+
'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image',
|
31 |
+
'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe',
|
32 |
+
];
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Registers the lazyload library in the container
|
36 |
+
*
|
37 |
+
* @since 2.0
|
38 |
+
* @author Remy Perona
|
39 |
+
*
|
40 |
+
* @return void
|
41 |
+
*/
|
42 |
+
public function register()
|
43 |
+
{
|
44 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets');
|
45 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image');
|
46 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe');
|
47 |
+
}
|
48 |
+
}
|
src/ServiceProvider/OptionServiceProvider.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Service Provider for the plugin options
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
-
|
10 |
-
use League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Adds the option array to the container
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
* @author Remy Perona
|
17 |
-
*/
|
18 |
-
class OptionServiceProvider extends AbstractServiceProvider
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Data provided by the service provider
|
22 |
-
*
|
23 |
-
* @since 2.0
|
24 |
-
* @author Remy Perona
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $provides = [
|
29 |
-
'RocketLazyLoadPlugin\Options\OptionArray',
|
30 |
-
];
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Registers the option array in the container
|
34 |
-
*
|
35 |
-
* @since 2.0
|
36 |
-
* @author Remy Perona
|
37 |
-
*
|
38 |
-
* @return void
|
39 |
-
*/
|
40 |
-
public function register()
|
41 |
-
{
|
42 |
-
$this->getContainer()->add('RocketLazyLoadPlugin\Options\OptionArray')
|
43 |
-
->withArgument($this->getContainer()->get('options')->get('_options'));
|
44 |
-
}
|
45 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Service Provider for the plugin options
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Adds the option array to the container
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
* @author Remy Perona
|
17 |
+
*/
|
18 |
+
class OptionServiceProvider extends AbstractServiceProvider
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Data provided by the service provider
|
22 |
+
*
|
23 |
+
* @since 2.0
|
24 |
+
* @author Remy Perona
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $provides = [
|
29 |
+
'RocketLazyLoadPlugin\Options\OptionArray',
|
30 |
+
];
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Registers the option array in the container
|
34 |
+
*
|
35 |
+
* @since 2.0
|
36 |
+
* @author Remy Perona
|
37 |
+
*
|
38 |
+
* @return void
|
39 |
+
*/
|
40 |
+
public function register()
|
41 |
+
{
|
42 |
+
$this->getContainer()->add('RocketLazyLoadPlugin\Options\OptionArray')
|
43 |
+
->withArgument($this->getContainer()->get('options')->get('_options'));
|
44 |
+
}
|
45 |
+
}
|
src/ServiceProvider/SubscribersServiceProvider.php
CHANGED
@@ -1,60 +1,60 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Service Provider for the plugin subscribers
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
-
|
10 |
-
use League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Adds the subscribers to the container
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
* @author Remy Perona
|
17 |
-
*/
|
18 |
-
class SubscribersServiceProvider extends AbstractServiceProvider
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* Data provided by the service provider
|
22 |
-
*
|
23 |
-
* @since 2.0
|
24 |
-
* @author Remy Perona
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $provides = [
|
29 |
-
'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
|
30 |
-
'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
|
31 |
-
'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
|
32 |
-
'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
|
33 |
-
];
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Registers the subscribers in the container
|
37 |
-
*
|
38 |
-
* @since 2.0
|
39 |
-
* @author Remy Perona
|
40 |
-
*
|
41 |
-
* @return void
|
42 |
-
*/
|
43 |
-
public function register()
|
44 |
-
{
|
45 |
-
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber');
|
46 |
-
|
47 |
-
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber')
|
48 |
-
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\AdminPage'))
|
49 |
-
->withArgument($this->getContainer()->get('plugin_basename'));
|
50 |
-
|
51 |
-
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber')
|
52 |
-
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\ImagifyNotice'));
|
53 |
-
|
54 |
-
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber')
|
55 |
-
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
|
56 |
-
->withArgument($this->getContainer()->get('RocketLazyload\Assets'))
|
57 |
-
->withArgument($this->getContainer()->get('RocketLazyload\Image'))
|
58 |
-
->withArgument($this->getContainer()->get('RocketLazyload\Iframe'));
|
59 |
-
}
|
60 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Service Provider for the plugin subscribers
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\ServiceProvider;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Adds the subscribers to the container
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
* @author Remy Perona
|
17 |
+
*/
|
18 |
+
class SubscribersServiceProvider extends AbstractServiceProvider
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Data provided by the service provider
|
22 |
+
*
|
23 |
+
* @since 2.0
|
24 |
+
* @author Remy Perona
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $provides = [
|
29 |
+
'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
|
30 |
+
'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
|
31 |
+
'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
|
32 |
+
'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
|
33 |
+
];
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Registers the subscribers in the container
|
37 |
+
*
|
38 |
+
* @since 2.0
|
39 |
+
* @author Remy Perona
|
40 |
+
*
|
41 |
+
* @return void
|
42 |
+
*/
|
43 |
+
public function register()
|
44 |
+
{
|
45 |
+
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber');
|
46 |
+
|
47 |
+
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber')
|
48 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\AdminPage'))
|
49 |
+
->withArgument($this->getContainer()->get('plugin_basename'));
|
50 |
+
|
51 |
+
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber')
|
52 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\ImagifyNotice'));
|
53 |
+
|
54 |
+
$this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber')
|
55 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
|
56 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets'))
|
57 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image'))
|
58 |
+
->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe'));
|
59 |
+
}
|
60 |
+
}
|
src/Subscriber/AdminPageSubscriber.php
CHANGED
@@ -1,142 +1,142 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Page subscriber
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
-
|
10 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
-
|
12 |
-
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
13 |
-
use RocketLazyLoadPlugin\Admin\AdminPage;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Admin Page Subscriber
|
17 |
-
*
|
18 |
-
* @since 2.0
|
19 |
-
* @author Remy Perona
|
20 |
-
*/
|
21 |
-
class AdminPageSubscriber implements SubscriberInterface
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* AdminPage instance
|
25 |
-
*
|
26 |
-
* @since 2.0
|
27 |
-
* @author Remy Perona
|
28 |
-
*
|
29 |
-
* @var AdminPage
|
30 |
-
*/
|
31 |
-
private $page;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Plugin basename
|
35 |
-
*
|
36 |
-
* @since 2.0
|
37 |
-
* @author Remy Perona
|
38 |
-
*
|
39 |
-
* @var string
|
40 |
-
*/
|
41 |
-
private $plugin_basename;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Constructor
|
45 |
-
*
|
46 |
-
* @since 2.0
|
47 |
-
* @author Remy Perona
|
48 |
-
*
|
49 |
-
* @param AdminPage $page AdminPage instance.
|
50 |
-
* @param string $plugin_basename Plugin basename.
|
51 |
-
*/
|
52 |
-
public function __construct(AdminPage $page, $plugin_basename)
|
53 |
-
{
|
54 |
-
$this->page = $page;
|
55 |
-
$this->plugin_basename = $plugin_basename;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @inheritDoc
|
60 |
-
*/
|
61 |
-
public function getSubscribedEvents()
|
62 |
-
{
|
63 |
-
return [
|
64 |
-
'admin_init' => 'configure',
|
65 |
-
'admin_menu' => 'addAdminPage',
|
66 |
-
'plugin_action_links_' . $this->plugin_basename => 'addPluginPageLink',
|
67 |
-
'admin_enqueue_scripts' => 'enqueueAdminStyle',
|
68 |
-
];
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Registers the plugin settings in WordPress
|
73 |
-
*
|
74 |
-
* @since 2.0
|
75 |
-
* @author Remy Perona
|
76 |
-
*
|
77 |
-
* @return void
|
78 |
-
*/
|
79 |
-
public function configure()
|
80 |
-
{
|
81 |
-
$this->page->configure();
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Adds the admin page to the settings menu
|
86 |
-
*
|
87 |
-
* @since 2.0
|
88 |
-
* @author Remy Perona
|
89 |
-
*
|
90 |
-
* @return void
|
91 |
-
*/
|
92 |
-
public function addAdminPage()
|
93 |
-
{
|
94 |
-
add_options_page(
|
95 |
-
$this->page->getPageTitle(),
|
96 |
-
$this->page->getMenuTitle(),
|
97 |
-
$this->page->getCapability(),
|
98 |
-
$this->page->getSlug(),
|
99 |
-
[ $this->page, 'renderPage' ]
|
100 |
-
);
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Adds a link to the plugin settings on the plugins page
|
105 |
-
*
|
106 |
-
* @since 2.0
|
107 |
-
* @author Remy Perona
|
108 |
-
*
|
109 |
-
* @param array $actions Actions for the plugin.
|
110 |
-
* @return array
|
111 |
-
*/
|
112 |
-
public function addPluginPageLink($actions)
|
113 |
-
{
|
114 |
-
array_unshift(
|
115 |
-
$actions,
|
116 |
-
sprintf(
|
117 |
-
'<a href="%s">%s</a>',
|
118 |
-
admin_url('options-general.php?page=' . $this->page->getSlug()),
|
119 |
-
__('Settings', 'rocket-lazy-load')
|
120 |
-
)
|
121 |
-
);
|
122 |
-
|
123 |
-
return $actions;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Enqueue the css for the option page
|
128 |
-
*
|
129 |
-
* @since 2.0
|
130 |
-
* @author Remy Perona
|
131 |
-
*
|
132 |
-
* @param string $hook_suffix Current page hook.
|
133 |
-
*/
|
134 |
-
public function enqueueAdminStyle($hook_suffix)
|
135 |
-
{
|
136 |
-
if ('settings_page_rocket_lazyload' !== $hook_suffix) {
|
137 |
-
return;
|
138 |
-
}
|
139 |
-
|
140 |
-
wp_enqueue_style('rocket-lazyload', ROCKET_LL_ASSETS_URL . 'css/admin.css', null, ROCKET_LL_VERSION);
|
141 |
-
}
|
142 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Page subscriber
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
+
|
10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
+
|
12 |
+
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
13 |
+
use RocketLazyLoadPlugin\Admin\AdminPage;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Admin Page Subscriber
|
17 |
+
*
|
18 |
+
* @since 2.0
|
19 |
+
* @author Remy Perona
|
20 |
+
*/
|
21 |
+
class AdminPageSubscriber implements SubscriberInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* AdminPage instance
|
25 |
+
*
|
26 |
+
* @since 2.0
|
27 |
+
* @author Remy Perona
|
28 |
+
*
|
29 |
+
* @var AdminPage
|
30 |
+
*/
|
31 |
+
private $page;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Plugin basename
|
35 |
+
*
|
36 |
+
* @since 2.0
|
37 |
+
* @author Remy Perona
|
38 |
+
*
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
private $plugin_basename;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Constructor
|
45 |
+
*
|
46 |
+
* @since 2.0
|
47 |
+
* @author Remy Perona
|
48 |
+
*
|
49 |
+
* @param AdminPage $page AdminPage instance.
|
50 |
+
* @param string $plugin_basename Plugin basename.
|
51 |
+
*/
|
52 |
+
public function __construct(AdminPage $page, $plugin_basename)
|
53 |
+
{
|
54 |
+
$this->page = $page;
|
55 |
+
$this->plugin_basename = $plugin_basename;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @inheritDoc
|
60 |
+
*/
|
61 |
+
public function getSubscribedEvents()
|
62 |
+
{
|
63 |
+
return [
|
64 |
+
'admin_init' => 'configure',
|
65 |
+
'admin_menu' => 'addAdminPage',
|
66 |
+
'plugin_action_links_' . $this->plugin_basename => 'addPluginPageLink',
|
67 |
+
'admin_enqueue_scripts' => 'enqueueAdminStyle',
|
68 |
+
];
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Registers the plugin settings in WordPress
|
73 |
+
*
|
74 |
+
* @since 2.0
|
75 |
+
* @author Remy Perona
|
76 |
+
*
|
77 |
+
* @return void
|
78 |
+
*/
|
79 |
+
public function configure()
|
80 |
+
{
|
81 |
+
$this->page->configure();
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Adds the admin page to the settings menu
|
86 |
+
*
|
87 |
+
* @since 2.0
|
88 |
+
* @author Remy Perona
|
89 |
+
*
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
public function addAdminPage()
|
93 |
+
{
|
94 |
+
add_options_page(
|
95 |
+
$this->page->getPageTitle(),
|
96 |
+
$this->page->getMenuTitle(),
|
97 |
+
$this->page->getCapability(),
|
98 |
+
$this->page->getSlug(),
|
99 |
+
[ $this->page, 'renderPage' ]
|
100 |
+
);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Adds a link to the plugin settings on the plugins page
|
105 |
+
*
|
106 |
+
* @since 2.0
|
107 |
+
* @author Remy Perona
|
108 |
+
*
|
109 |
+
* @param array $actions Actions for the plugin.
|
110 |
+
* @return array
|
111 |
+
*/
|
112 |
+
public function addPluginPageLink($actions)
|
113 |
+
{
|
114 |
+
array_unshift(
|
115 |
+
$actions,
|
116 |
+
sprintf(
|
117 |
+
'<a href="%s">%s</a>',
|
118 |
+
admin_url('options-general.php?page=' . $this->page->getSlug()),
|
119 |
+
__('Settings', 'rocket-lazy-load')
|
120 |
+
)
|
121 |
+
);
|
122 |
+
|
123 |
+
return $actions;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Enqueue the css for the option page
|
128 |
+
*
|
129 |
+
* @since 2.0
|
130 |
+
* @author Remy Perona
|
131 |
+
*
|
132 |
+
* @param string $hook_suffix Current page hook.
|
133 |
+
*/
|
134 |
+
public function enqueueAdminStyle($hook_suffix)
|
135 |
+
{
|
136 |
+
if ('settings_page_rocket_lazyload' !== $hook_suffix) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
wp_enqueue_style('rocket-lazyload', ROCKET_LL_ASSETS_URL . 'css/admin.css', null, ROCKET_LL_VERSION);
|
141 |
+
}
|
142 |
+
}
|
src/Subscriber/ImagifyNoticeSubscriber.php
CHANGED
@@ -1,152 +1,152 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Imagify Notice subscriber
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
-
|
10 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
-
|
12 |
-
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
13 |
-
use RocketLazyLoadPlugin\Admin\ImagifyNotice;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Imagify Notice Subscriber
|
17 |
-
*
|
18 |
-
* @since 2.0
|
19 |
-
* @author Remy Perona
|
20 |
-
*/
|
21 |
-
class ImagifyNoticeSubscriber implements SubscriberInterface
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* ImagifyNotice instance
|
25 |
-
*
|
26 |
-
* @since 2.0
|
27 |
-
* @author Remy Perona
|
28 |
-
*
|
29 |
-
* @var ImagifyNotice
|
30 |
-
*/
|
31 |
-
private $imagify_notice;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Constructor
|
35 |
-
*
|
36 |
-
* @since 2.0
|
37 |
-
* @author Remy Perona
|
38 |
-
*
|
39 |
-
* @param ImagifyNotice $imagify_notice ImagifyNotice instance.
|
40 |
-
*/
|
41 |
-
public function __construct(ImagifyNotice $imagify_notice)
|
42 |
-
{
|
43 |
-
$this->imagify_notice = $imagify_notice;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @inheritDoc
|
48 |
-
*/
|
49 |
-
public function getSubscribedEvents()
|
50 |
-
{
|
51 |
-
return [
|
52 |
-
'admin_notices' => 'imagifyNotice',
|
53 |
-
'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS',
|
54 |
-
'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes',
|
55 |
-
'admin_post_rocket_lazyload_ignore' => 'dismissBoxes',
|
56 |
-
];
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Displays the Imagify notice
|
61 |
-
*
|
62 |
-
* @since 2.0
|
63 |
-
* @author Remy Perona
|
64 |
-
*
|
65 |
-
* @return void
|
66 |
-
*/
|
67 |
-
public function imagifyNotice()
|
68 |
-
{
|
69 |
-
$current_screen = get_current_screen();
|
70 |
-
|
71 |
-
if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) {
|
72 |
-
return;
|
73 |
-
}
|
74 |
-
|
75 |
-
$boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
|
76 |
-
|
77 |
-
if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) {
|
78 |
-
return;
|
79 |
-
}
|
80 |
-
|
81 |
-
$this->imagify_notice->displayNotice();
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Inserts the javascript to dismiss the notice
|
86 |
-
*
|
87 |
-
* @since 2.0
|
88 |
-
* @author Remy Perona
|
89 |
-
*
|
90 |
-
* @return void
|
91 |
-
*/
|
92 |
-
public function dismissNoticeJS()
|
93 |
-
{
|
94 |
-
echo "<script>
|
95 |
-
jQuery( document ).ready( function( $ ){
|
96 |
-
$( '.rktll-cross' ).on( 'click', function( e ) {
|
97 |
-
e.preventDefault();
|
98 |
-
var url = $( this ).attr( 'href' ).replace( 'admin-post', 'admin-ajax' );
|
99 |
-
$.get( url ).done( $( this ).parent().hide( 'slow' ) );
|
100 |
-
});
|
101 |
-
} );
|
102 |
-
</script>";
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Saves the dismiss for the user
|
107 |
-
*
|
108 |
-
* @since 2.0
|
109 |
-
* @author Remy Perona
|
110 |
-
*
|
111 |
-
* @return void
|
112 |
-
*/
|
113 |
-
public function dismissBoxes()
|
114 |
-
{
|
115 |
-
if (! isset($_GET['box'], $_GET['action'], $_GET['_wpnonce'])) {
|
116 |
-
return;
|
117 |
-
}
|
118 |
-
|
119 |
-
if (! wp_verify_nonce(sanitize_key($_GET['_wpnonce']), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice')) {
|
120 |
-
if (defined('DOING_AJAX')) {
|
121 |
-
wp_send_json(['error' => 1]);
|
122 |
-
} else {
|
123 |
-
wp_nonce_ays('');
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
$box = sanitize_key(wp_unslash($_GET['box']));
|
128 |
-
|
129 |
-
if ('rocket_lazyload_imagify_notice' === $box) {
|
130 |
-
update_option('rocket_lazyload_dismiss_imagify_notice', 0);
|
131 |
-
}
|
132 |
-
|
133 |
-
$actual = (array) get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
|
134 |
-
$actual = array_merge($actual, [ $box ]);
|
135 |
-
$actual = array_filter($actual);
|
136 |
-
$actual = array_unique($actual);
|
137 |
-
|
138 |
-
update_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', $actual);
|
139 |
-
delete_transient($box);
|
140 |
-
|
141 |
-
if (empty($GLOBALS['pagenow']) || 'admin-post.php' !== $GLOBALS['pagenow']) {
|
142 |
-
return;
|
143 |
-
}
|
144 |
-
|
145 |
-
if (defined('DOING_AJAX')) {
|
146 |
-
wp_send_json(['error' => 0]);
|
147 |
-
} else {
|
148 |
-
wp_safe_redirect(esc_url_raw(wp_get_referer()));
|
149 |
-
die();
|
150 |
-
}
|
151 |
-
}
|
152 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Imagify Notice subscriber
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
+
|
10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
11 |
+
|
12 |
+
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
13 |
+
use RocketLazyLoadPlugin\Admin\ImagifyNotice;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Imagify Notice Subscriber
|
17 |
+
*
|
18 |
+
* @since 2.0
|
19 |
+
* @author Remy Perona
|
20 |
+
*/
|
21 |
+
class ImagifyNoticeSubscriber implements SubscriberInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* ImagifyNotice instance
|
25 |
+
*
|
26 |
+
* @since 2.0
|
27 |
+
* @author Remy Perona
|
28 |
+
*
|
29 |
+
* @var ImagifyNotice
|
30 |
+
*/
|
31 |
+
private $imagify_notice;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor
|
35 |
+
*
|
36 |
+
* @since 2.0
|
37 |
+
* @author Remy Perona
|
38 |
+
*
|
39 |
+
* @param ImagifyNotice $imagify_notice ImagifyNotice instance.
|
40 |
+
*/
|
41 |
+
public function __construct(ImagifyNotice $imagify_notice)
|
42 |
+
{
|
43 |
+
$this->imagify_notice = $imagify_notice;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @inheritDoc
|
48 |
+
*/
|
49 |
+
public function getSubscribedEvents()
|
50 |
+
{
|
51 |
+
return [
|
52 |
+
'admin_notices' => 'imagifyNotice',
|
53 |
+
'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS',
|
54 |
+
'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes',
|
55 |
+
'admin_post_rocket_lazyload_ignore' => 'dismissBoxes',
|
56 |
+
];
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Displays the Imagify notice
|
61 |
+
*
|
62 |
+
* @since 2.0
|
63 |
+
* @author Remy Perona
|
64 |
+
*
|
65 |
+
* @return void
|
66 |
+
*/
|
67 |
+
public function imagifyNotice()
|
68 |
+
{
|
69 |
+
$current_screen = get_current_screen();
|
70 |
+
|
71 |
+
if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) {
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
$boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
|
76 |
+
|
77 |
+
if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) {
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->imagify_notice->displayNotice();
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Inserts the javascript to dismiss the notice
|
86 |
+
*
|
87 |
+
* @since 2.0
|
88 |
+
* @author Remy Perona
|
89 |
+
*
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
public function dismissNoticeJS()
|
93 |
+
{
|
94 |
+
echo "<script>
|
95 |
+
jQuery( document ).ready( function( $ ){
|
96 |
+
$( '.rktll-cross' ).on( 'click', function( e ) {
|
97 |
+
e.preventDefault();
|
98 |
+
var url = $( this ).attr( 'href' ).replace( 'admin-post', 'admin-ajax' );
|
99 |
+
$.get( url ).done( $( this ).parent().hide( 'slow' ) );
|
100 |
+
});
|
101 |
+
} );
|
102 |
+
</script>";
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Saves the dismiss for the user
|
107 |
+
*
|
108 |
+
* @since 2.0
|
109 |
+
* @author Remy Perona
|
110 |
+
*
|
111 |
+
* @return void
|
112 |
+
*/
|
113 |
+
public function dismissBoxes()
|
114 |
+
{
|
115 |
+
if (! isset($_GET['box'], $_GET['action'], $_GET['_wpnonce'])) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
if (! wp_verify_nonce(sanitize_key($_GET['_wpnonce']), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice')) {
|
120 |
+
if (defined('DOING_AJAX')) {
|
121 |
+
wp_send_json(['error' => 1]);
|
122 |
+
} else {
|
123 |
+
wp_nonce_ays('');
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
$box = sanitize_key(wp_unslash($_GET['box']));
|
128 |
+
|
129 |
+
if ('rocket_lazyload_imagify_notice' === $box) {
|
130 |
+
update_option('rocket_lazyload_dismiss_imagify_notice', 0);
|
131 |
+
}
|
132 |
+
|
133 |
+
$actual = (array) get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
|
134 |
+
$actual = array_merge($actual, [ $box ]);
|
135 |
+
$actual = array_filter($actual);
|
136 |
+
$actual = array_unique($actual);
|
137 |
+
|
138 |
+
update_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', $actual);
|
139 |
+
delete_transient($box);
|
140 |
+
|
141 |
+
if (empty($GLOBALS['pagenow']) || 'admin-post.php' !== $GLOBALS['pagenow']) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
|
145 |
+
if (defined('DOING_AJAX')) {
|
146 |
+
wp_send_json(['error' => 0]);
|
147 |
+
} else {
|
148 |
+
wp_safe_redirect(esc_url_raw(wp_get_referer()));
|
149 |
+
die();
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
src/Subscriber/LazyloadSubscriber.php
CHANGED
@@ -1,429 +1,429 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Lazyload subscriber
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
-
|
10 |
-
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
11 |
-
use RocketLazyLoadPlugin\Options\OptionArray;
|
12 |
-
use RocketLazyload\Assets;
|
13 |
-
use RocketLazyload\Image;
|
14 |
-
use RocketLazyload\Iframe;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Lazyload Subscriber
|
18 |
-
*
|
19 |
-
* @since 2.0
|
20 |
-
* @author Remy Perona
|
21 |
-
*/
|
22 |
-
class LazyloadSubscriber implements SubscriberInterface
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* OptionArray instance
|
26 |
-
*
|
27 |
-
* @since 2.0
|
28 |
-
* @author Remy Perona
|
29 |
-
*
|
30 |
-
* @var OptionArray
|
31 |
-
*/
|
32 |
-
private $option_array;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Assets instance
|
36 |
-
*
|
37 |
-
* @since 2.0
|
38 |
-
* @author Remy Perona
|
39 |
-
*
|
40 |
-
* @var Assets
|
41 |
-
*/
|
42 |
-
private $assets;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Image instance
|
46 |
-
*
|
47 |
-
* @since 2.0
|
48 |
-
* @author Remy Perona
|
49 |
-
*
|
50 |
-
* @var Image
|
51 |
-
*/
|
52 |
-
private $image;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Iframe instance
|
56 |
-
*
|
57 |
-
* @since 2.0
|
58 |
-
* @author Remy Perona
|
59 |
-
*
|
60 |
-
* @var Iframe
|
61 |
-
*/
|
62 |
-
private $iframe;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Constructor
|
66 |
-
*
|
67 |
-
* @since 2.0
|
68 |
-
* @author Remy Perona
|
69 |
-
*
|
70 |
-
* @param OptionArray $option_array OptionArray instance.
|
71 |
-
* @param Assets $assets Assets instance.
|
72 |
-
* @param Image $image Image instance.
|
73 |
-
* @param Iframe $iframe Iframe instance.
|
74 |
-
*/
|
75 |
-
public function __construct(OptionArray $option_array, Assets $assets, Image $image, Iframe $iframe)
|
76 |
-
{
|
77 |
-
$this->option_array = $option_array;
|
78 |
-
$this->assets = $assets;
|
79 |
-
$this->image = $image;
|
80 |
-
$this->iframe = $iframe;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* @inheritDoc
|
85 |
-
*/
|
86 |
-
public function getSubscribedEvents()
|
87 |
-
{
|
88 |
-
return [
|
89 |
-
'wp_footer' => [
|
90 |
-
[ 'insertLazyloadScript', ROCKET_LL_INT_MAX ],
|
91 |
-
['insertYoutubeThumbnailScript', ROCKET_LL_INT_MAX ],
|
92 |
-
],
|
93 |
-
'wp_head' => ['insertNoJSStyle', ROCKET_LL_INT_MAX ],
|
94 |
-
'wp_enqueue_scripts' => ['insertYoutubeThumbnailStyle', ROCKET_LL_INT_MAX],
|
95 |
-
'template_redirect' => ['lazyload', 2],
|
96 |
-
'rocket_lazyload_html' => 'lazyloadResponsive',
|
97 |
-
'init' => 'lazyloadSmilies',
|
98 |
-
];
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Inserts the lazyload script in the footer
|
103 |
-
*
|
104 |
-
* @since 2.0
|
105 |
-
* @author Remy Perona
|
106 |
-
*
|
107 |
-
* @return void
|
108 |
-
*/
|
109 |
-
public function insertLazyloadScript()
|
110 |
-
{
|
111 |
-
if (! $this->option_array->get('images') && ! $this->option_array->get('iframes')) {
|
112 |
-
return;
|
113 |
-
}
|
114 |
-
|
115 |
-
if (! $this->shouldLazyload()) {
|
116 |
-
return;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Filters the threshold at which lazyload is triggered
|
121 |
-
*
|
122 |
-
* @since 1.2
|
123 |
-
* @author Remy Perona
|
124 |
-
*
|
125 |
-
* @param int $threshold Threshold value.
|
126 |
-
*/
|
127 |
-
$threshold = apply_filters('rocket_lazyload_threshold', 300);
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Filters the use of the polyfill for intersectionObserver
|
131 |
-
*
|
132 |
-
* @since 3.3
|
133 |
-
* @author Remy Perona
|
134 |
-
*
|
135 |
-
* @param bool $polyfill True to use the polyfill, false otherwise.
|
136 |
-
*/
|
137 |
-
$polyfill = apply_filters('rocket_lazyload_polyfill', false);
|
138 |
-
|
139 |
-
$script_args = [
|
140 |
-
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
141 |
-
'version' => '12.0',
|
142 |
-
'polyfill' => $polyfill,
|
143 |
-
];
|
144 |
-
|
145 |
-
$inline_args = [
|
146 |
-
'threshold' => $threshold,
|
147 |
-
'options' => [
|
148 |
-
'use_native' => 'true',
|
149 |
-
],
|
150 |
-
];
|
151 |
-
|
152 |
-
if ($this->option_array->get('images') || $this->option_array->get('iframes')) {
|
153 |
-
$inline_args['elements']['loading'] = '[loading=lazy]';
|
154 |
-
}
|
155 |
-
|
156 |
-
if ($this->option_array->get('images')) {
|
157 |
-
$inline_args['elements']['background_image'] = '.rocket-lazyload';
|
158 |
-
}
|
159 |
-
|
160 |
-
/**
|
161 |
-
* Filters the arguments array for the lazyload script options
|
162 |
-
*
|
163 |
-
* @since 2.0
|
164 |
-
* @author Remy Perona
|
165 |
-
*
|
166 |
-
* @param array $inline_args Arguments used for the lazyload script options.
|
167 |
-
*/
|
168 |
-
$inline_args = apply_filters('rocket_lazyload_script_args', $inline_args);
|
169 |
-
|
170 |
-
echo '<script>' . $this->assets->getInlineLazyloadScript($inline_args) . '</script>';
|
171 |
-
$this->assets->insertLazyloadScript($script_args);
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Inserts the Youtube thumbnail script in the footer
|
176 |
-
*
|
177 |
-
* @since 2.0
|
178 |
-
* @author Remy Perona
|
179 |
-
*
|
180 |
-
* @return void
|
181 |
-
*/
|
182 |
-
public function insertYoutubeThumbnailScript()
|
183 |
-
{
|
184 |
-
if (! $this->option_array->get('youtube')) {
|
185 |
-
return;
|
186 |
-
}
|
187 |
-
|
188 |
-
if (! $this->shouldLazyload()) {
|
189 |
-
return;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Filters the resolution of the YouTube thumbnail
|
194 |
-
*
|
195 |
-
* @since 1.4.8
|
196 |
-
* @author Arun Basil Lal
|
197 |
-
*
|
198 |
-
* @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault
|
199 |
-
*/
|
200 |
-
$thumbnail_resolution = apply_filters('rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault');
|
201 |
-
|
202 |
-
$this->assets->insertYoutubeThumbnailScript(
|
203 |
-
[
|
204 |
-
'resolution' => $thumbnail_resolution,
|
205 |
-
'lazy_image' => (bool) $this->option_array->get('images'),
|
206 |
-
]
|
207 |
-
);
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Inserts the no JS CSS compatibility in the header
|
212 |
-
*
|
213 |
-
* @since 2.0.3
|
214 |
-
* @author Remy Perona
|
215 |
-
*
|
216 |
-
* @return void
|
217 |
-
*/
|
218 |
-
public function insertNoJSStyle()
|
219 |
-
{
|
220 |
-
if (! $this->shouldLazyload()) {
|
221 |
-
return;
|
222 |
-
}
|
223 |
-
|
224 |
-
$this->assets->insertNoJSCSS();
|
225 |
-
}
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Inserts the Youtube thumbnail CSS in the header
|
229 |
-
*
|
230 |
-
* @since 2.0
|
231 |
-
* @author Remy Perona
|
232 |
-
*
|
233 |
-
* @return void
|
234 |
-
*/
|
235 |
-
public function insertYoutubeThumbnailStyle()
|
236 |
-
{
|
237 |
-
if (! $this->option_array->get('youtube')) {
|
238 |
-
return;
|
239 |
-
}
|
240 |
-
|
241 |
-
if (! $this->shouldLazyload()) {
|
242 |
-
return;
|
243 |
-
}
|
244 |
-
|
245 |
-
$this->assets->insertYoutubeThumbnailCSS(
|
246 |
-
[
|
247 |
-
'base_url' => ROCKET_LL_ASSETS_URL,
|
248 |
-
'responsive_embeds' => current_theme_supports('responsive-embeds'),
|
249 |
-
]
|
250 |
-
);
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Checks if lazyload should be applied
|
255 |
-
*
|
256 |
-
* @since 2.0
|
257 |
-
* @author Remy Perona
|
258 |
-
*
|
259 |
-
* @return bool
|
260 |
-
*/
|
261 |
-
private function shouldLazyload()
|
262 |
-
{
|
263 |
-
if (is_admin() || is_feed() || is_preview() || ( defined('REST_REQUEST') && REST_REQUEST ) || ( defined('DONOTLAZYLOAD') && DONOTLAZYLOAD )) {
|
264 |
-
return false;
|
265 |
-
}
|
266 |
-
|
267 |
-
if ($this->isPageBuilder()) {
|
268 |
-
return false;
|
269 |
-
}
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Filters the lazyload application
|
273 |
-
*
|
274 |
-
* @since 2.0
|
275 |
-
* @author Remy Perona
|
276 |
-
*
|
277 |
-
* @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
|
278 |
-
*/
|
279 |
-
if (! apply_filters('do_rocket_lazyload', true)) { // WPCS: prefix ok.
|
280 |
-
return false;
|
281 |
-
}
|
282 |
-
|
283 |
-
return true;
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Checks if current page is a page builder editor.
|
288 |
-
*
|
289 |
-
* @since 2.2.2
|
290 |
-
* @author Remy Perona
|
291 |
-
*
|
292 |
-
* @return bool
|
293 |
-
*/
|
294 |
-
private function isPageBuilder()
|
295 |
-
{
|
296 |
-
// Exclude Page Builders editors.
|
297 |
-
$excluded_parameters = [
|
298 |
-
'fl_builder',
|
299 |
-
'et_fb',
|
300 |
-
'ct_builder',
|
301 |
-
];
|
302 |
-
|
303 |
-
foreach ($excluded_parameters as $excluded) {
|
304 |
-
if (isset($_GET[ $excluded ])) {
|
305 |
-
return true;
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
return false;
|
310 |
-
}
|
311 |
-
|
312 |
-
/**
|
313 |
-
* Gets the content to lazyload
|
314 |
-
*
|
315 |
-
* @since 2.0
|
316 |
-
* @author Remy Perona
|
317 |
-
*
|
318 |
-
* @return void
|
319 |
-
*/
|
320 |
-
public function lazyload()
|
321 |
-
{
|
322 |
-
if (! $this->shouldLazyload()) {
|
323 |
-
return;
|
324 |
-
}
|
325 |
-
|
326 |
-
ob_start([$this, 'lazyloadBuffer']);
|
327 |
-
}
|
328 |
-
|
329 |
-
/**
|
330 |
-
* Applies lazyload on the provided content
|
331 |
-
*
|
332 |
-
* @since 2.0
|
333 |
-
* @author Remy Perona
|
334 |
-
*
|
335 |
-
* @param string $html HTML content.
|
336 |
-
* @return string
|
337 |
-
*/
|
338 |
-
public function lazyloadBuffer($html)
|
339 |
-
{
|
340 |
-
$buffer = $this->ignoreScripts($html);
|
341 |
-
$buffer = $this->ignoreNoscripts($buffer);
|
342 |
-
|
343 |
-
if ($this->option_array->get('images')) {
|
344 |
-
$html = $this->image->lazyloadImages($html, $buffer);
|
345 |
-
$html = $this->image->lazyloadPictures($html, $buffer);
|
346 |
-
$html = $this->image->lazyloadBackgroundImages($html, $buffer);
|
347 |
-
}
|
348 |
-
|
349 |
-
if ($this->option_array->get('iframes')) {
|
350 |
-
$args = [
|
351 |
-
'youtube' => $this->option_array->get('youtube'),
|
352 |
-
];
|
353 |
-
|
354 |
-
$html = $this->iframe->lazyloadIframes($html, $buffer, $args);
|
355 |
-
}
|
356 |
-
|
357 |
-
return $html;
|
358 |
-
}
|
359 |
-
|
360 |
-
/**
|
361 |
-
* Applies lazyload on responsive images attributes srcset and sizes
|
362 |
-
*
|
363 |
-
* @since 2.0
|
364 |
-
* @author Remy Perona
|
365 |
-
*
|
366 |
-
* @param string $html Image HTML.
|
367 |
-
* @return string
|
368 |
-
*/
|
369 |
-
public function lazyloadResponsive($html)
|
370 |
-
{
|
371 |
-
return $this->image->lazyloadResponsiveAttributes($html);
|
372 |
-
}
|
373 |
-
|
374 |
-
/**
|
375 |
-
* Applies lazyload on WordPress smilies
|
376 |
-
*
|
377 |
-
* @since 2.0
|
378 |
-
* @author Remy Perona
|
379 |
-
*
|
380 |
-
* @return void
|
381 |
-
*/
|
382 |
-
public function lazyloadSmilies()
|
383 |
-
{
|
384 |
-
if (! $this->shouldLazyload()) {
|
385 |
-
return;
|
386 |
-
}
|
387 |
-
|
388 |
-
if (! $this->option_array->get('images')) {
|
389 |
-
return;
|
390 |
-
}
|
391 |
-
|
392 |
-
$filters = [
|
393 |
-
'the_content' => 10,
|
394 |
-
'the_excerpt' => 10,
|
395 |
-
'comment_text' => 20,
|
396 |
-
];
|
397 |
-
|
398 |
-
foreach ($filters as $filter => $prio) {
|
399 |
-
if (! has_filter($filter)) {
|
400 |
-
continue;
|
401 |
-
}
|
402 |
-
|
403 |
-
remove_filter($filter, 'convert_smilies', $prio);
|
404 |
-
add_filter($filter, [$this->image, 'convertSmilies'], $prio);
|
405 |
-
}
|
406 |
-
}
|
407 |
-
|
408 |
-
/**
|
409 |
-
* Remove inline scripts from the HTML to parse
|
410 |
-
*
|
411 |
-
* @param string $html HTML content.
|
412 |
-
* @return string
|
413 |
-
*/
|
414 |
-
private function ignoreScripts($html)
|
415 |
-
{
|
416 |
-
return preg_replace('/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html);
|
417 |
-
}
|
418 |
-
|
419 |
-
/**
|
420 |
-
* Remove noscript tags from the HTML to parse
|
421 |
-
*
|
422 |
-
* @param string $html HTML content.
|
423 |
-
* @return string
|
424 |
-
*/
|
425 |
-
private function ignoreNoscripts($html)
|
426 |
-
{
|
427 |
-
return preg_replace('#<noscript>(?:.+)</noscript>#Umsi', '', $html);
|
428 |
-
}
|
429 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Lazyload subscriber
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Subscriber;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
11 |
+
use RocketLazyLoadPlugin\Options\OptionArray;
|
12 |
+
use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets;
|
13 |
+
use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image;
|
14 |
+
use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Lazyload Subscriber
|
18 |
+
*
|
19 |
+
* @since 2.0
|
20 |
+
* @author Remy Perona
|
21 |
+
*/
|
22 |
+
class LazyloadSubscriber implements SubscriberInterface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* OptionArray instance
|
26 |
+
*
|
27 |
+
* @since 2.0
|
28 |
+
* @author Remy Perona
|
29 |
+
*
|
30 |
+
* @var OptionArray
|
31 |
+
*/
|
32 |
+
private $option_array;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Assets instance
|
36 |
+
*
|
37 |
+
* @since 2.0
|
38 |
+
* @author Remy Perona
|
39 |
+
*
|
40 |
+
* @var Assets
|
41 |
+
*/
|
42 |
+
private $assets;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Image instance
|
46 |
+
*
|
47 |
+
* @since 2.0
|
48 |
+
* @author Remy Perona
|
49 |
+
*
|
50 |
+
* @var Image
|
51 |
+
*/
|
52 |
+
private $image;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Iframe instance
|
56 |
+
*
|
57 |
+
* @since 2.0
|
58 |
+
* @author Remy Perona
|
59 |
+
*
|
60 |
+
* @var Iframe
|
61 |
+
*/
|
62 |
+
private $iframe;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Constructor
|
66 |
+
*
|
67 |
+
* @since 2.0
|
68 |
+
* @author Remy Perona
|
69 |
+
*
|
70 |
+
* @param OptionArray $option_array OptionArray instance.
|
71 |
+
* @param Assets $assets Assets instance.
|
72 |
+
* @param Image $image Image instance.
|
73 |
+
* @param Iframe $iframe Iframe instance.
|
74 |
+
*/
|
75 |
+
public function __construct(OptionArray $option_array, Assets $assets, Image $image, Iframe $iframe)
|
76 |
+
{
|
77 |
+
$this->option_array = $option_array;
|
78 |
+
$this->assets = $assets;
|
79 |
+
$this->image = $image;
|
80 |
+
$this->iframe = $iframe;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @inheritDoc
|
85 |
+
*/
|
86 |
+
public function getSubscribedEvents()
|
87 |
+
{
|
88 |
+
return [
|
89 |
+
'wp_footer' => [
|
90 |
+
[ 'insertLazyloadScript', ROCKET_LL_INT_MAX ],
|
91 |
+
['insertYoutubeThumbnailScript', ROCKET_LL_INT_MAX ],
|
92 |
+
],
|
93 |
+
'wp_head' => ['insertNoJSStyle', ROCKET_LL_INT_MAX ],
|
94 |
+
'wp_enqueue_scripts' => ['insertYoutubeThumbnailStyle', ROCKET_LL_INT_MAX],
|
95 |
+
'template_redirect' => ['lazyload', 2],
|
96 |
+
'rocket_lazyload_html' => 'lazyloadResponsive',
|
97 |
+
'init' => 'lazyloadSmilies',
|
98 |
+
];
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Inserts the lazyload script in the footer
|
103 |
+
*
|
104 |
+
* @since 2.0
|
105 |
+
* @author Remy Perona
|
106 |
+
*
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
public function insertLazyloadScript()
|
110 |
+
{
|
111 |
+
if (! $this->option_array->get('images') && ! $this->option_array->get('iframes')) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
if (! $this->shouldLazyload()) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Filters the threshold at which lazyload is triggered
|
121 |
+
*
|
122 |
+
* @since 1.2
|
123 |
+
* @author Remy Perona
|
124 |
+
*
|
125 |
+
* @param int $threshold Threshold value.
|
126 |
+
*/
|
127 |
+
$threshold = apply_filters('rocket_lazyload_threshold', 300);
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Filters the use of the polyfill for intersectionObserver
|
131 |
+
*
|
132 |
+
* @since 3.3
|
133 |
+
* @author Remy Perona
|
134 |
+
*
|
135 |
+
* @param bool $polyfill True to use the polyfill, false otherwise.
|
136 |
+
*/
|
137 |
+
$polyfill = apply_filters('rocket_lazyload_polyfill', false);
|
138 |
+
|
139 |
+
$script_args = [
|
140 |
+
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
141 |
+
'version' => '12.0',
|
142 |
+
'polyfill' => $polyfill,
|
143 |
+
];
|
144 |
+
|
145 |
+
$inline_args = [
|
146 |
+
'threshold' => $threshold,
|
147 |
+
'options' => [
|
148 |
+
'use_native' => 'true',
|
149 |
+
],
|
150 |
+
];
|
151 |
+
|
152 |
+
if ($this->option_array->get('images') || $this->option_array->get('iframes')) {
|
153 |
+
$inline_args['elements']['loading'] = '[loading=lazy]';
|
154 |
+
}
|
155 |
+
|
156 |
+
if ($this->option_array->get('images')) {
|
157 |
+
$inline_args['elements']['background_image'] = '.rocket-lazyload';
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Filters the arguments array for the lazyload script options
|
162 |
+
*
|
163 |
+
* @since 2.0
|
164 |
+
* @author Remy Perona
|
165 |
+
*
|
166 |
+
* @param array $inline_args Arguments used for the lazyload script options.
|
167 |
+
*/
|
168 |
+
$inline_args = apply_filters('rocket_lazyload_script_args', $inline_args);
|
169 |
+
|
170 |
+
echo '<script>' . $this->assets->getInlineLazyloadScript($inline_args) . '</script>';
|
171 |
+
$this->assets->insertLazyloadScript($script_args);
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Inserts the Youtube thumbnail script in the footer
|
176 |
+
*
|
177 |
+
* @since 2.0
|
178 |
+
* @author Remy Perona
|
179 |
+
*
|
180 |
+
* @return void
|
181 |
+
*/
|
182 |
+
public function insertYoutubeThumbnailScript()
|
183 |
+
{
|
184 |
+
if (! $this->option_array->get('youtube')) {
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
if (! $this->shouldLazyload()) {
|
189 |
+
return;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Filters the resolution of the YouTube thumbnail
|
194 |
+
*
|
195 |
+
* @since 1.4.8
|
196 |
+
* @author Arun Basil Lal
|
197 |
+
*
|
198 |
+
* @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault
|
199 |
+
*/
|
200 |
+
$thumbnail_resolution = apply_filters('rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault');
|
201 |
+
|
202 |
+
$this->assets->insertYoutubeThumbnailScript(
|
203 |
+
[
|
204 |
+
'resolution' => $thumbnail_resolution,
|
205 |
+
'lazy_image' => (bool) $this->option_array->get('images'),
|
206 |
+
]
|
207 |
+
);
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Inserts the no JS CSS compatibility in the header
|
212 |
+
*
|
213 |
+
* @since 2.0.3
|
214 |
+
* @author Remy Perona
|
215 |
+
*
|
216 |
+
* @return void
|
217 |
+
*/
|
218 |
+
public function insertNoJSStyle()
|
219 |
+
{
|
220 |
+
if (! $this->shouldLazyload()) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
|
224 |
+
$this->assets->insertNoJSCSS();
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Inserts the Youtube thumbnail CSS in the header
|
229 |
+
*
|
230 |
+
* @since 2.0
|
231 |
+
* @author Remy Perona
|
232 |
+
*
|
233 |
+
* @return void
|
234 |
+
*/
|
235 |
+
public function insertYoutubeThumbnailStyle()
|
236 |
+
{
|
237 |
+
if (! $this->option_array->get('youtube')) {
|
238 |
+
return;
|
239 |
+
}
|
240 |
+
|
241 |
+
if (! $this->shouldLazyload()) {
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
|
245 |
+
$this->assets->insertYoutubeThumbnailCSS(
|
246 |
+
[
|
247 |
+
'base_url' => ROCKET_LL_ASSETS_URL,
|
248 |
+
'responsive_embeds' => current_theme_supports('responsive-embeds'),
|
249 |
+
]
|
250 |
+
);
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Checks if lazyload should be applied
|
255 |
+
*
|
256 |
+
* @since 2.0
|
257 |
+
* @author Remy Perona
|
258 |
+
*
|
259 |
+
* @return bool
|
260 |
+
*/
|
261 |
+
private function shouldLazyload()
|
262 |
+
{
|
263 |
+
if (is_admin() || is_feed() || is_preview() || ( defined('REST_REQUEST') && REST_REQUEST ) || ( defined('DONOTLAZYLOAD') && DONOTLAZYLOAD )) {
|
264 |
+
return false;
|
265 |
+
}
|
266 |
+
|
267 |
+
if ($this->isPageBuilder()) {
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Filters the lazyload application
|
273 |
+
*
|
274 |
+
* @since 2.0
|
275 |
+
* @author Remy Perona
|
276 |
+
*
|
277 |
+
* @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
|
278 |
+
*/
|
279 |
+
if (! apply_filters('do_rocket_lazyload', true)) { // WPCS: prefix ok.
|
280 |
+
return false;
|
281 |
+
}
|
282 |
+
|
283 |
+
return true;
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Checks if current page is a page builder editor.
|
288 |
+
*
|
289 |
+
* @since 2.2.2
|
290 |
+
* @author Remy Perona
|
291 |
+
*
|
292 |
+
* @return bool
|
293 |
+
*/
|
294 |
+
private function isPageBuilder()
|
295 |
+
{
|
296 |
+
// Exclude Page Builders editors.
|
297 |
+
$excluded_parameters = [
|
298 |
+
'fl_builder',
|
299 |
+
'et_fb',
|
300 |
+
'ct_builder',
|
301 |
+
];
|
302 |
+
|
303 |
+
foreach ($excluded_parameters as $excluded) {
|
304 |
+
if (isset($_GET[ $excluded ])) {
|
305 |
+
return true;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
return false;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Gets the content to lazyload
|
314 |
+
*
|
315 |
+
* @since 2.0
|
316 |
+
* @author Remy Perona
|
317 |
+
*
|
318 |
+
* @return void
|
319 |
+
*/
|
320 |
+
public function lazyload()
|
321 |
+
{
|
322 |
+
if (! $this->shouldLazyload()) {
|
323 |
+
return;
|
324 |
+
}
|
325 |
+
|
326 |
+
ob_start([$this, 'lazyloadBuffer']);
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Applies lazyload on the provided content
|
331 |
+
*
|
332 |
+
* @since 2.0
|
333 |
+
* @author Remy Perona
|
334 |
+
*
|
335 |
+
* @param string $html HTML content.
|
336 |
+
* @return string
|
337 |
+
*/
|
338 |
+
public function lazyloadBuffer($html)
|
339 |
+
{
|
340 |
+
$buffer = $this->ignoreScripts($html);
|
341 |
+
$buffer = $this->ignoreNoscripts($buffer);
|
342 |
+
|
343 |
+
if ($this->option_array->get('images')) {
|
344 |
+
$html = $this->image->lazyloadImages($html, $buffer);
|
345 |
+
$html = $this->image->lazyloadPictures($html, $buffer);
|
346 |
+
$html = $this->image->lazyloadBackgroundImages($html, $buffer);
|
347 |
+
}
|
348 |
+
|
349 |
+
if ($this->option_array->get('iframes')) {
|
350 |
+
$args = [
|
351 |
+
'youtube' => $this->option_array->get('youtube'),
|
352 |
+
];
|
353 |
+
|
354 |
+
$html = $this->iframe->lazyloadIframes($html, $buffer, $args);
|
355 |
+
}
|
356 |
+
|
357 |
+
return $html;
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Applies lazyload on responsive images attributes srcset and sizes
|
362 |
+
*
|
363 |
+
* @since 2.0
|
364 |
+
* @author Remy Perona
|
365 |
+
*
|
366 |
+
* @param string $html Image HTML.
|
367 |
+
* @return string
|
368 |
+
*/
|
369 |
+
public function lazyloadResponsive($html)
|
370 |
+
{
|
371 |
+
return $this->image->lazyloadResponsiveAttributes($html);
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Applies lazyload on WordPress smilies
|
376 |
+
*
|
377 |
+
* @since 2.0
|
378 |
+
* @author Remy Perona
|
379 |
+
*
|
380 |
+
* @return void
|
381 |
+
*/
|
382 |
+
public function lazyloadSmilies()
|
383 |
+
{
|
384 |
+
if (! $this->shouldLazyload()) {
|
385 |
+
return;
|
386 |
+
}
|
387 |
+
|
388 |
+
if (! $this->option_array->get('images')) {
|
389 |
+
return;
|
390 |
+
}
|
391 |
+
|
392 |
+
$filters = [
|
393 |
+
'the_content' => 10,
|
394 |
+
'the_excerpt' => 10,
|
395 |
+
'comment_text' => 20,
|
396 |
+
];
|
397 |
+
|
398 |
+
foreach ($filters as $filter => $prio) {
|
399 |
+
if (! has_filter($filter)) {
|
400 |
+
continue;
|
401 |
+
}
|
402 |
+
|
403 |
+
remove_filter($filter, 'convert_smilies', $prio);
|
404 |
+
add_filter($filter, [$this->image, 'convertSmilies'], $prio);
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Remove inline scripts from the HTML to parse
|
410 |
+
*
|
411 |
+
* @param string $html HTML content.
|
412 |
+
* @return string
|
413 |
+
*/
|
414 |
+
private function ignoreScripts($html)
|
415 |
+
{
|
416 |
+
return preg_replace('/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html);
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Remove noscript tags from the HTML to parse
|
421 |
+
*
|
422 |
+
* @param string $html HTML content.
|
423 |
+
* @return string
|
424 |
+
*/
|
425 |
+
private function ignoreNoscripts($html)
|
426 |
+
{
|
427 |
+
return preg_replace('#<noscript>(?:.+)</noscript>#Umsi', '', $html);
|
428 |
+
}
|
429 |
+
}
|
src/Subscriber/ThirdParty/AMPSubscriber.php
CHANGED
@@ -1,73 +1,73 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* AMP plugin compatibility subscrber
|
4 |
-
*
|
5 |
-
* @package RocketLazyload
|
6 |
-
*/
|
7 |
-
|
8 |
-
namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
|
9 |
-
|
10 |
-
use RocketLazyLoadPlugin\EventManagement\EventManager;
|
11 |
-
use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;
|
12 |
-
|
13 |
-
defined('ABSPATH') || die('Cheatin\' uh?');
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Manages compatibility with the AMP plugin
|
17 |
-
*
|
18 |
-
* @since 2.0
|
19 |
-
* @author Remy Perona
|
20 |
-
*/
|
21 |
-
class AMPSubscriber implements EventManagerAwareSubscriberInterface
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* @inheritDoc
|
25 |
-
*/
|
26 |
-
public function getSubscribedEvents()
|
27 |
-
{
|
28 |
-
return [
|
29 |
-
'wp' => 'disableIfAMP',
|
30 |
-
];
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* {@inheritdoc}
|
35 |
-
*/
|
36 |
-
public function setEventManager(EventManager $event_manager)
|
37 |
-
{
|
38 |
-
$this->event_manager = $event_manager;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Disable if on AMP page
|
43 |
-
*
|
44 |
-
* @since 2.0.2
|
45 |
-
* @author Remy Perona
|
46 |
-
*
|
47 |
-
* @return void
|
48 |
-
*/
|
49 |
-
public function disableIfAMP()
|
50 |
-
{
|
51 |
-
if ($this->isAmpEndpoint()) {
|
52 |
-
$this->event_manager->addCallback('do_rocket_lazyload', '__return_false');
|
53 |
-
$this->event_manager->addCallback('do_rocket_lazyload_iframes', '__return_false');
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Checks if current page uses AMP
|
59 |
-
*
|
60 |
-
* @since 2.0
|
61 |
-
* @author Remy Perona
|
62 |
-
*
|
63 |
-
* @return boolean
|
64 |
-
*/
|
65 |
-
private function isAmpEndpoint()
|
66 |
-
{
|
67 |
-
if (function_exists('is_amp_endpoint') && \is_amp_endpoint()) {
|
68 |
-
return true;
|
69 |
-
}
|
70 |
-
|
71 |
-
return false;
|
72 |
-
}
|
73 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* AMP plugin compatibility subscrber
|
4 |
+
*
|
5 |
+
* @package RocketLazyload
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
|
9 |
+
|
10 |
+
use RocketLazyLoadPlugin\EventManagement\EventManager;
|
11 |
+
use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;
|
12 |
+
|
13 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Manages compatibility with the AMP plugin
|
17 |
+
*
|
18 |
+
* @since 2.0
|
19 |
+
* @author Remy Perona
|
20 |
+
*/
|
21 |
+
class AMPSubscriber implements EventManagerAwareSubscriberInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @inheritDoc
|
25 |
+
*/
|
26 |
+
public function getSubscribedEvents()
|
27 |
+
{
|
28 |
+
return [
|
29 |
+
'wp' => 'disableIfAMP',
|
30 |
+
];
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* {@inheritdoc}
|
35 |
+
*/
|
36 |
+
public function setEventManager(EventManager $event_manager)
|
37 |
+
{
|
38 |
+
$this->event_manager = $event_manager;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Disable if on AMP page
|
43 |
+
*
|
44 |
+
* @since 2.0.2
|
45 |
+
* @author Remy Perona
|
46 |
+
*
|
47 |
+
* @return void
|
48 |
+
*/
|
49 |
+
public function disableIfAMP()
|
50 |
+
{
|
51 |
+
if ($this->isAmpEndpoint()) {
|
52 |
+
$this->event_manager->addCallback('do_rocket_lazyload', '__return_false');
|
53 |
+
$this->event_manager->addCallback('do_rocket_lazyload_iframes', '__return_false');
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Checks if current page uses AMP
|
59 |
+
*
|
60 |
+
* @since 2.0
|
61 |
+
* @author Remy Perona
|
62 |
+
*
|
63 |
+
* @return boolean
|
64 |
+
*/
|
65 |
+
private function isAmpEndpoint()
|
66 |
+
{
|
67 |
+
if (function_exists('is_amp_endpoint') && \is_amp_endpoint()) {
|
68 |
+
return true;
|
69 |
+
}
|
70 |
+
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
}
|
src/rocket-lazyload-requirements-check.php
CHANGED
@@ -1,143 +1,143 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Check if current requirements are met
|
4 |
-
*
|
5 |
-
* @package RocketLazyloadPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
defined('ABSPATH') || die('Cheatin’ uh?');
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Class to check if the current WordPress and PHP versions meet our requirements
|
12 |
-
*
|
13 |
-
* @since 2.0
|
14 |
-
* @author Remy Perona
|
15 |
-
*/
|
16 |
-
class Rocket_Lazyload_Requirements_Check
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Plugin Name
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
private $plugin_name;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Plugin version
|
27 |
-
*
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
private $plugin_version;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Required WordPress version
|
34 |
-
*
|
35 |
-
* @var string
|
36 |
-
*/
|
37 |
-
private $wp_version;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Required PHP version
|
41 |
-
*
|
42 |
-
* @var string
|
43 |
-
*/
|
44 |
-
private $php_version;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Constructor
|
48 |
-
*
|
49 |
-
* @since 3.0
|
50 |
-
* @author Remy Perona
|
51 |
-
*
|
52 |
-
* @param array $args {
|
53 |
-
* Arguments to populate the class properties.
|
54 |
-
*
|
55 |
-
* @type string $plugin_name Plugin name.
|
56 |
-
* @type string $wp_version Required WordPress version.
|
57 |
-
* @type string $php_version Required PHP version.
|
58 |
-
* }
|
59 |
-
*/
|
60 |
-
public function __construct($args)
|
61 |
-
{
|
62 |
-
foreach (array('plugin_name', 'plugin_version', 'wp_version', 'php_version') as $setting) {
|
63 |
-
if (isset($args[ $setting ])) {
|
64 |
-
$this->$setting = $args[ $setting ];
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Checks if all requirements are ok, if not, display a notice and the rollback
|
71 |
-
*
|
72 |
-
* @since 3.0
|
73 |
-
* @author Remy Perona
|
74 |
-
*
|
75 |
-
* @return bool
|
76 |
-
*/
|
77 |
-
public function check()
|
78 |
-
{
|
79 |
-
if (! $this->phpPasses() || ! $this->wpPasses()) {
|
80 |
-
add_action('admin_notices', array($this, 'notice'));
|
81 |
-
|
82 |
-
return false;
|
83 |
-
}
|
84 |
-
|
85 |
-
return true;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Checks if the current PHP version is equal or superior to the required PHP version
|
90 |
-
*
|
91 |
-
* @since 3.0
|
92 |
-
* @author Remy Perona
|
93 |
-
*
|
94 |
-
* @return bool
|
95 |
-
*/
|
96 |
-
private function phpPasses()
|
97 |
-
{
|
98 |
-
return version_compare(PHP_VERSION, $this->php_version) >= 0;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Checks if the current WordPress version is equal or superior to the required PHP version
|
103 |
-
*
|
104 |
-
* @since 3.0
|
105 |
-
* @author Remy Perona
|
106 |
-
*
|
107 |
-
* @return bool
|
108 |
-
*/
|
109 |
-
private function wpPasses()
|
110 |
-
{
|
111 |
-
global $wp_version;
|
112 |
-
|
113 |
-
return version_compare($wp_version, $this->wp_version) >= 0;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Displays a notice if requirements are not met.
|
118 |
-
*
|
119 |
-
* @since 2.0
|
120 |
-
* @author Remy Perona
|
121 |
-
*/
|
122 |
-
public function notice()
|
123 |
-
{
|
124 |
-
if (! current_user_can('manage_options')) {
|
125 |
-
return;
|
126 |
-
}
|
127 |
-
|
128 |
-
// Translators: %1$s = Plugin name, %2$s = Plugin version.
|
129 |
-
$message = '<p>' . sprintf(__('To function properly, %1$s %2$s requires at least:', 'rocket-lazy-load'), $this->plugin_name, $this->plugin_version) . '</p><ul>';
|
130 |
-
|
131 |
-
if (! $this->phpPasses()) {
|
132 |
-
// Translators: %1$s = PHP version required.
|
133 |
-
$message .= '<li>' . sprintf(__('PHP %1$s. To use this %2$s version, please ask your web host how to upgrade your server to PHP %1$s or higher.', 'rocket-lazy-load'), $this->php_version, $this->plugin_name) . '</li>';
|
134 |
-
}
|
135 |
-
|
136 |
-
if (! $this->wpPasses()) {
|
137 |
-
// Translators: %1$s = WordPress version required.
|
138 |
-
$message .= '<li>' . sprintf(__('WordPress %1$s. To use this %2$s version, please upgrade WordPress to version %1$s or higher.', 'rocket-lazy-load'), $this->wp_version, $this->plugin_name) . '</li>';
|
139 |
-
}
|
140 |
-
|
141 |
-
echo '<div class="notice notice-error">' . $message . '</div>';
|
142 |
-
}
|
143 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Check if current requirements are met
|
4 |
+
*
|
5 |
+
* @package RocketLazyloadPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined('ABSPATH') || die('Cheatin’ uh?');
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class to check if the current WordPress and PHP versions meet our requirements
|
12 |
+
*
|
13 |
+
* @since 2.0
|
14 |
+
* @author Remy Perona
|
15 |
+
*/
|
16 |
+
class Rocket_Lazyload_Requirements_Check
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Plugin Name
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
private $plugin_name;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Plugin version
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
private $plugin_version;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Required WordPress version
|
34 |
+
*
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
private $wp_version;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Required PHP version
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
private $php_version;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Constructor
|
48 |
+
*
|
49 |
+
* @since 3.0
|
50 |
+
* @author Remy Perona
|
51 |
+
*
|
52 |
+
* @param array $args {
|
53 |
+
* Arguments to populate the class properties.
|
54 |
+
*
|
55 |
+
* @type string $plugin_name Plugin name.
|
56 |
+
* @type string $wp_version Required WordPress version.
|
57 |
+
* @type string $php_version Required PHP version.
|
58 |
+
* }
|
59 |
+
*/
|
60 |
+
public function __construct($args)
|
61 |
+
{
|
62 |
+
foreach (array('plugin_name', 'plugin_version', 'wp_version', 'php_version') as $setting) {
|
63 |
+
if (isset($args[ $setting ])) {
|
64 |
+
$this->$setting = $args[ $setting ];
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Checks if all requirements are ok, if not, display a notice and the rollback
|
71 |
+
*
|
72 |
+
* @since 3.0
|
73 |
+
* @author Remy Perona
|
74 |
+
*
|
75 |
+
* @return bool
|
76 |
+
*/
|
77 |
+
public function check()
|
78 |
+
{
|
79 |
+
if (! $this->phpPasses() || ! $this->wpPasses()) {
|
80 |
+
add_action('admin_notices', array($this, 'notice'));
|
81 |
+
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Checks if the current PHP version is equal or superior to the required PHP version
|
90 |
+
*
|
91 |
+
* @since 3.0
|
92 |
+
* @author Remy Perona
|
93 |
+
*
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
private function phpPasses()
|
97 |
+
{
|
98 |
+
return version_compare(PHP_VERSION, $this->php_version) >= 0;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Checks if the current WordPress version is equal or superior to the required PHP version
|
103 |
+
*
|
104 |
+
* @since 3.0
|
105 |
+
* @author Remy Perona
|
106 |
+
*
|
107 |
+
* @return bool
|
108 |
+
*/
|
109 |
+
private function wpPasses()
|
110 |
+
{
|
111 |
+
global $wp_version;
|
112 |
+
|
113 |
+
return version_compare($wp_version, $this->wp_version) >= 0;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Displays a notice if requirements are not met.
|
118 |
+
*
|
119 |
+
* @since 2.0
|
120 |
+
* @author Remy Perona
|
121 |
+
*/
|
122 |
+
public function notice()
|
123 |
+
{
|
124 |
+
if (! current_user_can('manage_options')) {
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
|
128 |
+
// Translators: %1$s = Plugin name, %2$s = Plugin version.
|
129 |
+
$message = '<p>' . sprintf(__('To function properly, %1$s %2$s requires at least:', 'rocket-lazy-load'), $this->plugin_name, $this->plugin_version) . '</p><ul>';
|
130 |
+
|
131 |
+
if (! $this->phpPasses()) {
|
132 |
+
// Translators: %1$s = PHP version required.
|
133 |
+
$message .= '<li>' . sprintf(__('PHP %1$s. To use this %2$s version, please ask your web host how to upgrade your server to PHP %1$s or higher.', 'rocket-lazy-load'), $this->php_version, $this->plugin_name) . '</li>';
|
134 |
+
}
|
135 |
+
|
136 |
+
if (! $this->wpPasses()) {
|
137 |
+
// Translators: %1$s = WordPress version required.
|
138 |
+
$message .= '<li>' . sprintf(__('WordPress %1$s. To use this %2$s version, please upgrade WordPress to version %1$s or higher.', 'rocket-lazy-load'), $this->wp_version, $this->plugin_name) . '</li>';
|
139 |
+
}
|
140 |
+
|
141 |
+
echo '<div class="notice notice-error">' . $message . '</div>';
|
142 |
+
}
|
143 |
+
}
|
vendor/composer/ClassLoader.php
CHANGED
@@ -279,7 +279,7 @@ class ClassLoader
|
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
282 |
-
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
283 |
}
|
284 |
|
285 |
/**
|
@@ -377,11 +377,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 |
}
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
282 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
283 |
}
|
284 |
|
285 |
/**
|
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 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
383 |
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
384 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
|
|
385 |
return $file;
|
386 |
}
|
387 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,33 +1,42 @@
|
|
1 |
[
|
2 |
{
|
3 |
-
"name": "
|
4 |
-
"version": "
|
5 |
-
"version_normalized": "1.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
-
"url": "https://github.com/
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
18 |
-
"
|
19 |
},
|
20 |
-
"
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
"extra": {
|
|
|
23 |
"branch-alias": {
|
24 |
-
"dev-master": "1.0
|
25 |
}
|
26 |
},
|
27 |
"installation-source": "dist",
|
28 |
"autoload": {
|
29 |
"psr-4": {
|
30 |
-
"
|
31 |
}
|
32 |
},
|
33 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -36,18 +45,82 @@
|
|
36 |
],
|
37 |
"authors": [
|
38 |
{
|
39 |
-
"name": "
|
40 |
-
"
|
|
|
41 |
}
|
42 |
],
|
43 |
-
"description": "
|
44 |
-
"homepage": "https://github.
|
45 |
"keywords": [
|
46 |
-
"
|
47 |
-
"
|
48 |
-
"
|
49 |
-
"
|
50 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
]
|
52 |
},
|
53 |
{
|
@@ -151,43 +224,34 @@
|
|
151 |
]
|
152 |
},
|
153 |
{
|
154 |
-
"name": "
|
155 |
-
"version": "
|
156 |
-
"version_normalized": "1.
|
157 |
"source": {
|
158 |
"type": "git",
|
159 |
-
"url": "https://github.com/
|
160 |
-
"reference": "
|
161 |
},
|
162 |
"dist": {
|
163 |
"type": "zip",
|
164 |
-
"url": "https://api.github.com/repos/
|
165 |
-
"reference": "
|
166 |
"shasum": ""
|
167 |
},
|
168 |
"require": {
|
169 |
-
"
|
170 |
-
},
|
171 |
-
"replace": {
|
172 |
-
"roundcube/plugin-installer": "*",
|
173 |
-
"shama/baton": "*"
|
174 |
-
},
|
175 |
-
"require-dev": {
|
176 |
-
"composer/composer": "1.0.*@dev",
|
177 |
-
"phpunit/phpunit": "^4.8.36"
|
178 |
},
|
179 |
-
"time": "
|
180 |
-
"type": "
|
181 |
"extra": {
|
182 |
-
"class": "Composer\\Installers\\Plugin",
|
183 |
"branch-alias": {
|
184 |
-
"dev-master": "1.0-dev"
|
185 |
}
|
186 |
},
|
187 |
"installation-source": "dist",
|
188 |
"autoload": {
|
189 |
"psr-4": {
|
190 |
-
"
|
191 |
}
|
192 |
},
|
193 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -196,97 +260,33 @@
|
|
196 |
],
|
197 |
"authors": [
|
198 |
{
|
199 |
-
"name": "
|
200 |
-
"
|
201 |
-
"homepage": "https://github.com/shama"
|
202 |
}
|
203 |
],
|
204 |
-
"description": "
|
205 |
-
"homepage": "https://
|
206 |
"keywords": [
|
207 |
-
"
|
208 |
-
"
|
209 |
-
"
|
210 |
-
"
|
211 |
-
"
|
212 |
-
"Kanboard",
|
213 |
-
"Lan Management System",
|
214 |
-
"MODX Evo",
|
215 |
-
"Mautic",
|
216 |
-
"Maya",
|
217 |
-
"OXID",
|
218 |
-
"Plentymarkets",
|
219 |
-
"Porto",
|
220 |
-
"RadPHP",
|
221 |
-
"SMF",
|
222 |
-
"Thelia",
|
223 |
-
"Whmcs",
|
224 |
-
"WolfCMS",
|
225 |
-
"agl",
|
226 |
-
"aimeos",
|
227 |
-
"annotatecms",
|
228 |
-
"attogram",
|
229 |
-
"bitrix",
|
230 |
-
"cakephp",
|
231 |
-
"chef",
|
232 |
-
"cockpit",
|
233 |
-
"codeigniter",
|
234 |
-
"concrete5",
|
235 |
-
"croogo",
|
236 |
-
"dokuwiki",
|
237 |
-
"drupal",
|
238 |
-
"eZ Platform",
|
239 |
-
"elgg",
|
240 |
-
"expressionengine",
|
241 |
-
"fuelphp",
|
242 |
-
"grav",
|
243 |
-
"installer",
|
244 |
-
"itop",
|
245 |
-
"joomla",
|
246 |
-
"known",
|
247 |
-
"kohana",
|
248 |
-
"laravel",
|
249 |
-
"lavalite",
|
250 |
-
"lithium",
|
251 |
-
"magento",
|
252 |
-
"majima",
|
253 |
-
"mako",
|
254 |
-
"mediawiki",
|
255 |
-
"modulework",
|
256 |
-
"modx",
|
257 |
-
"moodle",
|
258 |
-
"osclass",
|
259 |
-
"phpbb",
|
260 |
-
"piwik",
|
261 |
-
"ppi",
|
262 |
-
"puppet",
|
263 |
-
"pxcms",
|
264 |
-
"reindex",
|
265 |
-
"roundcube",
|
266 |
-
"shopware",
|
267 |
-
"silverstripe",
|
268 |
-
"sydes",
|
269 |
-
"symfony",
|
270 |
-
"typo3",
|
271 |
-
"wordpress",
|
272 |
-
"yawik",
|
273 |
-
"zend",
|
274 |
-
"zikula"
|
275 |
]
|
276 |
},
|
277 |
{
|
278 |
"name": "wp-media/rocket-lazyload-common",
|
279 |
-
"version": "v2.5",
|
280 |
-
"version_normalized": "2.5.
|
281 |
"source": {
|
282 |
"type": "git",
|
283 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
284 |
-
"reference": "
|
285 |
},
|
286 |
"dist": {
|
287 |
"type": "zip",
|
288 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
289 |
-
"reference": "
|
290 |
"shasum": ""
|
291 |
},
|
292 |
"require": {
|
@@ -304,7 +304,7 @@
|
|
304 |
"symfony/yaml": "2.8.*",
|
305 |
"wp-coding-standards/wpcs": "^2.0.0"
|
306 |
},
|
307 |
-
"time": "2019-09-
|
308 |
"type": "library",
|
309 |
"installation-source": "dist",
|
310 |
"autoload": {
|
1 |
[
|
2 |
{
|
3 |
+
"name": "composer/installers",
|
4 |
+
"version": "v1.7.0",
|
5 |
+
"version_normalized": "1.7.0.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
+
"url": "https://github.com/composer/installers.git",
|
9 |
+
"reference": "141b272484481432cda342727a427dc1e206bfa0"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
|
14 |
+
"reference": "141b272484481432cda342727a427dc1e206bfa0",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
18 |
+
"composer-plugin-api": "^1.0"
|
19 |
},
|
20 |
+
"replace": {
|
21 |
+
"roundcube/plugin-installer": "*",
|
22 |
+
"shama/baton": "*"
|
23 |
+
},
|
24 |
+
"require-dev": {
|
25 |
+
"composer/composer": "1.0.*@dev",
|
26 |
+
"phpunit/phpunit": "^4.8.36"
|
27 |
+
},
|
28 |
+
"time": "2019-08-12T15:00:31+00:00",
|
29 |
+
"type": "composer-plugin",
|
30 |
"extra": {
|
31 |
+
"class": "Composer\\Installers\\Plugin",
|
32 |
"branch-alias": {
|
33 |
+
"dev-master": "1.0-dev"
|
34 |
}
|
35 |
},
|
36 |
"installation-source": "dist",
|
37 |
"autoload": {
|
38 |
"psr-4": {
|
39 |
+
"Composer\\Installers\\": "src/Composer/Installers"
|
40 |
}
|
41 |
},
|
42 |
"notification-url": "https://packagist.org/downloads/",
|
45 |
],
|
46 |
"authors": [
|
47 |
{
|
48 |
+
"name": "Kyle Robinson Young",
|
49 |
+
"email": "kyle@dontkry.com",
|
50 |
+
"homepage": "https://github.com/shama"
|
51 |
}
|
52 |
],
|
53 |
+
"description": "A multi-framework Composer library installer",
|
54 |
+
"homepage": "https://composer.github.io/installers/",
|
55 |
"keywords": [
|
56 |
+
"Craft",
|
57 |
+
"Dolibarr",
|
58 |
+
"Eliasis",
|
59 |
+
"Hurad",
|
60 |
+
"ImageCMS",
|
61 |
+
"Kanboard",
|
62 |
+
"Lan Management System",
|
63 |
+
"MODX Evo",
|
64 |
+
"Mautic",
|
65 |
+
"Maya",
|
66 |
+
"OXID",
|
67 |
+
"Plentymarkets",
|
68 |
+
"Porto",
|
69 |
+
"RadPHP",
|
70 |
+
"SMF",
|
71 |
+
"Thelia",
|
72 |
+
"Whmcs",
|
73 |
+
"WolfCMS",
|
74 |
+
"agl",
|
75 |
+
"aimeos",
|
76 |
+
"annotatecms",
|
77 |
+
"attogram",
|
78 |
+
"bitrix",
|
79 |
+
"cakephp",
|
80 |
+
"chef",
|
81 |
+
"cockpit",
|
82 |
+
"codeigniter",
|
83 |
+
"concrete5",
|
84 |
+
"croogo",
|
85 |
+
"dokuwiki",
|
86 |
+
"drupal",
|
87 |
+
"eZ Platform",
|
88 |
+
"elgg",
|
89 |
+
"expressionengine",
|
90 |
+
"fuelphp",
|
91 |
+
"grav",
|
92 |
+
"installer",
|
93 |
+
"itop",
|
94 |
+
"joomla",
|
95 |
+
"known",
|
96 |
+
"kohana",
|
97 |
+
"laravel",
|
98 |
+
"lavalite",
|
99 |
+
"lithium",
|
100 |
+
"magento",
|
101 |
+
"majima",
|
102 |
+
"mako",
|
103 |
+
"mediawiki",
|
104 |
+
"modulework",
|
105 |
+
"modx",
|
106 |
+
"moodle",
|
107 |
+
"osclass",
|
108 |
+
"phpbb",
|
109 |
+
"piwik",
|
110 |
+
"ppi",
|
111 |
+
"puppet",
|
112 |
+
"pxcms",
|
113 |
+
"reindex",
|
114 |
+
"roundcube",
|
115 |
+
"shopware",
|
116 |
+
"silverstripe",
|
117 |
+
"sydes",
|
118 |
+
"symfony",
|
119 |
+
"typo3",
|
120 |
+
"wordpress",
|
121 |
+
"yawik",
|
122 |
+
"zend",
|
123 |
+
"zikula"
|
124 |
]
|
125 |
},
|
126 |
{
|
224 |
]
|
225 |
},
|
226 |
{
|
227 |
+
"name": "psr/container",
|
228 |
+
"version": "1.0.0",
|
229 |
+
"version_normalized": "1.0.0.0",
|
230 |
"source": {
|
231 |
"type": "git",
|
232 |
+
"url": "https://github.com/php-fig/container.git",
|
233 |
+
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
234 |
},
|
235 |
"dist": {
|
236 |
"type": "zip",
|
237 |
+
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
238 |
+
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
239 |
"shasum": ""
|
240 |
},
|
241 |
"require": {
|
242 |
+
"php": ">=5.3.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
},
|
244 |
+
"time": "2017-02-14T16:28:37+00:00",
|
245 |
+
"type": "library",
|
246 |
"extra": {
|
|
|
247 |
"branch-alias": {
|
248 |
+
"dev-master": "1.0.x-dev"
|
249 |
}
|
250 |
},
|
251 |
"installation-source": "dist",
|
252 |
"autoload": {
|
253 |
"psr-4": {
|
254 |
+
"Psr\\Container\\": "src/"
|
255 |
}
|
256 |
},
|
257 |
"notification-url": "https://packagist.org/downloads/",
|
260 |
],
|
261 |
"authors": [
|
262 |
{
|
263 |
+
"name": "PHP-FIG",
|
264 |
+
"homepage": "http://www.php-fig.org/"
|
|
|
265 |
}
|
266 |
],
|
267 |
+
"description": "Common Container Interface (PHP FIG PSR-11)",
|
268 |
+
"homepage": "https://github.com/php-fig/container",
|
269 |
"keywords": [
|
270 |
+
"PSR-11",
|
271 |
+
"container",
|
272 |
+
"container-interface",
|
273 |
+
"container-interop",
|
274 |
+
"psr"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
]
|
276 |
},
|
277 |
{
|
278 |
"name": "wp-media/rocket-lazyload-common",
|
279 |
+
"version": "v2.5.1",
|
280 |
+
"version_normalized": "2.5.1.0",
|
281 |
"source": {
|
282 |
"type": "git",
|
283 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
284 |
+
"reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e"
|
285 |
},
|
286 |
"dist": {
|
287 |
"type": "zip",
|
288 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
|
289 |
+
"reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
|
290 |
"shasum": ""
|
291 |
},
|
292 |
"require": {
|
304 |
"symfony/yaml": "2.8.*",
|
305 |
"wp-coding-standards/wpcs": "^2.0.0"
|
306 |
},
|
307 |
+
"time": "2019-09-06T13:51:56+00:00",
|
308 |
"type": "library",
|
309 |
"installation-source": "dist",
|
310 |
"autoload": {
|
vendor/wp-media/rocket-lazyload-common/src/Assets.php
CHANGED
@@ -236,10 +236,10 @@ class Assets
|
|
236 |
$image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
|
237 |
|
238 |
if (isset($args['lazy_image']) && $args['lazy_image']) {
|
239 |
-
$image = '<img data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
|
240 |
}
|
241 |
|
242 |
-
return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
|
243 |
}
|
244 |
|
245 |
/**
|
236 |
$image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
|
237 |
|
238 |
if (isset($args['lazy_image']) && $args['lazy_image']) {
|
239 |
+
$image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
|
240 |
}
|
241 |
|
242 |
+
return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\”allow\”, \”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\”),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
|
243 |
}
|
244 |
|
245 |
/**
|