Version Description
Enhancement: Allow <a>
tags to lazyload background images
Enhancement: Add
Download this release
Release Info
Developer | wp_media |
Plugin | Lazy Load by WP Rocket |
Version | 2.3.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.3 to 2.3.4
- assets/js/16.1/lazyload.js +733 -0
- assets/js/16.1/lazyload.min.js +1 -0
- composer.json +6 -5
- readme.txt +23 -11
- rocket-lazy-load.php +2 -2
- src/Dependencies/RocketLazyload/Assets.php +12 -12
- src/Dependencies/RocketLazyload/Image.php +150 -13
- src/Subscriber/LazyloadSubscriber.php +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +0 -192
- vendor/composer/autoload_psr4.php +0 -3
- vendor/composer/autoload_real.php +7 -4
- vendor/composer/autoload_static.php +3 -223
- vendor/composer/installed.json +12 -154
- vendor/container-interop/container-interop/.gitignore +0 -3
- vendor/container-interop/container-interop/LICENSE +0 -20
- vendor/container-interop/container-interop/README.md +0 -148
- vendor/container-interop/container-interop/composer.json +0 -15
- vendor/container-interop/container-interop/docs/ContainerInterface-meta.md +0 -114
- vendor/container-interop/container-interop/docs/ContainerInterface.md +0 -158
- vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md +0 -259
- vendor/container-interop/container-interop/docs/Delegate-lookup.md +0 -60
- vendor/container-interop/container-interop/docs/images/interoperating_containers.png +0 -0
- vendor/container-interop/container-interop/docs/images/priority.png +0 -0
- vendor/container-interop/container-interop/docs/images/side_by_side_containers.png +0 -0
- vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php +0 -15
- vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php +0 -15
- vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php +0 -15
- vendor/league/container/CHANGELOG.md +0 -123
- vendor/league/container/CONTRIBUTING.md +0 -29
- vendor/league/container/LICENSE.md +0 -21
- vendor/league/container/README.md +0 -69
- vendor/league/container/composer.json +0 -53
- vendor/league/container/src/Argument/ArgumentResolverInterface.php +0 -26
- vendor/league/container/src/Argument/ArgumentResolverTrait.php +0 -82
- vendor/league/container/src/Argument/RawArgument.php +0 -27
- vendor/league/container/src/Argument/RawArgumentInterface.php +0 -13
- vendor/league/container/src/Container.php +0 -305
- vendor/league/container/src/ContainerAwareInterface.php +0 -20
- vendor/league/container/src/ContainerAwareTrait.php +0 -34
- vendor/league/container/src/ContainerInterface.php +0 -59
- vendor/league/container/src/Definition/AbstractDefinition.php +0 -62
- vendor/league/container/src/Definition/CallableDefinition.php +0 -23
- vendor/league/container/src/Definition/ClassDefinition.php +0 -67
- vendor/league/container/src/Definition/ClassDefinitionInterface.php +0 -23
- vendor/league/container/src/Definition/DefinitionFactory.php +0 -28
- vendor/league/container/src/Definition/DefinitionFactoryInterface.php +0 -17
- vendor/league/container/src/Definition/DefinitionInterface.php +0 -30
- vendor/league/container/src/Exception/NotFoundException.php +0 -10
- vendor/league/container/src/ImmutableContainerAwareInterface.php +0 -22
- vendor/league/container/src/ImmutableContainerAwareTrait.php +0 -36
- vendor/league/container/src/ImmutableContainerInterface.php +0 -10
- vendor/league/container/src/Inflector/Inflector.php +0 -103
- vendor/league/container/src/Inflector/InflectorAggregate.php +0 -53
- vendor/league/container/src/Inflector/InflectorAggregateInterface.php +0 -25
- vendor/league/container/src/ReflectionContainer.php +0 -87
- vendor/league/container/src/ServiceProvider/AbstractServiceProvider.php +0 -27
- vendor/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php +0 -31
- vendor/league/container/src/ServiceProvider/BootableServiceProviderInterface.php +0 -14
- vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php +0 -88
- vendor/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php +0 -32
- vendor/league/container/src/ServiceProvider/ServiceProviderInterface.php +0 -26
- vendor/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php +0 -24
- vendor/psr/container/.gitignore +0 -3
- vendor/psr/container/LICENSE +0 -21
- vendor/psr/container/README.md +0 -5
- vendor/psr/container/composer.json +0 -27
- vendor/psr/container/src/ContainerExceptionInterface.php +0 -13
- vendor/psr/container/src/ContainerInterface.php +0 -37
- vendor/psr/container/src/NotFoundExceptionInterface.php +0 -13
- vendor/wp-media/rocket-lazyload-common/src/Assets.php +12 -12
- vendor/wp-media/rocket-lazyload-common/src/Image.php +150 -13
assets/js/16.1/lazyload.js
ADDED
@@ -0,0 +1,733 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function (global, factory) {
|
2 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
3 |
+
typeof define === 'function' && define.amd ? define(factory) :
|
4 |
+
(global = global || self, global.LazyLoad = factory());
|
5 |
+
}(this, (function () { 'use strict';
|
6 |
+
|
7 |
+
function _extends() {
|
8 |
+
_extends = Object.assign || function (target) {
|
9 |
+
for (var i = 1; i < arguments.length; i++) {
|
10 |
+
var source = arguments[i];
|
11 |
+
|
12 |
+
for (var key in source) {
|
13 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
14 |
+
target[key] = source[key];
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
return target;
|
20 |
+
};
|
21 |
+
|
22 |
+
return _extends.apply(this, arguments);
|
23 |
+
}
|
24 |
+
|
25 |
+
var runningOnBrowser = typeof window !== "undefined";
|
26 |
+
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
|
27 |
+
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
|
28 |
+
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
|
29 |
+
var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1;
|
30 |
+
|
31 |
+
var defaultSettings = {
|
32 |
+
elements_selector: "IMG",
|
33 |
+
container: isBot || runningOnBrowser ? document : null,
|
34 |
+
threshold: 300,
|
35 |
+
thresholds: null,
|
36 |
+
data_src: "src",
|
37 |
+
data_srcset: "srcset",
|
38 |
+
data_sizes: "sizes",
|
39 |
+
data_bg: "bg",
|
40 |
+
data_bg_hidpi: "bg-hidpi",
|
41 |
+
data_bg_multi: "bg-multi",
|
42 |
+
data_bg_multi_hidpi: "bg-multi-hidpi",
|
43 |
+
data_poster: "poster",
|
44 |
+
class_applied: "applied",
|
45 |
+
class_loading: "loading",
|
46 |
+
class_loaded: "loaded",
|
47 |
+
class_error: "error",
|
48 |
+
unobserve_completed: true,
|
49 |
+
unobserve_entered: false,
|
50 |
+
cancel_on_exit: false,
|
51 |
+
callback_enter: null,
|
52 |
+
callback_exit: null,
|
53 |
+
callback_applied: null,
|
54 |
+
callback_loading: null,
|
55 |
+
callback_loaded: null,
|
56 |
+
callback_error: null,
|
57 |
+
callback_finish: null,
|
58 |
+
callback_cancel: null,
|
59 |
+
use_native: false
|
60 |
+
};
|
61 |
+
var getExtendedSettings = function getExtendedSettings(customSettings) {
|
62 |
+
return _extends({}, defaultSettings, customSettings);
|
63 |
+
};
|
64 |
+
|
65 |
+
/* Creates instance and notifies it through the window element */
|
66 |
+
var createInstance = function createInstance(classObj, options) {
|
67 |
+
var event;
|
68 |
+
var eventString = "LazyLoad::Initialized";
|
69 |
+
var instance = new classObj(options);
|
70 |
+
|
71 |
+
try {
|
72 |
+
// Works in modern browsers
|
73 |
+
event = new CustomEvent(eventString, {
|
74 |
+
detail: {
|
75 |
+
instance: instance
|
76 |
+
}
|
77 |
+
});
|
78 |
+
} catch (err) {
|
79 |
+
// Works in Internet Explorer (all versions)
|
80 |
+
event = document.createEvent("CustomEvent");
|
81 |
+
event.initCustomEvent(eventString, false, false, {
|
82 |
+
instance: instance
|
83 |
+
});
|
84 |
+
}
|
85 |
+
|
86 |
+
window.dispatchEvent(event);
|
87 |
+
};
|
88 |
+
/* Auto initialization of one or more instances of lazyload, depending on the
|
89 |
+
options passed in (plain object or an array) */
|
90 |
+
|
91 |
+
|
92 |
+
var autoInitialize = function autoInitialize(classObj, options) {
|
93 |
+
if (!options) {
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
|
97 |
+
if (!options.length) {
|
98 |
+
// Plain object
|
99 |
+
createInstance(classObj, options);
|
100 |
+
} else {
|
101 |
+
// Array of objects
|
102 |
+
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
|
103 |
+
createInstance(classObj, optionsItem);
|
104 |
+
}
|
105 |
+
}
|
106 |
+
};
|
107 |
+
|
108 |
+
var statusLoading = "loading";
|
109 |
+
var statusLoaded = "loaded";
|
110 |
+
var statusApplied = "applied";
|
111 |
+
var statusError = "error";
|
112 |
+
var statusNative = "native";
|
113 |
+
|
114 |
+
var dataPrefix = "data-";
|
115 |
+
var statusDataName = "ll-status";
|
116 |
+
var getData = function getData(element, attribute) {
|
117 |
+
return element.getAttribute(dataPrefix + attribute);
|
118 |
+
};
|
119 |
+
var setData = function setData(element, attribute, value) {
|
120 |
+
var attrName = dataPrefix + attribute;
|
121 |
+
|
122 |
+
if (value === null) {
|
123 |
+
element.removeAttribute(attrName);
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
element.setAttribute(attrName, value);
|
128 |
+
};
|
129 |
+
var getStatus = function getStatus(element) {
|
130 |
+
return getData(element, statusDataName);
|
131 |
+
};
|
132 |
+
var setStatus = function setStatus(element, status) {
|
133 |
+
return setData(element, statusDataName, status);
|
134 |
+
};
|
135 |
+
var resetStatus = function resetStatus(element) {
|
136 |
+
return setStatus(element, null);
|
137 |
+
};
|
138 |
+
var hasEmptyStatus = function hasEmptyStatus(element) {
|
139 |
+
return getStatus(element) === null;
|
140 |
+
};
|
141 |
+
var hasStatusLoading = function hasStatusLoading(element) {
|
142 |
+
return getStatus(element) === statusLoading;
|
143 |
+
};
|
144 |
+
var hasStatusError = function hasStatusError(element) {
|
145 |
+
return getStatus(element) === statusError;
|
146 |
+
};
|
147 |
+
var hasStatusNative = function hasStatusNative(element) {
|
148 |
+
return getStatus(element) === statusNative;
|
149 |
+
};
|
150 |
+
var hadStartedLoading = function hadStartedLoading(element) {
|
151 |
+
return !hasEmptyStatus(element);
|
152 |
+
};
|
153 |
+
|
154 |
+
var safeCallback = function safeCallback(callback, arg1, arg2, arg3) {
|
155 |
+
if (!callback) {
|
156 |
+
return;
|
157 |
+
}
|
158 |
+
|
159 |
+
if (arg3 !== undefined) {
|
160 |
+
callback(arg1, arg2, arg3);
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
|
164 |
+
if (arg2 !== undefined) {
|
165 |
+
callback(arg1, arg2);
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
callback(arg1);
|
170 |
+
};
|
171 |
+
|
172 |
+
var addClass = function addClass(element, className) {
|
173 |
+
if (supportsClassList) {
|
174 |
+
element.classList.add(className);
|
175 |
+
return;
|
176 |
+
}
|
177 |
+
|
178 |
+
element.className += (element.className ? " " : "") + className;
|
179 |
+
};
|
180 |
+
var removeClass = function removeClass(element, className) {
|
181 |
+
if (supportsClassList) {
|
182 |
+
element.classList.remove(className);
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
|
186 |
+
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
187 |
+
};
|
188 |
+
|
189 |
+
var addTempImage = function addTempImage(element) {
|
190 |
+
element.llTempImage = document.createElement("IMG");
|
191 |
+
};
|
192 |
+
var deleteTempImage = function deleteTempImage(element) {
|
193 |
+
delete element.llTempImage;
|
194 |
+
};
|
195 |
+
var getTempImage = function getTempImage(element) {
|
196 |
+
return element.llTempImage;
|
197 |
+
};
|
198 |
+
|
199 |
+
var unobserve = function unobserve(element, instance) {
|
200 |
+
if (!instance) return;
|
201 |
+
var observer = instance._observer;
|
202 |
+
if (!observer) return;
|
203 |
+
observer.unobserve(element);
|
204 |
+
};
|
205 |
+
var resetObserver = function resetObserver(observer) {
|
206 |
+
observer.disconnect();
|
207 |
+
};
|
208 |
+
var unobserveIfRequired = function unobserveIfRequired(element, settings, instance) {
|
209 |
+
if (settings.unobserve_entered) unobserve(element, instance);
|
210 |
+
};
|
211 |
+
|
212 |
+
var updateLoadingCount = function updateLoadingCount(instance, delta) {
|
213 |
+
if (!instance) return;
|
214 |
+
instance.loadingCount += delta;
|
215 |
+
};
|
216 |
+
var decreaseToLoadCount = function decreaseToLoadCount(instance) {
|
217 |
+
if (!instance) return;
|
218 |
+
instance.toLoadCount -= 1;
|
219 |
+
};
|
220 |
+
var setToLoadCount = function setToLoadCount(instance, value) {
|
221 |
+
if (!instance) return;
|
222 |
+
instance.toLoadCount = value;
|
223 |
+
};
|
224 |
+
var isSomethingLoading = function isSomethingLoading(instance) {
|
225 |
+
return instance.loadingCount > 0;
|
226 |
+
};
|
227 |
+
var haveElementsToLoad = function haveElementsToLoad(instance) {
|
228 |
+
return instance.toLoadCount > 0;
|
229 |
+
};
|
230 |
+
|
231 |
+
var getSourceTags = function getSourceTags(parentTag) {
|
232 |
+
var sourceTags = [];
|
233 |
+
|
234 |
+
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
|
235 |
+
if (childTag.tagName === "SOURCE") {
|
236 |
+
sourceTags.push(childTag);
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
return sourceTags;
|
241 |
+
};
|
242 |
+
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
|
243 |
+
if (!value) {
|
244 |
+
return;
|
245 |
+
}
|
246 |
+
|
247 |
+
element.setAttribute(attrName, value);
|
248 |
+
};
|
249 |
+
var resetAttribute = function resetAttribute(element, attrName) {
|
250 |
+
element.removeAttribute(attrName);
|
251 |
+
};
|
252 |
+
var hasOriginalAttributes = function hasOriginalAttributes(element) {
|
253 |
+
return !!element.llOriginalAttrs;
|
254 |
+
};
|
255 |
+
var saveOriginalImageAttributes = function saveOriginalImageAttributes(element) {
|
256 |
+
if (hasOriginalAttributes(element)) {
|
257 |
+
return;
|
258 |
+
}
|
259 |
+
|
260 |
+
var originalAttributes = {};
|
261 |
+
originalAttributes["src"] = element.getAttribute("src");
|
262 |
+
originalAttributes["srcset"] = element.getAttribute("srcset");
|
263 |
+
originalAttributes["sizes"] = element.getAttribute("sizes");
|
264 |
+
element.llOriginalAttrs = originalAttributes;
|
265 |
+
};
|
266 |
+
var restoreOriginalImageAttributes = function restoreOriginalImageAttributes(element) {
|
267 |
+
if (!hasOriginalAttributes(element)) {
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
|
271 |
+
var originalAttributes = element.llOriginalAttrs;
|
272 |
+
setAttributeIfValue(element, "src", originalAttributes["src"]);
|
273 |
+
setAttributeIfValue(element, "srcset", originalAttributes["srcset"]);
|
274 |
+
setAttributeIfValue(element, "sizes", originalAttributes["sizes"]);
|
275 |
+
};
|
276 |
+
var setImageAttributes = function setImageAttributes(element, settings) {
|
277 |
+
setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes));
|
278 |
+
setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset));
|
279 |
+
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
280 |
+
};
|
281 |
+
var resetImageAttributes = function resetImageAttributes(element) {
|
282 |
+
resetAttribute(element, "src");
|
283 |
+
resetAttribute(element, "srcset");
|
284 |
+
resetAttribute(element, "sizes");
|
285 |
+
};
|
286 |
+
var forEachPictureSource = function forEachPictureSource(element, fn) {
|
287 |
+
var parent = element.parentNode;
|
288 |
+
|
289 |
+
if (!parent || parent.tagName !== "PICTURE") {
|
290 |
+
return;
|
291 |
+
}
|
292 |
+
|
293 |
+
var sourceTags = getSourceTags(parent);
|
294 |
+
sourceTags.forEach(fn);
|
295 |
+
};
|
296 |
+
var forEachVideoSource = function forEachVideoSource(element, fn) {
|
297 |
+
var sourceTags = getSourceTags(element);
|
298 |
+
sourceTags.forEach(fn);
|
299 |
+
};
|
300 |
+
var restoreOriginalAttributesImg = function restoreOriginalAttributesImg(element) {
|
301 |
+
forEachPictureSource(element, function (sourceTag) {
|
302 |
+
restoreOriginalImageAttributes(sourceTag);
|
303 |
+
});
|
304 |
+
restoreOriginalImageAttributes(element);
|
305 |
+
};
|
306 |
+
var setSourcesImg = function setSourcesImg(element, settings) {
|
307 |
+
forEachPictureSource(element, function (sourceTag) {
|
308 |
+
saveOriginalImageAttributes(sourceTag);
|
309 |
+
setImageAttributes(sourceTag, settings);
|
310 |
+
});
|
311 |
+
saveOriginalImageAttributes(element);
|
312 |
+
setImageAttributes(element, settings);
|
313 |
+
};
|
314 |
+
var resetSourcesImg = function resetSourcesImg(element) {
|
315 |
+
forEachPictureSource(element, function (sourceTag) {
|
316 |
+
resetImageAttributes(sourceTag);
|
317 |
+
});
|
318 |
+
resetImageAttributes(element);
|
319 |
+
};
|
320 |
+
var setSourcesIframe = function setSourcesIframe(element, settings) {
|
321 |
+
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
322 |
+
};
|
323 |
+
var setSourcesVideo = function setSourcesVideo(element, settings) {
|
324 |
+
forEachVideoSource(element, function (sourceTag) {
|
325 |
+
setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src));
|
326 |
+
});
|
327 |
+
setAttributeIfValue(element, "poster", getData(element, settings.data_poster));
|
328 |
+
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
329 |
+
element.load();
|
330 |
+
};
|
331 |
+
var setSourcesFunctions = {
|
332 |
+
IMG: setSourcesImg,
|
333 |
+
IFRAME: setSourcesIframe,
|
334 |
+
VIDEO: setSourcesVideo
|
335 |
+
};
|
336 |
+
var setBackground = function setBackground(element, settings, instance) {
|
337 |
+
var bg1xValue = getData(element, settings.data_bg);
|
338 |
+
var bgHiDpiValue = getData(element, settings.data_bg_hidpi);
|
339 |
+
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
|
340 |
+
if (!bgDataValue) return;
|
341 |
+
element.style.backgroundImage = "url(\"".concat(bgDataValue, "\")");
|
342 |
+
getTempImage(element).setAttribute("src", bgDataValue);
|
343 |
+
manageLoading(element, settings, instance);
|
344 |
+
}; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg
|
345 |
+
// BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM
|
346 |
+
// COULD BE A GRADIENT BACKGROUND IMAGE
|
347 |
+
|
348 |
+
var setMultiBackground = function setMultiBackground(element, settings, instance) {
|
349 |
+
var bg1xValue = getData(element, settings.data_bg_multi);
|
350 |
+
var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi);
|
351 |
+
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
|
352 |
+
|
353 |
+
if (!bgDataValue) {
|
354 |
+
return;
|
355 |
+
}
|
356 |
+
|
357 |
+
element.style.backgroundImage = bgDataValue;
|
358 |
+
manageApplied(element, settings, instance);
|
359 |
+
};
|
360 |
+
var setSources = function setSources(element, settings) {
|
361 |
+
var setSourcesFunction = setSourcesFunctions[element.tagName];
|
362 |
+
|
363 |
+
if (!setSourcesFunction) {
|
364 |
+
return;
|
365 |
+
}
|
366 |
+
|
367 |
+
setSourcesFunction(element, settings);
|
368 |
+
};
|
369 |
+
var manageApplied = function manageApplied(element, settings, instance) {
|
370 |
+
addClass(element, settings.class_applied);
|
371 |
+
setStatus(element, statusApplied);
|
372 |
+
removeDataMultiBackground(element, settings);
|
373 |
+
|
374 |
+
if (settings.unobserve_completed) {
|
375 |
+
// Unobserve now because we can't do it on load
|
376 |
+
unobserve(element, settings);
|
377 |
+
}
|
378 |
+
|
379 |
+
safeCallback(settings.callback_applied, element, instance);
|
380 |
+
};
|
381 |
+
var manageLoading = function manageLoading(element, settings, instance) {
|
382 |
+
updateLoadingCount(instance, +1);
|
383 |
+
addClass(element, settings.class_loading);
|
384 |
+
setStatus(element, statusLoading);
|
385 |
+
safeCallback(settings.callback_loading, element, instance);
|
386 |
+
}; // REMOVE DATA ATTRIBUTES --------------
|
387 |
+
|
388 |
+
var removeDataImg = function removeDataImg(element, settings) {
|
389 |
+
setData(element, settings.data_src, null);
|
390 |
+
setData(element, settings.data_srcset, null);
|
391 |
+
setData(element, settings.data_sizes, null);
|
392 |
+
forEachPictureSource(element, function (sourceTag) {
|
393 |
+
setData(sourceTag, settings.data_srcset, null);
|
394 |
+
setData(sourceTag, settings.data_sizes, null);
|
395 |
+
});
|
396 |
+
};
|
397 |
+
var removeDataIframe = function removeDataIframe(element, settings) {
|
398 |
+
setData(element, settings.data_src, null);
|
399 |
+
};
|
400 |
+
var removeDataVideo = function removeDataVideo(element, settings) {
|
401 |
+
setData(element, settings.data_src, null);
|
402 |
+
setData(element, settings.data_poster, null);
|
403 |
+
forEachVideoSource(element, function (sourceTag) {
|
404 |
+
setData(sourceTag, settings.data_src, null);
|
405 |
+
});
|
406 |
+
};
|
407 |
+
var removeDataFunctions = {
|
408 |
+
IMG: removeDataImg,
|
409 |
+
IFRAME: removeDataIframe,
|
410 |
+
VIDEO: removeDataVideo
|
411 |
+
};
|
412 |
+
var removeDataBackground = function removeDataBackground(element, settings) {
|
413 |
+
setData(element, settings.data_bg, null);
|
414 |
+
setData(element, settings.data_bg_hidpi, null);
|
415 |
+
};
|
416 |
+
var removeDataMultiBackground = function removeDataMultiBackground(element, settings) {
|
417 |
+
setData(element, settings.data_bg_multi, null);
|
418 |
+
setData(element, settings.data_bg_multi_hidpi, null);
|
419 |
+
};
|
420 |
+
var removeDataAttributes = function removeDataAttributes(element, settings) {
|
421 |
+
var removeDataFunction = removeDataFunctions[element.tagName];
|
422 |
+
|
423 |
+
if (removeDataFunction) {
|
424 |
+
removeDataFunction(element, settings);
|
425 |
+
return;
|
426 |
+
}
|
427 |
+
|
428 |
+
removeDataBackground(element, settings);
|
429 |
+
};
|
430 |
+
|
431 |
+
var elementsWithLoadEvent = ["IMG", "IFRAME", "VIDEO"];
|
432 |
+
var hasLoadEvent = function hasLoadEvent(element) {
|
433 |
+
return elementsWithLoadEvent.indexOf(element.tagName) > -1;
|
434 |
+
};
|
435 |
+
var checkFinish = function checkFinish(settings, instance) {
|
436 |
+
if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) {
|
437 |
+
safeCallback(settings.callback_finish, instance);
|
438 |
+
}
|
439 |
+
};
|
440 |
+
var addEventListener = function addEventListener(element, eventName, handler) {
|
441 |
+
element.addEventListener(eventName, handler);
|
442 |
+
element.llEvLisnrs[eventName] = handler;
|
443 |
+
};
|
444 |
+
var removeEventListener = function removeEventListener(element, eventName, handler) {
|
445 |
+
element.removeEventListener(eventName, handler);
|
446 |
+
};
|
447 |
+
var hasEventListeners = function hasEventListeners(element) {
|
448 |
+
return !!element.llEvLisnrs;
|
449 |
+
};
|
450 |
+
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
|
451 |
+
if (!hasEventListeners(element)) element.llEvLisnrs = {};
|
452 |
+
var loadEventName = element.tagName === "VIDEO" ? "loadeddata" : "load";
|
453 |
+
addEventListener(element, loadEventName, loadHandler);
|
454 |
+
addEventListener(element, "error", errorHandler);
|
455 |
+
};
|
456 |
+
var removeEventListeners = function removeEventListeners(element) {
|
457 |
+
if (!hasEventListeners(element)) {
|
458 |
+
return;
|
459 |
+
}
|
460 |
+
|
461 |
+
var eventListeners = element.llEvLisnrs;
|
462 |
+
|
463 |
+
for (var eventName in eventListeners) {
|
464 |
+
var handler = eventListeners[eventName];
|
465 |
+
removeEventListener(element, eventName, handler);
|
466 |
+
}
|
467 |
+
|
468 |
+
delete element.llEvLisnrs;
|
469 |
+
};
|
470 |
+
var doneHandler = function doneHandler(element, settings, instance) {
|
471 |
+
deleteTempImage(element);
|
472 |
+
updateLoadingCount(instance, -1);
|
473 |
+
decreaseToLoadCount(instance);
|
474 |
+
removeClass(element, settings.class_loading);
|
475 |
+
|
476 |
+
if (settings.unobserve_completed) {
|
477 |
+
unobserve(element, instance);
|
478 |
+
}
|
479 |
+
};
|
480 |
+
var loadHandler = function loadHandler(event, element, settings, instance) {
|
481 |
+
var goingNative = hasStatusNative(element);
|
482 |
+
doneHandler(element, settings, instance);
|
483 |
+
addClass(element, settings.class_loaded);
|
484 |
+
setStatus(element, statusLoaded);
|
485 |
+
removeDataAttributes(element, settings);
|
486 |
+
safeCallback(settings.callback_loaded, element, instance);
|
487 |
+
if (!goingNative) checkFinish(settings, instance);
|
488 |
+
};
|
489 |
+
var errorHandler = function errorHandler(event, element, settings, instance) {
|
490 |
+
var goingNative = hasStatusNative(element);
|
491 |
+
doneHandler(element, settings, instance);
|
492 |
+
addClass(element, settings.class_error);
|
493 |
+
setStatus(element, statusError);
|
494 |
+
safeCallback(settings.callback_error, element, instance);
|
495 |
+
if (!goingNative) checkFinish(settings, instance);
|
496 |
+
};
|
497 |
+
var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) {
|
498 |
+
var elementToListenTo = getTempImage(element) || element;
|
499 |
+
|
500 |
+
if (hasEventListeners(elementToListenTo)) {
|
501 |
+
// This happens when loading is retried twice
|
502 |
+
return;
|
503 |
+
}
|
504 |
+
|
505 |
+
var _loadHandler = function _loadHandler(event) {
|
506 |
+
loadHandler(event, element, settings, instance);
|
507 |
+
removeEventListeners(elementToListenTo);
|
508 |
+
};
|
509 |
+
|
510 |
+
var _errorHandler = function _errorHandler(event) {
|
511 |
+
errorHandler(event, element, settings, instance);
|
512 |
+
removeEventListeners(elementToListenTo);
|
513 |
+
};
|
514 |
+
|
515 |
+
addEventListeners(elementToListenTo, _loadHandler, _errorHandler);
|
516 |
+
};
|
517 |
+
|
518 |
+
var loadBackground = function loadBackground(element, settings, instance) {
|
519 |
+
addTempImage(element);
|
520 |
+
addOneShotEventListeners(element, settings, instance);
|
521 |
+
setBackground(element, settings, instance);
|
522 |
+
setMultiBackground(element, settings, instance);
|
523 |
+
};
|
524 |
+
|
525 |
+
var loadRegular = function loadRegular(element, settings, instance) {
|
526 |
+
addOneShotEventListeners(element, settings, instance);
|
527 |
+
setSources(element, settings);
|
528 |
+
manageLoading(element, settings, instance);
|
529 |
+
};
|
530 |
+
|
531 |
+
var load = function load(element, settings, instance) {
|
532 |
+
if (hasLoadEvent(element)) {
|
533 |
+
loadRegular(element, settings, instance);
|
534 |
+
} else {
|
535 |
+
loadBackground(element, settings, instance);
|
536 |
+
}
|
537 |
+
};
|
538 |
+
var loadNative = function loadNative(element, settings, instance) {
|
539 |
+
addOneShotEventListeners(element, settings, instance);
|
540 |
+
setSources(element, settings);
|
541 |
+
removeDataAttributes(element, settings);
|
542 |
+
setStatus(element, statusNative);
|
543 |
+
};
|
544 |
+
|
545 |
+
var cancelLoadingIfRequired = function cancelLoadingIfRequired(element, entry, settings, instance) {
|
546 |
+
if (!settings.cancel_on_exit) return;
|
547 |
+
if (!hasStatusLoading(element)) return;
|
548 |
+
if (element.tagName !== "IMG") return; //Works only on images
|
549 |
+
|
550 |
+
removeEventListeners(element);
|
551 |
+
resetSourcesImg(element);
|
552 |
+
restoreOriginalAttributesImg(element);
|
553 |
+
removeClass(element, settings.class_loading);
|
554 |
+
updateLoadingCount(instance, -1);
|
555 |
+
resetStatus(element);
|
556 |
+
safeCallback(settings.callback_cancel, element, entry, instance);
|
557 |
+
};
|
558 |
+
|
559 |
+
var onEnter = function onEnter(element, entry, settings, instance) {
|
560 |
+
safeCallback(settings.callback_enter, element, entry, instance);
|
561 |
+
unobserveIfRequired(element, settings, instance);
|
562 |
+
if (hadStartedLoading(element)) return; //Prevent loading it again
|
563 |
+
|
564 |
+
load(element, settings, instance);
|
565 |
+
};
|
566 |
+
var onExit = function onExit(element, entry, settings, instance) {
|
567 |
+
if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing
|
568 |
+
|
569 |
+
cancelLoadingIfRequired(element, entry, settings, instance);
|
570 |
+
safeCallback(settings.callback_exit, element, entry, instance);
|
571 |
+
};
|
572 |
+
|
573 |
+
var tagsWithNativeLazy = ["IMG", "IFRAME"];
|
574 |
+
var shouldUseNative = function shouldUseNative(settings) {
|
575 |
+
return settings.use_native && "loading" in HTMLImageElement.prototype;
|
576 |
+
};
|
577 |
+
var loadAllNative = function loadAllNative(elements, settings, instance) {
|
578 |
+
elements.forEach(function (element) {
|
579 |
+
if (tagsWithNativeLazy.indexOf(element.tagName) === -1) {
|
580 |
+
return;
|
581 |
+
}
|
582 |
+
|
583 |
+
element.setAttribute("loading", "lazy"); //TODO: Move inside the loadNative method
|
584 |
+
|
585 |
+
loadNative(element, settings, instance);
|
586 |
+
});
|
587 |
+
setToLoadCount(instance, 0);
|
588 |
+
};
|
589 |
+
|
590 |
+
var isIntersecting = function isIntersecting(entry) {
|
591 |
+
return entry.isIntersecting || entry.intersectionRatio > 0;
|
592 |
+
};
|
593 |
+
|
594 |
+
var getObserverSettings = function getObserverSettings(settings) {
|
595 |
+
return {
|
596 |
+
root: settings.container === document ? null : settings.container,
|
597 |
+
rootMargin: settings.thresholds || settings.threshold + "px"
|
598 |
+
};
|
599 |
+
};
|
600 |
+
|
601 |
+
var intersectionHandler = function intersectionHandler(entries, settings, instance) {
|
602 |
+
entries.forEach(function (entry) {
|
603 |
+
return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance);
|
604 |
+
});
|
605 |
+
};
|
606 |
+
|
607 |
+
var observeElements = function observeElements(observer, elements) {
|
608 |
+
elements.forEach(function (element) {
|
609 |
+
observer.observe(element);
|
610 |
+
});
|
611 |
+
};
|
612 |
+
var updateObserver = function updateObserver(observer, elementsToObserve) {
|
613 |
+
resetObserver(observer);
|
614 |
+
observeElements(observer, elementsToObserve);
|
615 |
+
};
|
616 |
+
var setObserver = function setObserver(settings, instance) {
|
617 |
+
if (!supportsIntersectionObserver || shouldUseNative(settings)) {
|
618 |
+
return;
|
619 |
+
}
|
620 |
+
|
621 |
+
instance._observer = new IntersectionObserver(function (entries) {
|
622 |
+
intersectionHandler(entries, settings, instance);
|
623 |
+
}, getObserverSettings(settings));
|
624 |
+
};
|
625 |
+
|
626 |
+
var toArray = function toArray(nodeSet) {
|
627 |
+
return Array.prototype.slice.call(nodeSet);
|
628 |
+
};
|
629 |
+
var queryElements = function queryElements(settings) {
|
630 |
+
return settings.container.querySelectorAll(settings.elements_selector);
|
631 |
+
};
|
632 |
+
var excludeManagedElements = function excludeManagedElements(elements) {
|
633 |
+
return toArray(elements).filter(hasEmptyStatus);
|
634 |
+
};
|
635 |
+
var hasError = function hasError(element) {
|
636 |
+
return hasStatusError(element);
|
637 |
+
};
|
638 |
+
var filterErrorElements = function filterErrorElements(elements) {
|
639 |
+
return toArray(elements).filter(hasError);
|
640 |
+
};
|
641 |
+
var getElementsToLoad = function getElementsToLoad(elements, settings) {
|
642 |
+
return excludeManagedElements(elements || queryElements(settings));
|
643 |
+
};
|
644 |
+
|
645 |
+
var retryLazyLoad = function retryLazyLoad(settings, instance) {
|
646 |
+
var errorElements = filterErrorElements(queryElements(settings));
|
647 |
+
errorElements.forEach(function (element) {
|
648 |
+
removeClass(element, settings.class_error);
|
649 |
+
resetStatus(element);
|
650 |
+
});
|
651 |
+
instance.update();
|
652 |
+
};
|
653 |
+
var setOnlineCheck = function setOnlineCheck(settings, instance) {
|
654 |
+
if (!runningOnBrowser) {
|
655 |
+
return;
|
656 |
+
}
|
657 |
+
|
658 |
+
window.addEventListener("online", function () {
|
659 |
+
retryLazyLoad(settings, instance);
|
660 |
+
});
|
661 |
+
};
|
662 |
+
|
663 |
+
var LazyLoad = function LazyLoad(customSettings, elements) {
|
664 |
+
var settings = getExtendedSettings(customSettings);
|
665 |
+
this._settings = settings;
|
666 |
+
this.loadingCount = 0;
|
667 |
+
setObserver(settings, this);
|
668 |
+
setOnlineCheck(settings, this);
|
669 |
+
this.update(elements);
|
670 |
+
};
|
671 |
+
|
672 |
+
LazyLoad.prototype = {
|
673 |
+
update: function update(givenNodeset) {
|
674 |
+
var settings = this._settings;
|
675 |
+
var elementsToLoad = getElementsToLoad(givenNodeset, settings);
|
676 |
+
setToLoadCount(this, elementsToLoad.length);
|
677 |
+
|
678 |
+
if (isBot || !supportsIntersectionObserver) {
|
679 |
+
this.loadAll(elementsToLoad);
|
680 |
+
return;
|
681 |
+
}
|
682 |
+
|
683 |
+
if (shouldUseNative(settings)) {
|
684 |
+
loadAllNative(elementsToLoad, settings, this);
|
685 |
+
return;
|
686 |
+
}
|
687 |
+
|
688 |
+
updateObserver(this._observer, elementsToLoad);
|
689 |
+
},
|
690 |
+
destroy: function destroy() {
|
691 |
+
// Observer
|
692 |
+
if (this._observer) {
|
693 |
+
this._observer.disconnect();
|
694 |
+
} // Clean custom attributes on elements
|
695 |
+
|
696 |
+
|
697 |
+
queryElements(this._settings).forEach(function (element) {
|
698 |
+
delete element.llOriginalAttrs;
|
699 |
+
}); // Delete all internal props
|
700 |
+
|
701 |
+
delete this._observer;
|
702 |
+
delete this._settings;
|
703 |
+
delete this.loadingCount;
|
704 |
+
delete this.toLoadCount;
|
705 |
+
},
|
706 |
+
loadAll: function loadAll(elements) {
|
707 |
+
var _this = this;
|
708 |
+
|
709 |
+
var settings = this._settings;
|
710 |
+
var elementsToLoad = getElementsToLoad(elements, settings);
|
711 |
+
elementsToLoad.forEach(function (element) {
|
712 |
+
load(element, settings, _this);
|
713 |
+
});
|
714 |
+
}
|
715 |
+
};
|
716 |
+
|
717 |
+
LazyLoad.load = function (element, customSettings) {
|
718 |
+
var settings = getExtendedSettings(customSettings);
|
719 |
+
load(element, settings);
|
720 |
+
};
|
721 |
+
|
722 |
+
LazyLoad.resetStatus = function (element) {
|
723 |
+
resetStatus(element);
|
724 |
+
}; // Automatic instances creation if required (useful for async script loading)
|
725 |
+
|
726 |
+
|
727 |
+
if (runningOnBrowser) {
|
728 |
+
autoInitialize(LazyLoad, window.lazyLoadOptions);
|
729 |
+
}
|
730 |
+
|
731 |
+
return LazyLoad;
|
732 |
+
|
733 |
+
})));
|
assets/js/16.1/lazyload.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).LazyLoad=n()}(this,(function(){"use strict";function t(){return(t=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t}).apply(this,arguments)}var n="undefined"!=typeof window,e=n&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),i=n&&"IntersectionObserver"in window,a=n&&"classList"in document.createElement("p"),o=n&&window.devicePixelRatio>1,r={elements_selector:"IMG",container:e||n?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!1,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},c=function(n){return t({},r,n)},l=function(t,n){var e,i=new t(n);try{e=new CustomEvent("LazyLoad::Initialized",{detail:{instance:i}})}catch(t){(e=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:i})}window.dispatchEvent(e)},s=function(t,n){return t.getAttribute("data-"+n)},u=function(t,n,e){var i="data-"+n;null!==e?t.setAttribute(i,e):t.removeAttribute(i)},d=function(t){return s(t,"ll-status")},f=function(t,n){return u(t,"ll-status",n)},_=function(t){return f(t,null)},g=function(t){return null===d(t)},v=function(t){return"native"===d(t)},b=function(t,n,e,i){t&&(void 0===i?void 0===e?t(n):t(n,e):t(n,e,i))},p=function(t,n){a?t.classList.add(n):t.className+=(t.className?" ":"")+n},h=function(t,n){a?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\s+)"+n+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},m=function(t){return t.llTempImage},E=function(t,n){if(n){var e=n._observer;e&&e.unobserve(t)}},I=function(t,n){t&&(t.loadingCount+=n)},A=function(t,n){t&&(t.toLoadCount=n)},L=function(t){for(var n,e=[],i=0;n=t.children[i];i+=1)"SOURCE"===n.tagName&&e.push(n);return e},y=function(t,n,e){e&&t.setAttribute(n,e)},w=function(t,n){t.removeAttribute(n)},k=function(t){return!!t.llOriginalAttrs},z=function(t){if(!k(t)){var n={};n.src=t.getAttribute("src"),n.srcset=t.getAttribute("srcset"),n.sizes=t.getAttribute("sizes"),t.llOriginalAttrs=n}},O=function(t){if(k(t)){var n=t.llOriginalAttrs;y(t,"src",n.src),y(t,"srcset",n.srcset),y(t,"sizes",n.sizes)}},C=function(t,n){y(t,"sizes",s(t,n.data_sizes)),y(t,"srcset",s(t,n.data_srcset)),y(t,"src",s(t,n.data_src))},M=function(t){w(t,"src"),w(t,"srcset"),w(t,"sizes")},N=function(t,n){var e=t.parentNode;e&&"PICTURE"===e.tagName&&L(e).forEach(n)},x=function(t,n){L(t).forEach(n)},R={IMG:function(t,n){N(t,(function(t){z(t),C(t,n)})),z(t),C(t,n)},IFRAME:function(t,n){y(t,"src",s(t,n.data_src))},VIDEO:function(t,n){x(t,(function(t){y(t,"src",s(t,n.data_src))})),y(t,"poster",s(t,n.data_poster)),y(t,"src",s(t,n.data_src)),t.load()}},G=function(t,n){var e=R[t.tagName];e&&e(t,n)},T=function(t,n,e){I(e,1),p(t,n.class_loading),f(t,"loading"),b(n.callback_loading,t,e)},D={IMG:function(t,n){u(t,n.data_src,null),u(t,n.data_srcset,null),u(t,n.data_sizes,null),N(t,(function(t){u(t,n.data_srcset,null),u(t,n.data_sizes,null)}))},IFRAME:function(t,n){u(t,n.data_src,null)},VIDEO:function(t,n){u(t,n.data_src,null),u(t,n.data_poster,null),x(t,(function(t){u(t,n.data_src,null)}))}},F=function(t,n){u(t,n.data_bg_multi,null),u(t,n.data_bg_multi_hidpi,null)},V=function(t,n){var e=D[t.tagName];e?e(t,n):function(t,n){u(t,n.data_bg,null),u(t,n.data_bg_hidpi,null)}(t,n)},j=["IMG","IFRAME","VIDEO"],P=function(t,n){!n||function(t){return t.loadingCount>0}(n)||function(t){return t.toLoadCount>0}(n)||b(t.callback_finish,n)},S=function(t,n,e){t.addEventListener(n,e),t.llEvLisnrs[n]=e},U=function(t,n,e){t.removeEventListener(n,e)},$=function(t){return!!t.llEvLisnrs},q=function(t){if($(t)){var n=t.llEvLisnrs;for(var e in n){var i=n[e];U(t,e,i)}delete t.llEvLisnrs}},H=function(t,n,e){!function(t){delete t.llTempImage}(t),I(e,-1),function(t){t&&(t.toLoadCount-=1)}(e),h(t,n.class_loading),n.unobserve_completed&&E(t,e)},B=function(t,n,e){var i=m(t)||t;$(i)||function(t,n,e){$(t)||(t.llEvLisnrs={});var i="VIDEO"===t.tagName?"loadeddata":"load";S(t,i,n),S(t,"error",e)}(i,(function(a){!function(t,n,e,i){var a=v(n);H(n,e,i),p(n,e.class_loaded),f(n,"loaded"),V(n,e),b(e.callback_loaded,n,i),a||P(e,i)}(0,t,n,e),q(i)}),(function(a){!function(t,n,e,i){var a=v(n);H(n,e,i),p(n,e.class_error),f(n,"error"),b(e.callback_error,n,i),a||P(e,i)}(0,t,n,e),q(i)}))},J=function(t,n,e){!function(t){t.llTempImage=document.createElement("IMG")}(t),B(t,n,e),function(t,n,e){var i=s(t,n.data_bg),a=s(t,n.data_bg_hidpi),r=o&&a?a:i;r&&(t.style.backgroundImage='url("'.concat(r,'")'),m(t).setAttribute("src",r),T(t,n,e))}(t,n,e),function(t,n,e){var i=s(t,n.data_bg_multi),a=s(t,n.data_bg_multi_hidpi),r=o&&a?a:i;r&&(t.style.backgroundImage=r,function(t,n,e){p(t,n.class_applied),f(t,"applied"),F(t,n),n.unobserve_completed&&E(t,n),b(n.callback_applied,t,e)}(t,n,e))}(t,n,e)},K=function(t,n,e){!function(t){return j.indexOf(t.tagName)>-1}(t)?J(t,n,e):function(t,n,e){B(t,n,e),G(t,n),T(t,n,e)}(t,n,e)},Q=["IMG","IFRAME"],W=function(t){return t.use_native&&"loading"in HTMLImageElement.prototype},X=function(t,n,e){t.forEach((function(t){return function(t){return t.isIntersecting||t.intersectionRatio>0}(t)?function(t,n,e,i){b(e.callback_enter,t,n,i),function(t,n,e){n.unobserve_entered&&E(t,e)}(t,e,i),function(t){return!g(t)}(t)||K(t,e,i)}(t.target,t,n,e):function(t,n,e,i){g(t)||(function(t,n,e,i){e.cancel_on_exit&&function(t){return"loading"===d(t)}(t)&&"IMG"===t.tagName&&(q(t),function(t){N(t,(function(t){M(t)})),M(t)}(t),function(t){N(t,(function(t){O(t)})),O(t)}(t),h(t,e.class_loading),I(i,-1),_(t),b(e.callback_cancel,t,n,i))}(t,n,e,i),b(e.callback_exit,t,n,i))}(t.target,t,n,e)}))},Y=function(t){return Array.prototype.slice.call(t)},Z=function(t){return t.container.querySelectorAll(t.elements_selector)},tt=function(t){return function(t){return"error"===d(t)}(t)},nt=function(t,n){return function(t){return Y(t).filter(g)}(t||Z(n))},et=function(t,e){var a=c(t);this._settings=a,this.loadingCount=0,function(t,n){i&&!W(t)&&(n._observer=new IntersectionObserver((function(e){X(e,t,n)}),function(t){return{root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}}(t)))}(a,this),function(t,e){n&&window.addEventListener("online",(function(){!function(t,n){var e;(e=Z(t),Y(e).filter(tt)).forEach((function(n){h(n,t.class_error),_(n)})),n.update()}(t,e)}))}(a,this),this.update(e)};return et.prototype={update:function(t){var n,a,o=this._settings,r=nt(t,o);A(this,r.length),!e&&i?W(o)?function(t,n,e){t.forEach((function(t){-1!==Q.indexOf(t.tagName)&&(t.setAttribute("loading","lazy"),function(t,n,e){B(t,n,e),G(t,n),V(t,n),f(t,"native")}(t,n,e))})),A(e,0)}(r,o,this):(a=r,function(t){t.disconnect()}(n=this._observer),function(t,n){n.forEach((function(n){t.observe(n)}))}(n,a)):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),Z(this._settings).forEach((function(t){delete t.llOriginalAttrs})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){var n=this,e=this._settings;nt(t,e).forEach((function(t){K(t,e,n)}))}},et.load=function(t,n){var e=c(n);K(t,e)},et.resetStatus=function(t){_(t)},n&&function(t,n){if(n)if(n.length)for(var e,i=0;e=n[i];i+=1)l(t,e);else l(t,n)}(et,window.lazyLoadOptions),et}));
|
composer.json
CHANGED
@@ -36,12 +36,12 @@
|
|
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.
|
45 |
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
46 |
"phpcompatibility/phpcompatibility-wp": "^2.0",
|
47 |
"phpunit/phpunit": "^5.7",
|
@@ -56,18 +56,19 @@
|
|
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 |
}
|
36 |
"require": {
|
37 |
"php": ">=5.6",
|
38 |
"composer/installers": "~1.0",
|
|
|
39 |
"wp-media/rocket-lazyload-common": "^2.0"
|
40 |
},
|
41 |
"require-dev": {
|
42 |
+
"league/container": "^2.4",
|
43 |
"brain/monkey": "^2.0",
|
44 |
+
"coenjacobs/mozart": "^0.5.1",
|
45 |
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
46 |
"phpcompatibility/phpcompatibility-wp": "^2.0",
|
47 |
"phpunit/phpunit": "^5.7",
|
56 |
"packages": [
|
57 |
"wp-media/rocket-lazyload-common",
|
58 |
"league/container"
|
59 |
+
],
|
60 |
+
"delete_vendor_directories": true
|
61 |
}
|
62 |
},
|
63 |
"scripts": {
|
64 |
"test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always",
|
65 |
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist",
|
66 |
"post-install-cmd": [
|
67 |
+
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
|
68 |
"composer dump-autoload"
|
69 |
],
|
70 |
"post-update-cmd": [
|
71 |
+
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
|
72 |
"composer dump-autoload"
|
73 |
]
|
74 |
}
|
readme.txt
CHANGED
@@ -1,24 +1,26 @@
|
|
1 |
-
=== Lazy Load
|
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.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 2.3.
|
8 |
|
9 |
-
Lazy
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
Lazy Load
|
14 |
|
15 |
-
|
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 |
-
|
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.
|
@@ -79,19 +81,29 @@ add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );
|
|
79 |
|
80 |
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.
|
81 |
|
82 |
-
= How can I
|
83 |
|
84 |
-
The plugin will automatically
|
85 |
|
86 |
`<div style="background-image: url(image.jpg);">`
|
87 |
|
88 |
-
You can also apply it manually. The element you want to apply
|
89 |
|
90 |
`<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
|
91 |
|
92 |
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
93 |
|
94 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
= 2.3.3 =
|
96 |
Enhancement: Add data-skip-lazy and skip-lazy class to exclusions list as part of the interoperability initiative between lazyload plugins
|
97 |
Enhancement: Use native lazyload only if filter `rocket_use_native_lazyload` is true
|
@@ -305,7 +317,7 @@ Bugfix: Prevent wrong lazy attributes for srcset and sizes on an image inside a
|
|
305 |
|
306 |
= 1.0.2 =
|
307 |
* 2014-12-28
|
308 |
-
* Improvement: Add «
|
309 |
|
310 |
= 1.0.1.1 =
|
311 |
* 2014-07-25
|
1 |
+
=== Lazy Load ===
|
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.8
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 2.3.4
|
8 |
|
9 |
+
Lazy load your images and iframes, replace Youtube videos by a preview thumbnail.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
Lazy Load 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 |
+
You can lazy load 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 |
+
Turn on lazy load to optimize your images and make your website faster!
|
20 |
+
|
21 |
= Dependencies =
|
22 |
|
23 |
+
Lazy load script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)
|
24 |
|
25 |
= Related Plugins =
|
26 |
* [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.
|
81 |
|
82 |
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.
|
83 |
|
84 |
+
= How can I lazy load a background-image? =
|
85 |
|
86 |
+
The plugin will automatically lazy load background-images set with a `style` attribute to a `div` element:
|
87 |
|
88 |
`<div style="background-image: url(image.jpg);">`
|
89 |
|
90 |
+
You can also apply it manually. The element you want to apply lazy load on must have this specific markup:
|
91 |
|
92 |
`<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
|
93 |
|
94 |
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
95 |
|
96 |
== Changelog ==
|
97 |
+
= 2.3.4 =
|
98 |
+
Enhancement: Allow `<a>` tags to lazyload background images
|
99 |
+
Enhancement: Add <noscript> tag to lazyloaded picture elements
|
100 |
+
Bugfix: Prevent a Fatal error related to the League Container package conflict with WooCommerce 4.4
|
101 |
+
Bugfix: Update lazyload for background images support for new version of lazyload script
|
102 |
+
Bugfix: Correctly apply the rocket-lazyload class on elements with a background-image and an empty class value
|
103 |
+
Bugfix: Correctly apply the rocket-lazyloadclass on elements with malformed HTML
|
104 |
+
Bugfix: Prevent a display issue with background-images when using different types of quotes around the URL
|
105 |
+
Bugfix: Prevent Layout from breaking when <img> alt attribute has any html encoded characters
|
106 |
+
|
107 |
= 2.3.3 =
|
108 |
Enhancement: Add data-skip-lazy and skip-lazy class to exclusions list as part of the interoperability initiative between lazyload plugins
|
109 |
Enhancement: Use native lazyload only if filter `rocket_use_native_lazyload` is true
|
317 |
|
318 |
= 1.0.2 =
|
319 |
* 2014-12-28
|
320 |
+
* Improvement: Add « rocket_lazyload_html » filter to manage the output that will be printed.
|
321 |
|
322 |
= 1.0.1.1 =
|
323 |
* 2014-07-25
|
rocket-lazy-load.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Lazy Load - Optimize Images
|
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 |
* Requires PHP: 5.6
|
8 |
* Author: WP Rocket
|
9 |
* Author URI: https://wp-rocket.me
|
@@ -30,7 +30,7 @@
|
|
30 |
|
31 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
32 |
|
33 |
-
define( 'ROCKET_LL_VERSION', '2.3.
|
34 |
define( 'ROCKET_LL_WP_VERSION', '4.9' );
|
35 |
define( 'ROCKET_LL_PHP_VERSION', '5.6' );
|
36 |
define( 'ROCKET_LL_BASENAME', plugin_basename( __FILE__ ) );
|
3 |
* Plugin Name: Lazy Load - Optimize Images
|
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.4
|
7 |
* Requires PHP: 5.6
|
8 |
* Author: WP Rocket
|
9 |
* Author URI: https://wp-rocket.me
|
30 |
|
31 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
32 |
|
33 |
+
define( 'ROCKET_LL_VERSION', '2.3.4' );
|
34 |
define( 'ROCKET_LL_WP_VERSION', '4.9' );
|
35 |
define( 'ROCKET_LL_PHP_VERSION', '5.6' );
|
36 |
define( 'ROCKET_LL_BASENAME', plugin_basename( __FILE__ ) );
|
src/Dependencies/RocketLazyload/Assets.php
CHANGED
@@ -39,18 +39,18 @@ class Assets {
|
|
39 |
];
|
40 |
|
41 |
$allowed_options = [
|
42 |
-
'container'
|
43 |
-
'thresholds'
|
44 |
-
'data_bg'
|
45 |
-
'class_error'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'callback_enter'
|
49 |
-
'callback_exit'
|
50 |
-
'
|
51 |
-
'callback_error'
|
52 |
-
'callback_finish'
|
53 |
-
'use_native'
|
54 |
];
|
55 |
|
56 |
$args = wp_parse_args( $args, $defaults );
|
39 |
];
|
40 |
|
41 |
$allowed_options = [
|
42 |
+
'container' => 1,
|
43 |
+
'thresholds' => 1,
|
44 |
+
'data_bg' => 1,
|
45 |
+
'class_error' => 1,
|
46 |
+
'cancel_on_exit' => 1,
|
47 |
+
'unobserve_completed' => 1,
|
48 |
+
'callback_enter' => 1,
|
49 |
+
'callback_exit' => 1,
|
50 |
+
'callback_loading' => 1,
|
51 |
+
'callback_error' => 1,
|
52 |
+
'callback_finish' => 1,
|
53 |
+
'use_native' => 1,
|
54 |
];
|
55 |
|
56 |
$args = wp_parse_args( $args, $defaults );
|
src/Dependencies/RocketLazyload/Image.php
CHANGED
@@ -20,7 +20,9 @@ class Image {
|
|
20 |
* @return string
|
21 |
*/
|
22 |
public function lazyloadImages( $html, $buffer ) {
|
23 |
-
|
|
|
|
|
24 |
return $html;
|
25 |
}
|
26 |
|
@@ -51,7 +53,7 @@ class Image {
|
|
51 |
* @return string
|
52 |
*/
|
53 |
public function lazyloadBackgroundImages( $html, $buffer ) {
|
54 |
-
if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
|
55 |
return $html;
|
56 |
}
|
57 |
|
@@ -64,7 +66,15 @@ class Image {
|
|
64 |
continue;
|
65 |
}
|
66 |
|
67 |
-
$url['url'] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
|
70 |
continue;
|
@@ -72,7 +82,7 @@ class Image {
|
|
72 |
|
73 |
$lazy_bg = $this->addLazyCLass( $element[0] );
|
74 |
$lazy_bg = str_replace( $url[0], '', $lazy_bg );
|
75 |
-
$lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="
|
76 |
|
77 |
$html = str_replace( $element[0], $lazy_bg, $html );
|
78 |
unset( $lazy_bg );
|
@@ -88,17 +98,142 @@ class Image {
|
|
88 |
* @return string
|
89 |
*/
|
90 |
private function addLazyClass( $element ) {
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
|
104 |
/**
|
@@ -149,8 +284,10 @@ class Image {
|
|
149 |
continue;
|
150 |
}
|
151 |
|
152 |
-
$img_lazy
|
153 |
-
$
|
|
|
|
|
154 |
|
155 |
unset( $img_lazy );
|
156 |
}
|
20 |
* @return string
|
21 |
*/
|
22 |
public function lazyloadImages( $html, $buffer ) {
|
23 |
+
$clean_buffer = preg_replace( '/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html );
|
24 |
+
$clean_buffer = preg_replace( '#<noscript>(?:.+)</noscript>#Umsi', '', $clean_buffer );
|
25 |
+
if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $clean_buffer, $images, PREG_SET_ORDER)) {
|
26 |
return $html;
|
27 |
}
|
28 |
|
53 |
* @return string
|
54 |
*/
|
55 |
public function lazyloadBackgroundImages( $html, $buffer ) {
|
56 |
+
if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li|a)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
|
57 |
return $html;
|
58 |
}
|
59 |
|
66 |
continue;
|
67 |
}
|
68 |
|
69 |
+
$url['url'] = esc_url(
|
70 |
+
trim(
|
71 |
+
strip_tags(
|
72 |
+
html_entity_decode(
|
73 |
+
$url['url'], ENT_QUOTES|ENT_HTML5
|
74 |
+
)
|
75 |
+
), '\'" '
|
76 |
+
)
|
77 |
+
);
|
78 |
|
79 |
if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
|
80 |
continue;
|
82 |
|
83 |
$lazy_bg = $this->addLazyCLass( $element[0] );
|
84 |
$lazy_bg = str_replace( $url[0], '', $lazy_bg );
|
85 |
+
$lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="' . esc_attr( $url['url'] ) . '"', $lazy_bg );
|
86 |
|
87 |
$html = str_replace( $element[0], $lazy_bg, $html );
|
88 |
unset( $lazy_bg );
|
98 |
* @return string
|
99 |
*/
|
100 |
private function addLazyClass( $element ) {
|
101 |
+
$class = $this->getClasses( $element );
|
102 |
+
if ( empty( $class ) ) {
|
103 |
+
return preg_replace( '#<(img|div|figure|section|li|span|a)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element );
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( empty( $class['attribute'] ) || empty( $class['classes'] ) ) {
|
107 |
+
return str_replace( $class['attribute'], 'class="rocket-lazyload"', $element );
|
108 |
+
}
|
109 |
+
|
110 |
+
$quotes = $this->getAttributeQuotes( $class['classes'] );
|
111 |
+
$classes = $this->trimOuterQuotes( $class['classes'], $quotes );
|
112 |
+
|
113 |
+
if ( empty( $classes ) ) {
|
114 |
+
return str_replace( $class['attribute'], 'class="rocket-lazyload"', $element );
|
115 |
+
}
|
116 |
+
|
117 |
+
$classes .= ' rocket-lazyload';
|
118 |
|
119 |
+
return str_replace(
|
120 |
+
$class['attribute'],
|
121 |
+
'class=' . $this->normalizeClasses( $classes, $quotes ),
|
122 |
+
$element
|
123 |
+
);
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Gets the attribute value's outer quotation mark, if one exists, i.e. " or '.
|
128 |
+
*
|
129 |
+
* @param string $attribute_value The target attribute's value.
|
130 |
+
*
|
131 |
+
* @return bool|string quotation character; else false when no quotation mark.
|
132 |
+
*/
|
133 |
+
private function getAttributeQuotes( $attribute_value ) {
|
134 |
+
$attribute_value = trim( $attribute_value );
|
135 |
+
$first_char = $attribute_value[0];
|
136 |
|
137 |
+
if ( '"' === $first_char || "'" === $first_char ) {
|
138 |
+
return $first_char;
|
139 |
+
}
|
140 |
+
|
141 |
+
return false;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Gets the class attribute and values from the given element, if it exists.
|
146 |
+
*
|
147 |
+
* @param string $element Given HTML element to extract classes from.
|
148 |
+
*
|
149 |
+
* @return bool|string[] {
|
150 |
+
* @type string $attribute Class attribute and value, e.g. class="value"
|
151 |
+
* @type string $classes String of class attribute's value(s)
|
152 |
+
* }; else, false when no class attribute exists.
|
153 |
+
*/
|
154 |
+
private function getClasses( $element ) {
|
155 |
+
if ( ! preg_match( '#class\s*=\s*(?<classes>["\'].*?["\']|[^\s]+)#is', $element, $class ) ) {
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( empty( $class ) ) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
+
if ( ! isset( $class['classes'] ) ) {
|
164 |
+
return false;
|
165 |
}
|
166 |
|
167 |
+
return [
|
168 |
+
'attribute' => $class[0],
|
169 |
+
'classes' => $class['classes'],
|
170 |
+
];
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Removes outer single or double quotations.
|
175 |
+
*
|
176 |
+
* @param string $string String to strip quotes from.
|
177 |
+
* @param string $quotes The outer quotes to remove.
|
178 |
+
*
|
179 |
+
* @return string string without quotes.
|
180 |
+
*/
|
181 |
+
private function trimOuterQuotes( $string, $quotes ) {
|
182 |
+
$string = trim( $string );
|
183 |
+
if ( empty( $string ) ) {
|
184 |
+
return '';
|
185 |
+
}
|
186 |
+
|
187 |
+
if ( empty( $quotes ) ) {
|
188 |
+
return $string;
|
189 |
+
}
|
190 |
+
|
191 |
+
$string = ltrim( $string, $quotes );
|
192 |
+
$string = rtrim( $string, $quotes );
|
193 |
+
return trim( $string );
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Normalizes the class attribute values to ensure well-formed.
|
198 |
+
*
|
199 |
+
* @param string $classes String of class attribute value(s).
|
200 |
+
* @param string|bool $quotes Optional. Quotation mark to wrap around the classes.
|
201 |
+
*
|
202 |
+
* @return string well-formed class attributes.
|
203 |
+
*/
|
204 |
+
private function normalizeClasses( $classes, $quotes = '"' ) {
|
205 |
+
$array_of_classes = $this->stringToArray( $classes );
|
206 |
+
$classes = implode( ' ', $array_of_classes );
|
207 |
+
|
208 |
+
if ( false === $quotes ) {
|
209 |
+
$quotes = '"';
|
210 |
+
}
|
211 |
+
|
212 |
+
return $quotes . $classes . $quotes;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Converts the given string into an array of strings.
|
217 |
+
*
|
218 |
+
* Note:
|
219 |
+
* 1. Removes empties.
|
220 |
+
* 2. Trims each string.
|
221 |
+
*
|
222 |
+
* @param string $string The target string to convert.
|
223 |
+
* @param string $delimiter Optional. Default: ' ' empty string.
|
224 |
+
*
|
225 |
+
* @return array An array of trimmed strings.
|
226 |
+
*/
|
227 |
+
private function stringToArray( $string, $delimiter = ' ' ) {
|
228 |
+
if ( empty( $string ) ) {
|
229 |
+
return [];
|
230 |
+
}
|
231 |
+
|
232 |
+
$array = explode( $delimiter, $string );
|
233 |
+
$array = array_map('trim', $array );
|
234 |
+
|
235 |
+
// Remove empties.
|
236 |
+
return array_filter( $array );
|
237 |
}
|
238 |
|
239 |
/**
|
284 |
continue;
|
285 |
}
|
286 |
|
287 |
+
$img_lazy = $this->replaceImage( $img );
|
288 |
+
$img_lazy .= $this->noscript( $img[0] );
|
289 |
+
$safe_img = str_replace('/', '\/', preg_quote( $img[0], '#' ));
|
290 |
+
$html = preg_replace( '#<noscript[^>]*>.*' . $safe_img . '.*<\/noscript>(*SKIP)(*FAIL)|' . $safe_img . '#iU', $img_lazy, $html );
|
291 |
|
292 |
unset( $img_lazy );
|
293 |
}
|
src/Subscriber/LazyloadSubscriber.php
CHANGED
@@ -132,7 +132,7 @@ class LazyloadSubscriber implements SubscriberInterface {
|
|
132 |
|
133 |
$script_args = [
|
134 |
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
135 |
-
'version' => '
|
136 |
'polyfill' => $polyfill,
|
137 |
];
|
138 |
|
132 |
|
133 |
$script_args = [
|
134 |
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
135 |
+
'version' => '16.1',
|
136 |
'polyfill' => $polyfill,
|
137 |
];
|
138 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit7e18abfec3e240d5935b5c01f22c933f::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,196 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
10 |
-
'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
11 |
-
'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
12 |
-
'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
|
13 |
-
'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
|
14 |
-
'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
|
15 |
-
'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
|
16 |
-
'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
|
17 |
-
'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
|
18 |
-
'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
|
19 |
-
'Composer\\Installers\\CiviCrmInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
|
20 |
-
'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
|
21 |
-
'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
|
22 |
-
'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
|
23 |
-
'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
|
24 |
-
'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
25 |
-
'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
26 |
-
'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
27 |
-
'Composer\\Installers\\DframeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
28 |
-
'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
29 |
-
'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
30 |
-
'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
31 |
-
'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
|
32 |
-
'Composer\\Installers\\EliasisInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
|
33 |
-
'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
|
34 |
-
'Composer\\Installers\\EzPlatformInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
|
35 |
-
'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
|
36 |
-
'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
|
37 |
-
'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php',
|
38 |
-
'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
|
39 |
-
'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
|
40 |
-
'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php',
|
41 |
-
'Composer\\Installers\\ItopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
|
42 |
-
'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
43 |
-
'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
44 |
-
'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
45 |
-
'Composer\\Installers\\KnownInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
46 |
-
'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
47 |
-
'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
48 |
-
'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
49 |
-
'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
|
50 |
-
'Composer\\Installers\\LavaLiteInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
|
51 |
-
'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
|
52 |
-
'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
|
53 |
-
'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
|
54 |
-
'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
55 |
-
'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
56 |
-
'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
57 |
-
'Composer\\Installers\\MantisBTInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
|
58 |
-
'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
59 |
-
'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
60 |
-
'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
61 |
-
'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
|
62 |
-
'Composer\\Installers\\ModxInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
|
63 |
-
'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
|
64 |
-
'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
|
65 |
-
'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
|
66 |
-
'Composer\\Installers\\OsclassInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
|
67 |
-
'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
|
68 |
-
'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
|
69 |
-
'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
|
70 |
-
'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
|
71 |
-
'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
|
72 |
-
'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
|
73 |
-
'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
|
74 |
-
'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php',
|
75 |
-
'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
|
76 |
-
'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
|
77 |
-
'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
|
78 |
-
'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
79 |
-
'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
80 |
-
'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
81 |
-
'Composer\\Installers\\Redaxo5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
82 |
-
'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
83 |
-
'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
84 |
-
'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
85 |
-
'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
|
86 |
-
'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
87 |
-
'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
88 |
-
'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
89 |
-
'Composer\\Installers\\SyliusInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
|
90 |
-
'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
91 |
-
'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
92 |
-
'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
93 |
-
'Composer\\Installers\\TaoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
94 |
-
'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
95 |
-
'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
96 |
-
'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
97 |
-
'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
|
98 |
-
'Composer\\Installers\\VgmcpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
|
99 |
-
'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
|
100 |
-
'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
|
101 |
-
'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
|
102 |
-
'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
103 |
-
'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
104 |
-
'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
105 |
-
'Interop\\Container\\ContainerInterface' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
|
106 |
-
'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
107 |
-
'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
108 |
-
'League\\Container\\Argument\\ArgumentResolverInterface' => $vendorDir . '/league/container/src/Argument/ArgumentResolverInterface.php',
|
109 |
-
'League\\Container\\Argument\\ArgumentResolverTrait' => $vendorDir . '/league/container/src/Argument/ArgumentResolverTrait.php',
|
110 |
-
'League\\Container\\Argument\\RawArgument' => $vendorDir . '/league/container/src/Argument/RawArgument.php',
|
111 |
-
'League\\Container\\Argument\\RawArgumentInterface' => $vendorDir . '/league/container/src/Argument/RawArgumentInterface.php',
|
112 |
-
'League\\Container\\Container' => $vendorDir . '/league/container/src/Container.php',
|
113 |
-
'League\\Container\\ContainerAwareInterface' => $vendorDir . '/league/container/src/ContainerAwareInterface.php',
|
114 |
-
'League\\Container\\ContainerAwareTrait' => $vendorDir . '/league/container/src/ContainerAwareTrait.php',
|
115 |
-
'League\\Container\\ContainerInterface' => $vendorDir . '/league/container/src/ContainerInterface.php',
|
116 |
-
'League\\Container\\Definition\\AbstractDefinition' => $vendorDir . '/league/container/src/Definition/AbstractDefinition.php',
|
117 |
-
'League\\Container\\Definition\\CallableDefinition' => $vendorDir . '/league/container/src/Definition/CallableDefinition.php',
|
118 |
-
'League\\Container\\Definition\\ClassDefinition' => $vendorDir . '/league/container/src/Definition/ClassDefinition.php',
|
119 |
-
'League\\Container\\Definition\\ClassDefinitionInterface' => $vendorDir . '/league/container/src/Definition/ClassDefinitionInterface.php',
|
120 |
-
'League\\Container\\Definition\\DefinitionFactory' => $vendorDir . '/league/container/src/Definition/DefinitionFactory.php',
|
121 |
-
'League\\Container\\Definition\\DefinitionFactoryInterface' => $vendorDir . '/league/container/src/Definition/DefinitionFactoryInterface.php',
|
122 |
-
'League\\Container\\Definition\\DefinitionInterface' => $vendorDir . '/league/container/src/Definition/DefinitionInterface.php',
|
123 |
-
'League\\Container\\Exception\\NotFoundException' => $vendorDir . '/league/container/src/Exception/NotFoundException.php',
|
124 |
-
'League\\Container\\ImmutableContainerAwareInterface' => $vendorDir . '/league/container/src/ImmutableContainerAwareInterface.php',
|
125 |
-
'League\\Container\\ImmutableContainerAwareTrait' => $vendorDir . '/league/container/src/ImmutableContainerAwareTrait.php',
|
126 |
-
'League\\Container\\ImmutableContainerInterface' => $vendorDir . '/league/container/src/ImmutableContainerInterface.php',
|
127 |
-
'League\\Container\\Inflector\\Inflector' => $vendorDir . '/league/container/src/Inflector/Inflector.php',
|
128 |
-
'League\\Container\\Inflector\\InflectorAggregate' => $vendorDir . '/league/container/src/Inflector/InflectorAggregate.php',
|
129 |
-
'League\\Container\\Inflector\\InflectorAggregateInterface' => $vendorDir . '/league/container/src/Inflector/InflectorAggregateInterface.php',
|
130 |
-
'League\\Container\\ReflectionContainer' => $vendorDir . '/league/container/src/ReflectionContainer.php',
|
131 |
-
'League\\Container\\ServiceProvider\\AbstractServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractServiceProvider.php',
|
132 |
-
'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php',
|
133 |
-
'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php',
|
134 |
-
'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php',
|
135 |
-
'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php',
|
136 |
-
'League\\Container\\ServiceProvider\\ServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderInterface.php',
|
137 |
-
'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php',
|
138 |
-
'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
|
139 |
-
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
|
140 |
-
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
|
141 |
-
'RocketLazyLoadPlugin\\Admin\\AdminPage' => $baseDir . '/src/Admin/AdminPage.php',
|
142 |
-
'RocketLazyLoadPlugin\\Admin\\ImagifyNotice' => $baseDir . '/src/Admin/ImagifyNotice.php',
|
143 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/Interop/Container/ContainerInterface.php',
|
144 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\ContainerException' => $baseDir . '/src/Dependencies/Interop/Container/Exception/ContainerException.php',
|
145 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\NotFoundException' => $baseDir . '/src/Dependencies/Interop/Container/Exception/NotFoundException.php',
|
146 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' => $baseDir . '/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php',
|
147 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait' => $baseDir . '/src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php',
|
148 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgument' => $baseDir . '/src/Dependencies/League/Container/Argument/RawArgument.php',
|
149 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' => $baseDir . '/src/Dependencies/League/Container/Argument/RawArgumentInterface.php',
|
150 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Container' => $baseDir . '/src/Dependencies/League/Container/Container.php',
|
151 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareInterface' => $baseDir . '/src/Dependencies/League/Container/ContainerAwareInterface.php',
|
152 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareTrait' => $baseDir . '/src/Dependencies/League/Container/ContainerAwareTrait.php',
|
153 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/League/Container/ContainerInterface.php',
|
154 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\AbstractDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/AbstractDefinition.php',
|
155 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\CallableDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/CallableDefinition.php',
|
156 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/ClassDefinition.php',
|
157 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinitionInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php',
|
158 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactory' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionFactory.php',
|
159 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactoryInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php',
|
160 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionInterface.php',
|
161 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Exception\\NotFoundException' => $baseDir . '/src/Dependencies/League/Container/Exception/NotFoundException.php',
|
162 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareInterface' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerAwareInterface.php',
|
163 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareTrait' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerAwareTrait.php',
|
164 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerInterface' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerInterface.php',
|
165 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\Inflector' => $baseDir . '/src/Dependencies/League/Container/Inflector/Inflector.php',
|
166 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregate' => $baseDir . '/src/Dependencies/League/Container/Inflector/InflectorAggregate.php',
|
167 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface' => $baseDir . '/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php',
|
168 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ReflectionContainer' => $baseDir . '/src/Dependencies/League/Container/ReflectionContainer.php',
|
169 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractServiceProvider' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php',
|
170 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php',
|
171 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php',
|
172 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregate' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php',
|
173 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php',
|
174 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php',
|
175 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php',
|
176 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerExceptionInterface' => $baseDir . '/src/Dependencies/Psr/Container/ContainerExceptionInterface.php',
|
177 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/Psr/Container/ContainerInterface.php',
|
178 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface' => $baseDir . '/src/Dependencies/Psr/Container/NotFoundExceptionInterface.php',
|
179 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Assets' => $baseDir . '/src/Dependencies/RocketLazyload/Assets.php',
|
180 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Iframe' => $baseDir . '/src/Dependencies/RocketLazyload/Iframe.php',
|
181 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Image' => $baseDir . '/src/Dependencies/RocketLazyload/Image.php',
|
182 |
-
'RocketLazyLoadPlugin\\EventManagement\\EventManager' => $baseDir . '/src/EventManagement/EventManager.php',
|
183 |
-
'RocketLazyLoadPlugin\\EventManagement\\EventManagerAwareSubscriberInterface' => $baseDir . '/src/EventManagement/EventManagerAwareSubscriberInterface.php',
|
184 |
-
'RocketLazyLoadPlugin\\EventManagement\\SubscriberInterface' => $baseDir . '/src/EventManagement/SubscriberInterface.php',
|
185 |
-
'RocketLazyLoadPlugin\\Options\\AbstractOptions' => $baseDir . '/src/Options/AbstractOptions.php',
|
186 |
-
'RocketLazyLoadPlugin\\Options\\OptionArray' => $baseDir . '/src/Options/OptionArray.php',
|
187 |
-
'RocketLazyLoadPlugin\\Options\\Options' => $baseDir . '/src/Options/Options.php',
|
188 |
-
'RocketLazyLoadPlugin\\Plugin' => $baseDir . '/src/Plugin.php',
|
189 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\AdminServiceProvider' => $baseDir . '/src/ServiceProvider/AdminServiceProvider.php',
|
190 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\ImagifyNoticeServiceProvider' => $baseDir . '/src/ServiceProvider/ImagifyNoticeServiceProvider.php',
|
191 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\LazyloadServiceProvider' => $baseDir . '/src/ServiceProvider/LazyloadServiceProvider.php',
|
192 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\OptionServiceProvider' => $baseDir . '/src/ServiceProvider/OptionServiceProvider.php',
|
193 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\SubscribersServiceProvider' => $baseDir . '/src/ServiceProvider/SubscribersServiceProvider.php',
|
194 |
-
'RocketLazyLoadPlugin\\Subscriber\\AdminPageSubscriber' => $baseDir . '/src/Subscriber/AdminPageSubscriber.php',
|
195 |
-
'RocketLazyLoadPlugin\\Subscriber\\ImagifyNoticeSubscriber' => $baseDir . '/src/Subscriber/ImagifyNoticeSubscriber.php',
|
196 |
-
'RocketLazyLoadPlugin\\Subscriber\\LazyloadSubscriber' => $baseDir . '/src/Subscriber/LazyloadSubscriber.php',
|
197 |
-
'RocketLazyLoadPlugin\\Subscriber\\ThirdParty\\AMPSubscriber' => $baseDir . '/src/Subscriber/ThirdParty/AMPSubscriber.php',
|
198 |
-
'RocketLazyload\\Assets' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Assets.php',
|
199 |
-
'RocketLazyload\\Iframe' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Iframe.php',
|
200 |
-
'RocketLazyload\\Image' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Image.php',
|
201 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -8,8 +8,5 @@ $baseDir = dirname($vendorDir);
|
|
8 |
return array(
|
9 |
'RocketLazyload\\' => array($vendorDir . '/wp-media/rocket-lazyload-common/src'),
|
10 |
'RocketLazyLoadPlugin\\' => array($baseDir . '/src'),
|
11 |
-
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
12 |
-
'League\\Container\\' => array($vendorDir . '/league/container/src'),
|
13 |
-
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
|
14 |
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
15 |
);
|
8 |
return array(
|
9 |
'RocketLazyload\\' => array($vendorDir . '/wp-media/rocket-lazyload-common/src'),
|
10 |
'RocketLazyLoadPlugin\\' => array($baseDir . '/src'),
|
|
|
|
|
|
|
11 |
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
12 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -13,21 +13,24 @@ class ComposerAutoloaderInita1fa2cadbdc54957d6856ff382bb6726
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit7e18abfec3e240d5935b5c01f22c933f
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit7e18abfec3e240d5935b5c01f22c933f', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit7e18abfec3e240d5935b5c01f22c933f', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit7e18abfec3e240d5935b5c01f22c933f::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'R' =>
|
@@ -12,18 +12,6 @@ class ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726
|
|
12 |
'RocketLazyload\\' => 15,
|
13 |
'RocketLazyLoadPlugin\\' => 21,
|
14 |
),
|
15 |
-
'P' =>
|
16 |
-
array (
|
17 |
-
'Psr\\Container\\' => 14,
|
18 |
-
),
|
19 |
-
'L' =>
|
20 |
-
array (
|
21 |
-
'League\\Container\\' => 17,
|
22 |
-
),
|
23 |
-
'I' =>
|
24 |
-
array (
|
25 |
-
'Interop\\Container\\' => 18,
|
26 |
-
),
|
27 |
'C' =>
|
28 |
array (
|
29 |
'Composer\\Installers\\' => 20,
|
@@ -39,225 +27,17 @@ class ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726
|
|
39 |
array (
|
40 |
0 => __DIR__ . '/../..' . '/src',
|
41 |
),
|
42 |
-
'Psr\\Container\\' =>
|
43 |
-
array (
|
44 |
-
0 => __DIR__ . '/..' . '/psr/container/src',
|
45 |
-
),
|
46 |
-
'League\\Container\\' =>
|
47 |
-
array (
|
48 |
-
0 => __DIR__ . '/..' . '/league/container/src',
|
49 |
-
),
|
50 |
-
'Interop\\Container\\' =>
|
51 |
-
array (
|
52 |
-
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
|
53 |
-
),
|
54 |
'Composer\\Installers\\' =>
|
55 |
array (
|
56 |
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
57 |
),
|
58 |
);
|
59 |
|
60 |
-
public static $classMap = array (
|
61 |
-
'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
62 |
-
'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
63 |
-
'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
64 |
-
'Composer\\Installers\\AsgardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
|
65 |
-
'Composer\\Installers\\AttogramInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
|
66 |
-
'Composer\\Installers\\BaseInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
|
67 |
-
'Composer\\Installers\\BitrixInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
|
68 |
-
'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
|
69 |
-
'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
|
70 |
-
'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
|
71 |
-
'Composer\\Installers\\CiviCrmInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
|
72 |
-
'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
|
73 |
-
'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
|
74 |
-
'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
|
75 |
-
'Composer\\Installers\\Concrete5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
|
76 |
-
'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
77 |
-
'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
78 |
-
'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
79 |
-
'Composer\\Installers\\DframeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
80 |
-
'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
81 |
-
'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
82 |
-
'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
83 |
-
'Composer\\Installers\\ElggInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
|
84 |
-
'Composer\\Installers\\EliasisInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
|
85 |
-
'Composer\\Installers\\ExpressionEngineInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
|
86 |
-
'Composer\\Installers\\EzPlatformInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
|
87 |
-
'Composer\\Installers\\FuelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
|
88 |
-
'Composer\\Installers\\FuelphpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
|
89 |
-
'Composer\\Installers\\GravInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/GravInstaller.php',
|
90 |
-
'Composer\\Installers\\HuradInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
|
91 |
-
'Composer\\Installers\\ImageCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
|
92 |
-
'Composer\\Installers\\Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Installer.php',
|
93 |
-
'Composer\\Installers\\ItopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
|
94 |
-
'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
95 |
-
'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
96 |
-
'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
97 |
-
'Composer\\Installers\\KnownInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
98 |
-
'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
99 |
-
'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
100 |
-
'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
101 |
-
'Composer\\Installers\\LaravelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
|
102 |
-
'Composer\\Installers\\LavaLiteInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
|
103 |
-
'Composer\\Installers\\LithiumInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
|
104 |
-
'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
|
105 |
-
'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
|
106 |
-
'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
|
107 |
-
'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
|
108 |
-
'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
|
109 |
-
'Composer\\Installers\\MantisBTInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
|
110 |
-
'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
|
111 |
-
'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
|
112 |
-
'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
|
113 |
-
'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
|
114 |
-
'Composer\\Installers\\ModxInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
|
115 |
-
'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
|
116 |
-
'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
|
117 |
-
'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
|
118 |
-
'Composer\\Installers\\OsclassInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
|
119 |
-
'Composer\\Installers\\OxidInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
|
120 |
-
'Composer\\Installers\\PPIInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
|
121 |
-
'Composer\\Installers\\PhiftyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
|
122 |
-
'Composer\\Installers\\PhpBBInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
|
123 |
-
'Composer\\Installers\\PimcoreInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
|
124 |
-
'Composer\\Installers\\PiwikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
|
125 |
-
'Composer\\Installers\\PlentymarketsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
|
126 |
-
'Composer\\Installers\\Plugin' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Plugin.php',
|
127 |
-
'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
|
128 |
-
'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
|
129 |
-
'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
|
130 |
-
'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
131 |
-
'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
132 |
-
'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
133 |
-
'Composer\\Installers\\Redaxo5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
134 |
-
'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
135 |
-
'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
136 |
-
'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
137 |
-
'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
|
138 |
-
'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
|
139 |
-
'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
|
140 |
-
'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
|
141 |
-
'Composer\\Installers\\SyliusInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
|
142 |
-
'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
143 |
-
'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
144 |
-
'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
145 |
-
'Composer\\Installers\\TaoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
146 |
-
'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
147 |
-
'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
148 |
-
'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
149 |
-
'Composer\\Installers\\VanillaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
|
150 |
-
'Composer\\Installers\\VgmcpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
|
151 |
-
'Composer\\Installers\\WHMCSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
|
152 |
-
'Composer\\Installers\\WolfCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
|
153 |
-
'Composer\\Installers\\WordPressInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
|
154 |
-
'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
155 |
-
'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
156 |
-
'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
157 |
-
'Interop\\Container\\ContainerInterface' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
|
158 |
-
'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
159 |
-
'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
160 |
-
'League\\Container\\Argument\\ArgumentResolverInterface' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverInterface.php',
|
161 |
-
'League\\Container\\Argument\\ArgumentResolverTrait' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverTrait.php',
|
162 |
-
'League\\Container\\Argument\\RawArgument' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgument.php',
|
163 |
-
'League\\Container\\Argument\\RawArgumentInterface' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgumentInterface.php',
|
164 |
-
'League\\Container\\Container' => __DIR__ . '/..' . '/league/container/src/Container.php',
|
165 |
-
'League\\Container\\ContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ContainerAwareInterface.php',
|
166 |
-
'League\\Container\\ContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ContainerAwareTrait.php',
|
167 |
-
'League\\Container\\ContainerInterface' => __DIR__ . '/..' . '/league/container/src/ContainerInterface.php',
|
168 |
-
'League\\Container\\Definition\\AbstractDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/AbstractDefinition.php',
|
169 |
-
'League\\Container\\Definition\\CallableDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/CallableDefinition.php',
|
170 |
-
'League\\Container\\Definition\\ClassDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinition.php',
|
171 |
-
'League\\Container\\Definition\\ClassDefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinitionInterface.php',
|
172 |
-
'League\\Container\\Definition\\DefinitionFactory' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactory.php',
|
173 |
-
'League\\Container\\Definition\\DefinitionFactoryInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactoryInterface.php',
|
174 |
-
'League\\Container\\Definition\\DefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionInterface.php',
|
175 |
-
'League\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/league/container/src/Exception/NotFoundException.php',
|
176 |
-
'League\\Container\\ImmutableContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareInterface.php',
|
177 |
-
'League\\Container\\ImmutableContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareTrait.php',
|
178 |
-
'League\\Container\\ImmutableContainerInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerInterface.php',
|
179 |
-
'League\\Container\\Inflector\\Inflector' => __DIR__ . '/..' . '/league/container/src/Inflector/Inflector.php',
|
180 |
-
'League\\Container\\Inflector\\InflectorAggregate' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregate.php',
|
181 |
-
'League\\Container\\Inflector\\InflectorAggregateInterface' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregateInterface.php',
|
182 |
-
'League\\Container\\ReflectionContainer' => __DIR__ . '/..' . '/league/container/src/ReflectionContainer.php',
|
183 |
-
'League\\Container\\ServiceProvider\\AbstractServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractServiceProvider.php',
|
184 |
-
'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php',
|
185 |
-
'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php',
|
186 |
-
'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php',
|
187 |
-
'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php',
|
188 |
-
'League\\Container\\ServiceProvider\\ServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderInterface.php',
|
189 |
-
'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php',
|
190 |
-
'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
|
191 |
-
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
|
192 |
-
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
|
193 |
-
'RocketLazyLoadPlugin\\Admin\\AdminPage' => __DIR__ . '/../..' . '/src/Admin/AdminPage.php',
|
194 |
-
'RocketLazyLoadPlugin\\Admin\\ImagifyNotice' => __DIR__ . '/../..' . '/src/Admin/ImagifyNotice.php',
|
195 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/ContainerInterface.php',
|
196 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/Exception/ContainerException.php',
|
197 |
-
'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/Exception/NotFoundException.php',
|
198 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php',
|
199 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php',
|
200 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgument' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/RawArgument.php',
|
201 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/RawArgumentInterface.php',
|
202 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Container' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Container.php',
|
203 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerAwareInterface.php',
|
204 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerAwareTrait.php',
|
205 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerInterface.php',
|
206 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\AbstractDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/AbstractDefinition.php',
|
207 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\CallableDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/CallableDefinition.php',
|
208 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/ClassDefinition.php',
|
209 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinitionInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php',
|
210 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactory' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionFactory.php',
|
211 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactoryInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php',
|
212 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionInterface.php',
|
213 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Exception\\NotFoundException' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Exception/NotFoundException.php',
|
214 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerAwareInterface.php',
|
215 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerAwareTrait.php',
|
216 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerInterface.php',
|
217 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\Inflector' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/Inflector.php',
|
218 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregate' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/InflectorAggregate.php',
|
219 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php',
|
220 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ReflectionContainer' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ReflectionContainer.php',
|
221 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractServiceProvider' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php',
|
222 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php',
|
223 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php',
|
224 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregate' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php',
|
225 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php',
|
226 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php',
|
227 |
-
'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php',
|
228 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/ContainerExceptionInterface.php',
|
229 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/ContainerInterface.php',
|
230 |
-
'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/NotFoundExceptionInterface.php',
|
231 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Assets' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Assets.php',
|
232 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Iframe' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Iframe.php',
|
233 |
-
'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Image' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Image.php',
|
234 |
-
'RocketLazyLoadPlugin\\EventManagement\\EventManager' => __DIR__ . '/../..' . '/src/EventManagement/EventManager.php',
|
235 |
-
'RocketLazyLoadPlugin\\EventManagement\\EventManagerAwareSubscriberInterface' => __DIR__ . '/../..' . '/src/EventManagement/EventManagerAwareSubscriberInterface.php',
|
236 |
-
'RocketLazyLoadPlugin\\EventManagement\\SubscriberInterface' => __DIR__ . '/../..' . '/src/EventManagement/SubscriberInterface.php',
|
237 |
-
'RocketLazyLoadPlugin\\Options\\AbstractOptions' => __DIR__ . '/../..' . '/src/Options/AbstractOptions.php',
|
238 |
-
'RocketLazyLoadPlugin\\Options\\OptionArray' => __DIR__ . '/../..' . '/src/Options/OptionArray.php',
|
239 |
-
'RocketLazyLoadPlugin\\Options\\Options' => __DIR__ . '/../..' . '/src/Options/Options.php',
|
240 |
-
'RocketLazyLoadPlugin\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php',
|
241 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\AdminServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/AdminServiceProvider.php',
|
242 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\ImagifyNoticeServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/ImagifyNoticeServiceProvider.php',
|
243 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\LazyloadServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/LazyloadServiceProvider.php',
|
244 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\OptionServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/OptionServiceProvider.php',
|
245 |
-
'RocketLazyLoadPlugin\\ServiceProvider\\SubscribersServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/SubscribersServiceProvider.php',
|
246 |
-
'RocketLazyLoadPlugin\\Subscriber\\AdminPageSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/AdminPageSubscriber.php',
|
247 |
-
'RocketLazyLoadPlugin\\Subscriber\\ImagifyNoticeSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/ImagifyNoticeSubscriber.php',
|
248 |
-
'RocketLazyLoadPlugin\\Subscriber\\LazyloadSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/LazyloadSubscriber.php',
|
249 |
-
'RocketLazyLoadPlugin\\Subscriber\\ThirdParty\\AMPSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/ThirdParty/AMPSubscriber.php',
|
250 |
-
'RocketLazyload\\Assets' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Assets.php',
|
251 |
-
'RocketLazyload\\Iframe' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Iframe.php',
|
252 |
-
'RocketLazyload\\Image' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Image.php',
|
253 |
-
);
|
254 |
-
|
255 |
public static function getInitializer(ClassLoader $loader)
|
256 |
{
|
257 |
return \Closure::bind(function () use ($loader) {
|
258 |
-
$loader->prefixLengthsPsr4 =
|
259 |
-
$loader->prefixDirsPsr4 =
|
260 |
-
$loader->classMap = ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726::$classMap;
|
261 |
|
262 |
}, null, ClassLoader::class);
|
263 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit7e18abfec3e240d5935b5c01f22c933f
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'R' =>
|
12 |
'RocketLazyload\\' => 15,
|
13 |
'RocketLazyLoadPlugin\\' => 21,
|
14 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
'C' =>
|
16 |
array (
|
17 |
'Composer\\Installers\\' => 20,
|
27 |
array (
|
28 |
0 => __DIR__ . '/../..' . '/src',
|
29 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
'Composer\\Installers\\' =>
|
31 |
array (
|
32 |
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
33 |
),
|
34 |
);
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
public static function getInitializer(ClassLoader $loader)
|
37 |
{
|
38 |
return \Closure::bind(function () use ($loader) {
|
39 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit7e18abfec3e240d5935b5c01f22c933f::$prefixLengthsPsr4;
|
40 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit7e18abfec3e240d5935b5c01f22c933f::$prefixDirsPsr4;
|
|
|
41 |
|
42 |
}, null, ClassLoader::class);
|
43 |
}
|
vendor/composer/installed.json
CHANGED
@@ -126,173 +126,31 @@
|
|
126 |
"yawik",
|
127 |
"zend",
|
128 |
"zikula"
|
129 |
-
]
|
130 |
-
},
|
131 |
-
{
|
132 |
-
"name": "container-interop/container-interop",
|
133 |
-
"version": "1.2.0",
|
134 |
-
"version_normalized": "1.2.0.0",
|
135 |
-
"source": {
|
136 |
-
"type": "git",
|
137 |
-
"url": "https://github.com/container-interop/container-interop.git",
|
138 |
-
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
|
139 |
-
},
|
140 |
-
"dist": {
|
141 |
-
"type": "zip",
|
142 |
-
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
143 |
-
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
144 |
-
"shasum": ""
|
145 |
-
},
|
146 |
-
"require": {
|
147 |
-
"psr/container": "^1.0"
|
148 |
-
},
|
149 |
-
"time": "2017-02-14T19:40:03+00:00",
|
150 |
-
"type": "library",
|
151 |
-
"installation-source": "dist",
|
152 |
-
"autoload": {
|
153 |
-
"psr-4": {
|
154 |
-
"Interop\\Container\\": "src/Interop/Container/"
|
155 |
-
}
|
156 |
-
},
|
157 |
-
"notification-url": "https://packagist.org/downloads/",
|
158 |
-
"license": [
|
159 |
-
"MIT"
|
160 |
-
],
|
161 |
-
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
162 |
-
"homepage": "https://github.com/container-interop/container-interop",
|
163 |
-
"abandoned": "psr/container"
|
164 |
-
},
|
165 |
-
{
|
166 |
-
"name": "league/container",
|
167 |
-
"version": "2.4.1",
|
168 |
-
"version_normalized": "2.4.1.0",
|
169 |
-
"source": {
|
170 |
-
"type": "git",
|
171 |
-
"url": "https://github.com/thephpleague/container.git",
|
172 |
-
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0"
|
173 |
-
},
|
174 |
-
"dist": {
|
175 |
-
"type": "zip",
|
176 |
-
"url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0",
|
177 |
-
"reference": "43f35abd03a12977a60ffd7095efd6a7808488c0",
|
178 |
-
"shasum": ""
|
179 |
-
},
|
180 |
-
"require": {
|
181 |
-
"container-interop/container-interop": "^1.2",
|
182 |
-
"php": "^5.4.0 || ^7.0"
|
183 |
-
},
|
184 |
-
"provide": {
|
185 |
-
"container-interop/container-interop-implementation": "^1.2",
|
186 |
-
"psr/container-implementation": "^1.0"
|
187 |
-
},
|
188 |
-
"replace": {
|
189 |
-
"orno/di": "~2.0"
|
190 |
-
},
|
191 |
-
"require-dev": {
|
192 |
-
"phpunit/phpunit": "4.*"
|
193 |
-
},
|
194 |
-
"time": "2017-05-10T09:20:27+00:00",
|
195 |
-
"type": "library",
|
196 |
-
"extra": {
|
197 |
-
"branch-alias": {
|
198 |
-
"dev-2.x": "2.x-dev",
|
199 |
-
"dev-1.x": "1.x-dev"
|
200 |
-
}
|
201 |
-
},
|
202 |
-
"installation-source": "dist",
|
203 |
-
"autoload": {
|
204 |
-
"psr-4": {
|
205 |
-
"League\\Container\\": "src"
|
206 |
-
}
|
207 |
-
},
|
208 |
-
"notification-url": "https://packagist.org/downloads/",
|
209 |
-
"license": [
|
210 |
-
"MIT"
|
211 |
],
|
212 |
-
"
|
213 |
{
|
214 |
-
"
|
215 |
-
"
|
216 |
-
|
217 |
-
"role": "Developer"
|
218 |
-
}
|
219 |
-
],
|
220 |
-
"description": "A fast and intuitive dependency injection container.",
|
221 |
-
"homepage": "https://github.com/thephpleague/container",
|
222 |
-
"keywords": [
|
223 |
-
"container",
|
224 |
-
"dependency",
|
225 |
-
"di",
|
226 |
-
"injection",
|
227 |
-
"league",
|
228 |
-
"provider",
|
229 |
-
"service"
|
230 |
-
]
|
231 |
-
},
|
232 |
-
{
|
233 |
-
"name": "psr/container",
|
234 |
-
"version": "1.0.0",
|
235 |
-
"version_normalized": "1.0.0.0",
|
236 |
-
"source": {
|
237 |
-
"type": "git",
|
238 |
-
"url": "https://github.com/php-fig/container.git",
|
239 |
-
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
240 |
-
},
|
241 |
-
"dist": {
|
242 |
-
"type": "zip",
|
243 |
-
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
244 |
-
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
245 |
-
"shasum": ""
|
246 |
-
},
|
247 |
-
"require": {
|
248 |
-
"php": ">=5.3.0"
|
249 |
-
},
|
250 |
-
"time": "2017-02-14T16:28:37+00:00",
|
251 |
-
"type": "library",
|
252 |
-
"extra": {
|
253 |
-
"branch-alias": {
|
254 |
-
"dev-master": "1.0.x-dev"
|
255 |
-
}
|
256 |
-
},
|
257 |
-
"installation-source": "dist",
|
258 |
-
"autoload": {
|
259 |
-
"psr-4": {
|
260 |
-
"Psr\\Container\\": "src/"
|
261 |
-
}
|
262 |
-
},
|
263 |
-
"notification-url": "https://packagist.org/downloads/",
|
264 |
-
"license": [
|
265 |
-
"MIT"
|
266 |
-
],
|
267 |
-
"authors": [
|
268 |
{
|
269 |
-
"
|
270 |
-
"
|
271 |
}
|
272 |
-
],
|
273 |
-
"description": "Common Container Interface (PHP FIG PSR-11)",
|
274 |
-
"homepage": "https://github.com/php-fig/container",
|
275 |
-
"keywords": [
|
276 |
-
"PSR-11",
|
277 |
-
"container",
|
278 |
-
"container-interface",
|
279 |
-
"container-interop",
|
280 |
-
"psr"
|
281 |
]
|
282 |
},
|
283 |
{
|
284 |
"name": "wp-media/rocket-lazyload-common",
|
285 |
-
"version": "v2.5.
|
286 |
-
"version_normalized": "2.5.
|
287 |
"source": {
|
288 |
"type": "git",
|
289 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
290 |
-
"reference": "
|
291 |
},
|
292 |
"dist": {
|
293 |
"type": "zip",
|
294 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
295 |
-
"reference": "
|
296 |
"shasum": ""
|
297 |
},
|
298 |
"require": {
|
@@ -310,7 +168,7 @@
|
|
310 |
"symfony/yaml": "2.8.*",
|
311 |
"wp-coding-standards/wpcs": "^2.0.0"
|
312 |
},
|
313 |
-
"time": "2020-
|
314 |
"type": "library",
|
315 |
"installation-source": "dist",
|
316 |
"autoload": {
|
126 |
"yawik",
|
127 |
"zend",
|
128 |
"zikula"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
],
|
130 |
+
"funding": [
|
131 |
{
|
132 |
+
"url": "https://packagist.com",
|
133 |
+
"type": "custom"
|
134 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
{
|
136 |
+
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
137 |
+
"type": "tidelift"
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
]
|
140 |
},
|
141 |
{
|
142 |
"name": "wp-media/rocket-lazyload-common",
|
143 |
+
"version": "v2.5.12",
|
144 |
+
"version_normalized": "2.5.12.0",
|
145 |
"source": {
|
146 |
"type": "git",
|
147 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
148 |
+
"reference": "09bdc9a550b8bd1197c155a98e17c45adcb190af"
|
149 |
},
|
150 |
"dist": {
|
151 |
"type": "zip",
|
152 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/09bdc9a550b8bd1197c155a98e17c45adcb190af",
|
153 |
+
"reference": "09bdc9a550b8bd1197c155a98e17c45adcb190af",
|
154 |
"shasum": ""
|
155 |
},
|
156 |
"require": {
|
168 |
"symfony/yaml": "2.8.*",
|
169 |
"wp-coding-standards/wpcs": "^2.0.0"
|
170 |
},
|
171 |
+
"time": "2020-07-10T18:41:12+00:00",
|
172 |
"type": "library",
|
173 |
"installation-source": "dist",
|
174 |
"autoload": {
|
vendor/container-interop/container-interop/.gitignore
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
composer.lock
|
2 |
-
composer.phar
|
3 |
-
/vendor/
|
|
|
|
|
|
vendor/container-interop/container-interop/LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2013 container-interop
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
-
this software and associated documentation files (the "Software"), to deal in
|
7 |
-
the Software without restriction, including without limitation the rights to
|
8 |
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
-
subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in all
|
13 |
-
copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/README.md
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
# Container Interoperability
|
2 |
-
|
3 |
-
[![Latest Stable Version](https://poser.pugx.org/container-interop/container-interop/v/stable.png)](https://packagist.org/packages/container-interop/container-interop)
|
4 |
-
[![Total Downloads](https://poser.pugx.org/container-interop/container-interop/downloads.svg)](https://packagist.org/packages/container-interop/container-interop)
|
5 |
-
|
6 |
-
## Deprecation warning!
|
7 |
-
|
8 |
-
Starting Feb. 13th 2017, container-interop is officially deprecated in favor of [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md).
|
9 |
-
Container-interop has been the test-bed of PSR-11. From v1.2, container-interop directly extends PSR-11 interfaces.
|
10 |
-
Therefore, all containers implementing container-interop are now *de-facto* compatible with PSR-11.
|
11 |
-
|
12 |
-
- Projects implementing container-interop interfaces are encouraged to directly implement PSR-11 interfaces instead.
|
13 |
-
- Projects consuming container-interop interfaces are very strongly encouraged to directly type-hint on PSR-11 interfaces, in order to be compatible with PSR-11 containers that are not compatible with container-interop.
|
14 |
-
|
15 |
-
Regarding the delegate lookup feature, that is present in container-interop and not in PSR-11, the feature is actually a design pattern. It is therefore not deprecated. Documentation regarding this design pattern will be migrated from this repository into a separate website in the future.
|
16 |
-
|
17 |
-
## About
|
18 |
-
|
19 |
-
*container-interop* tries to identify and standardize features in *container* objects (service locators,
|
20 |
-
dependency injection containers, etc.) to achieve interoperability.
|
21 |
-
|
22 |
-
Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.
|
23 |
-
|
24 |
-
If PHP projects that provide container implementations begin to adopt these common standards, then PHP
|
25 |
-
applications and projects that use containers can depend on the common interfaces instead of specific
|
26 |
-
implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume
|
27 |
-
*any* container implementation that can be adapted to these interfaces.
|
28 |
-
|
29 |
-
The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being
|
30 |
-
worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope
|
31 |
-
this project will pave the way for one or more future PSRs.
|
32 |
-
|
33 |
-
|
34 |
-
## Installation
|
35 |
-
|
36 |
-
You can install this package through Composer:
|
37 |
-
|
38 |
-
```json
|
39 |
-
composer require container-interop/container-interop
|
40 |
-
```
|
41 |
-
|
42 |
-
The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility
|
43 |
-
between minor versions.
|
44 |
-
|
45 |
-
## Standards
|
46 |
-
|
47 |
-
### Available
|
48 |
-
|
49 |
-
- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php).
|
50 |
-
[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md).
|
51 |
-
Describes the interface of a container that exposes methods to read its entries.
|
52 |
-
- [*Delegate lookup feature*](docs/Delegate-lookup.md).
|
53 |
-
[Meta Document](docs/Delegate-lookup-meta.md).
|
54 |
-
Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This
|
55 |
-
feature lets several containers work together in a single application.
|
56 |
-
|
57 |
-
### Proposed
|
58 |
-
|
59 |
-
View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC)
|
60 |
-
|
61 |
-
## Compatible projects
|
62 |
-
|
63 |
-
### Projects implementing `ContainerInterface`
|
64 |
-
|
65 |
-
- [Acclimate](https://github.com/jeremeamia/acclimate-container): Adapters for
|
66 |
-
Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2
|
67 |
-
Dependency injection and any container using `ArrayAccess`
|
68 |
-
- [Aura.Di](https://github.com/auraphp/Aura.Di)
|
69 |
-
- [auryn-container-interop](https://github.com/elazar/auryn-container-interop)
|
70 |
-
- [Burlap](https://github.com/codeeverything/burlap)
|
71 |
-
- [Chernozem](https://github.com/pyrsmk/Chernozem)
|
72 |
-
- [Data Manager](https://github.com/chrismichaels84/data-manager)
|
73 |
-
- [Disco](https://github.com/bitexpert/disco)
|
74 |
-
- [InDI](https://github.com/idealogica/indi)
|
75 |
-
- [League/Container](http://container.thephpleague.com/)
|
76 |
-
- [Mouf](http://mouf-php.com)
|
77 |
-
- [Njasm Container](https://github.com/njasm/container)
|
78 |
-
- [PHP-DI](http://php-di.org)
|
79 |
-
- [Picotainer](https://github.com/thecodingmachine/picotainer)
|
80 |
-
- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
|
81 |
-
- [Pimple3-ContainerInterop](https://github.com/Sam-Burns/pimple3-containerinterop) (using Pimple v3)
|
82 |
-
- [SitePoint Container](https://github.com/sitepoint/Container)
|
83 |
-
- [Thruster Container](https://github.com/ThrusterIO/container) (PHP7 only)
|
84 |
-
- [Ultra-Lite Container](https://github.com/ultra-lite/container)
|
85 |
-
- [Unbox](https://github.com/mindplay-dk/unbox)
|
86 |
-
- [XStatic](https://github.com/jeremeamia/xstatic)
|
87 |
-
- [Zend\ServiceManager](https://github.com/zendframework/zend-servicemanager)
|
88 |
-
- [Zit](https://github.com/inxilpro/Zit)
|
89 |
-
|
90 |
-
### Projects implementing the *delegate lookup* feature
|
91 |
-
|
92 |
-
- [Aura.Di](https://github.com/auraphp/Aura.Di)
|
93 |
-
- [Burlap](https://github.com/codeeverything/burlap)
|
94 |
-
- [Chernozem](https://github.com/pyrsmk/Chernozem)
|
95 |
-
- [InDI](https://github.com/idealogica/indi)
|
96 |
-
- [League/Container](http://container.thephpleague.com/)
|
97 |
-
- [Mouf](http://mouf-php.com)
|
98 |
-
- [Picotainer](https://github.com/thecodingmachine/picotainer)
|
99 |
-
- [PHP-DI](http://php-di.org)
|
100 |
-
- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
|
101 |
-
- [Ultra-Lite Container](https://github.com/ultra-lite/container)
|
102 |
-
|
103 |
-
### Middlewares implementing `ContainerInterface`
|
104 |
-
|
105 |
-
- [Alias-Container](https://github.com/thecodingmachine/alias-container): add
|
106 |
-
aliases support to any container
|
107 |
-
- [Prefixer-Container](https://github.com/thecodingmachine/prefixer-container):
|
108 |
-
dynamically prefix identifiers
|
109 |
-
- [Lazy-Container](https://github.com/snapshotpl/lazy-container): lazy services
|
110 |
-
|
111 |
-
### Projects using `ContainerInterface`
|
112 |
-
|
113 |
-
The list below contains only a sample of all the projects consuming `ContainerInterface`. For a more complete list have a look [here](http://packanalyst.com/class?q=Interop%5CContainer%5CContainerInterface).
|
114 |
-
|
115 |
-
| | Downloads |
|
116 |
-
| --- | --- |
|
117 |
-
| [Adroit](https://github.com/bitexpert/adroit) | ![](https://img.shields.io/packagist/dt/bitexpert/adroit.svg) |
|
118 |
-
| [Behat](https://github.com/Behat/Behat/pull/974) | ![](https://img.shields.io/packagist/dt/behat/behat.svg) |
|
119 |
-
| [blast-facades](https://github.com/phpthinktank/blast-facades): Minimize complexity and represent dependencies as facades. | ![](https://img.shields.io/packagist/dt/blast/facades.svg) |
|
120 |
-
| [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di): an extension to [Silex](http://silex.sensiolabs.org/) that adds support for any *container-interop* compatible container | ![](https://img.shields.io/packagist/dt/mouf/interop.silex.di.svg) |
|
121 |
-
| [mindplay/walkway](https://github.com/mindplay-dk/walkway): a modular request router | ![](https://img.shields.io/packagist/dt/mindplay/walkway.svg) |
|
122 |
-
| [mindplay/middleman](https://github.com/mindplay-dk/middleman): minimalist PSR-7 middleware dispatcher | ![](https://img.shields.io/packagist/dt/mindplay/middleman.svg) |
|
123 |
-
| [PHP-DI/Invoker](https://github.com/PHP-DI/Invoker): extensible and configurable invoker/dispatcher | ![](https://img.shields.io/packagist/dt/php-di/invoker.svg) |
|
124 |
-
| [Prophiler](https://github.com/fabfuel/prophiler) | ![](https://img.shields.io/packagist/dt/fabfuel/prophiler.svg) |
|
125 |
-
| [Silly](https://github.com/mnapoli/silly): CLI micro-framework | ![](https://img.shields.io/packagist/dt/mnapoli/silly.svg) |
|
126 |
-
| [Slim v3](https://github.com/slimphp/Slim) | ![](https://img.shields.io/packagist/dt/slim/slim.svg) |
|
127 |
-
| [Splash](http://mouf-php.com/packages/mouf/mvc.splash-common/version/8.0-dev/README.md) | ![](https://img.shields.io/packagist/dt/mouf/mvc.splash-common.svg) |
|
128 |
-
| [Woohoo Labs. Harmony](https://github.com/woohoolabs/harmony): a flexible micro-framework | ![](https://img.shields.io/packagist/dt/woohoolabs/harmony.svg) |
|
129 |
-
| [zend-expressive](https://github.com/zendframework/zend-expressive) | ![](https://img.shields.io/packagist/dt/zendframework/zend-expressive.svg) |
|
130 |
-
|
131 |
-
|
132 |
-
## Workflow
|
133 |
-
|
134 |
-
Everyone is welcome to join and contribute.
|
135 |
-
|
136 |
-
The general workflow looks like this:
|
137 |
-
|
138 |
-
1. Someone opens a discussion (GitHub issue) to suggest an interface
|
139 |
-
1. Feedback is gathered
|
140 |
-
1. The interface is added to a development branch
|
141 |
-
1. We release alpha versions so that the interface can be experimented with
|
142 |
-
1. Discussions and edits ensue until the interface is deemed stable by a general consensus
|
143 |
-
1. A new minor version of the package is released
|
144 |
-
|
145 |
-
We try to not break BC by creating new interfaces instead of editing existing ones.
|
146 |
-
|
147 |
-
While we currently work on interfaces, we are open to anything that might help towards interoperability, may that
|
148 |
-
be code, best practices, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/composer.json
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "container-interop/container-interop",
|
3 |
-
"type": "library",
|
4 |
-
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
5 |
-
"homepage": "https://github.com/container-interop/container-interop",
|
6 |
-
"license": "MIT",
|
7 |
-
"autoload": {
|
8 |
-
"psr-4": {
|
9 |
-
"Interop\\Container\\": "src/Interop/Container/"
|
10 |
-
}
|
11 |
-
},
|
12 |
-
"require": {
|
13 |
-
"psr/container": "^1.0"
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/docs/ContainerInterface-meta.md
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
# ContainerInterface Meta Document
|
2 |
-
|
3 |
-
## Introduction
|
4 |
-
|
5 |
-
This document describes the process and discussions that lead to the `ContainerInterface`.
|
6 |
-
Its goal is to explain the reasons behind each decision.
|
7 |
-
|
8 |
-
## Goal
|
9 |
-
|
10 |
-
The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
|
11 |
-
container to obtain objects and parameters.
|
12 |
-
|
13 |
-
By standardizing such a behavior, frameworks and libraries using the `ContainerInterface`
|
14 |
-
could work with any compatible container.
|
15 |
-
That would allow end users to choose their own container based on their own preferences.
|
16 |
-
|
17 |
-
It is important to distinguish the two usages of a container:
|
18 |
-
|
19 |
-
- configuring entries
|
20 |
-
- fetching entries
|
21 |
-
|
22 |
-
Most of the time, those two sides are not used by the same party.
|
23 |
-
While it is often end users who tend to configure entries, it is generally the framework that fetch
|
24 |
-
entries to build the application.
|
25 |
-
|
26 |
-
This is why this interface focuses only on how entries can be fetched from a container.
|
27 |
-
|
28 |
-
## Interface name
|
29 |
-
|
30 |
-
The interface name has been thoroughly discussed and was decided by a vote.
|
31 |
-
|
32 |
-
The list of options considered with their respective votes are:
|
33 |
-
|
34 |
-
- `ContainerInterface`: +8
|
35 |
-
- `ProviderInterface`: +2
|
36 |
-
- `LocatorInterface`: 0
|
37 |
-
- `ReadableContainerInterface`: -5
|
38 |
-
- `ServiceLocatorInterface`: -6
|
39 |
-
- `ObjectFactory`: -6
|
40 |
-
- `ObjectStore`: -8
|
41 |
-
- `ConsumerInterface`: -9
|
42 |
-
|
43 |
-
[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
|
44 |
-
|
45 |
-
The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1).
|
46 |
-
|
47 |
-
## Interface methods
|
48 |
-
|
49 |
-
The choice of which methods the interface would contain was made after a statistical analysis of existing containers.
|
50 |
-
The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681).
|
51 |
-
|
52 |
-
The summary of the analysis showed that:
|
53 |
-
|
54 |
-
- all containers offer a method to get an entry by its id
|
55 |
-
- a large majority name such method `get()`
|
56 |
-
- for all containers, the `get()` method has 1 mandatory parameter of type string
|
57 |
-
- some containers have an optional additional argument for `get()`, but it doesn't have the same purpose between containers
|
58 |
-
- a large majority of the containers offer a method to test if it can return an entry by its id
|
59 |
-
- a majority name such method `has()`
|
60 |
-
- for all containers offering `has()`, the method has exactly 1 parameter of type string
|
61 |
-
- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()`
|
62 |
-
- a large majority of the containers don't implement `ArrayAccess`
|
63 |
-
|
64 |
-
The question of whether to include methods to define entries has been discussed in
|
65 |
-
[issue #1](https://github.com/container-interop/container-interop/issues/1).
|
66 |
-
It has been judged that such methods do not belong in the interface described here because it is out of its scope
|
67 |
-
(see the "Goal" section).
|
68 |
-
|
69 |
-
As a result, the `ContainerInterface` contains two methods:
|
70 |
-
|
71 |
-
- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found.
|
72 |
-
- `has()`, returning a boolean, with one mandatory string parameter.
|
73 |
-
|
74 |
-
### Number of parameters in `get()` method
|
75 |
-
|
76 |
-
While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with
|
77 |
-
existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters
|
78 |
-
as long as they are optional, because the implementation *does* satisfy the interface.
|
79 |
-
|
80 |
-
This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6).
|
81 |
-
|
82 |
-
### Type of the `$id` parameter
|
83 |
-
|
84 |
-
The type of the `$id` parameter in `get()` and `has()` has been discussed in
|
85 |
-
[issue #6](https://github.com/container-interop/container-interop/issues/6).
|
86 |
-
While `string` is used in all the containers that were analyzed, it was suggested that allowing
|
87 |
-
anything (such as objects) could allow containers to offer a more advanced query API.
|
88 |
-
|
89 |
-
An example given was to use the container as an object builder. The `$id` parameter would then be an
|
90 |
-
object that would describe how to create an instance.
|
91 |
-
|
92 |
-
The conclusion of the discussion was that this was beyond the scope of getting entries from a container without
|
93 |
-
knowing how the container provided them, and it was more fit for a factory.
|
94 |
-
|
95 |
-
## Contributors
|
96 |
-
|
97 |
-
Are listed here all people that contributed in the discussions or votes, by alphabetical order:
|
98 |
-
|
99 |
-
- [Amy Stephen](https://github.com/AmyStephen)
|
100 |
-
- [David Négrier](https://github.com/moufmouf)
|
101 |
-
- [Don Gilbert](https://github.com/dongilbert)
|
102 |
-
- [Jason Judge](https://github.com/judgej)
|
103 |
-
- [Jeremy Lindblom](https://github.com/jeremeamia)
|
104 |
-
- [Marco Pivetta](https://github.com/Ocramius)
|
105 |
-
- [Matthieu Napoli](https://github.com/mnapoli)
|
106 |
-
- [Paul M. Jones](https://github.com/pmjones)
|
107 |
-
- [Stephan Hochdörfer](https://github.com/shochdoerfer)
|
108 |
-
- [Taylor Otwell](https://github.com/taylorotwell)
|
109 |
-
|
110 |
-
## Relevant links
|
111 |
-
|
112 |
-
- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php)
|
113 |
-
- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed)
|
114 |
-
- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/docs/ContainerInterface.md
DELETED
@@ -1,158 +0,0 @@
|
|
1 |
-
Container interface
|
2 |
-
===================
|
3 |
-
|
4 |
-
This document describes a common interface for dependency injection containers.
|
5 |
-
|
6 |
-
The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
|
7 |
-
container to obtain objects and parameters (called *entries* in the rest of this document).
|
8 |
-
|
9 |
-
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
10 |
-
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
11 |
-
interpreted as described in [RFC 2119][].
|
12 |
-
|
13 |
-
The word `implementor` in this document is to be interpreted as someone
|
14 |
-
implementing the `ContainerInterface` in a dependency injection-related library or framework.
|
15 |
-
Users of dependency injections containers (DIC) are referred to as `user`.
|
16 |
-
|
17 |
-
[RFC 2119]: http://tools.ietf.org/html/rfc2119
|
18 |
-
|
19 |
-
1. Specification
|
20 |
-
-----------------
|
21 |
-
|
22 |
-
### 1.1 Basics
|
23 |
-
|
24 |
-
- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`.
|
25 |
-
|
26 |
-
- `get` takes one mandatory parameter: an entry identifier. It MUST be a string.
|
27 |
-
A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier
|
28 |
-
is not known to the container. Two successive calls to `get` with the same
|
29 |
-
identifier SHOULD return the same value. However, depending on the `implementor`
|
30 |
-
design and/or `user` configuration, different values might be returned, so
|
31 |
-
`user` SHOULD NOT rely on getting the same value on 2 successive calls.
|
32 |
-
While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations
|
33 |
-
MAY accept additional optional parameters.
|
34 |
-
|
35 |
-
- `has` takes one unique parameter: an entry identifier. It MUST return `true`
|
36 |
-
if an entry identifier is known to the container and `false` if it is not.
|
37 |
-
`has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
38 |
-
It does however mean that `get($id)` will not throw a `NotFoundException`.
|
39 |
-
|
40 |
-
### 1.2 Exceptions
|
41 |
-
|
42 |
-
Exceptions directly thrown by the container MUST implement the
|
43 |
-
[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php).
|
44 |
-
|
45 |
-
A call to the `get` method with a non-existing id SHOULD throw a
|
46 |
-
[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php).
|
47 |
-
|
48 |
-
### 1.3 Additional features
|
49 |
-
|
50 |
-
This section describes additional features that MAY be added to a container. Containers are not
|
51 |
-
required to implement these features to respect the ContainerInterface.
|
52 |
-
|
53 |
-
#### 1.3.1 Delegate lookup feature
|
54 |
-
|
55 |
-
The goal of the *delegate lookup* feature is to allow several containers to share entries.
|
56 |
-
Containers implementing this feature can perform dependency lookups in other containers.
|
57 |
-
|
58 |
-
Containers implementing this feature will offer a greater lever of interoperability
|
59 |
-
with other containers. Implementation of this feature is therefore RECOMMENDED.
|
60 |
-
|
61 |
-
A container implementing this feature:
|
62 |
-
|
63 |
-
- MUST implement the `ContainerInterface`
|
64 |
-
- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
|
65 |
-
or any possible way). The delegate container MUST implement the `ContainerInterface`.
|
66 |
-
|
67 |
-
When a container is configured to use a delegate container for dependencies:
|
68 |
-
|
69 |
-
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
70 |
-
If the entry is not part of the container, an exception should be thrown
|
71 |
-
(as requested by the `ContainerInterface`).
|
72 |
-
- Calls to the `has` method should only return `true` if the entry is part of the container.
|
73 |
-
If the entry is not part of the container, `false` should be returned.
|
74 |
-
- If the fetched entry has dependencies, **instead** of performing
|
75 |
-
the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
76 |
-
|
77 |
-
Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
|
78 |
-
|
79 |
-
It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
80 |
-
into the same container (or another container) instead of the delegate container.
|
81 |
-
|
82 |
-
2. Package
|
83 |
-
----------
|
84 |
-
|
85 |
-
The interfaces and classes described as well as relevant exception are provided as part of the
|
86 |
-
[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package.
|
87 |
-
|
88 |
-
3. `Interop\Container\ContainerInterface`
|
89 |
-
-----------------------------------------
|
90 |
-
|
91 |
-
```php
|
92 |
-
<?php
|
93 |
-
namespace Interop\Container;
|
94 |
-
|
95 |
-
use Interop\Container\Exception\ContainerException;
|
96 |
-
use Interop\Container\Exception\NotFoundException;
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Describes the interface of a container that exposes methods to read its entries.
|
100 |
-
*/
|
101 |
-
interface ContainerInterface
|
102 |
-
{
|
103 |
-
/**
|
104 |
-
* Finds an entry of the container by its identifier and returns it.
|
105 |
-
*
|
106 |
-
* @param string $id Identifier of the entry to look for.
|
107 |
-
*
|
108 |
-
* @throws NotFoundException No entry was found for this identifier.
|
109 |
-
* @throws ContainerException Error while retrieving the entry.
|
110 |
-
*
|
111 |
-
* @return mixed Entry.
|
112 |
-
*/
|
113 |
-
public function get($id);
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Returns true if the container can return an entry for the given identifier.
|
117 |
-
* Returns false otherwise.
|
118 |
-
*
|
119 |
-
* `has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
120 |
-
* It does however mean that `get($id)` will not throw a `NotFoundException`.
|
121 |
-
*
|
122 |
-
* @param string $id Identifier of the entry to look for.
|
123 |
-
*
|
124 |
-
* @return boolean
|
125 |
-
*/
|
126 |
-
public function has($id);
|
127 |
-
}
|
128 |
-
```
|
129 |
-
|
130 |
-
4. `Interop\Container\Exception\ContainerException`
|
131 |
-
---------------------------------------------------
|
132 |
-
|
133 |
-
```php
|
134 |
-
<?php
|
135 |
-
namespace Interop\Container\Exception;
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Base interface representing a generic exception in a container.
|
139 |
-
*/
|
140 |
-
interface ContainerException
|
141 |
-
{
|
142 |
-
}
|
143 |
-
```
|
144 |
-
|
145 |
-
5. `Interop\Container\Exception\NotFoundException`
|
146 |
-
---------------------------------------------------
|
147 |
-
|
148 |
-
```php
|
149 |
-
<?php
|
150 |
-
namespace Interop\Container\Exception;
|
151 |
-
|
152 |
-
/**
|
153 |
-
* No entry was found in the container.
|
154 |
-
*/
|
155 |
-
interface NotFoundException extends ContainerException
|
156 |
-
{
|
157 |
-
}
|
158 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md
DELETED
@@ -1,259 +0,0 @@
|
|
1 |
-
Delegate lookup feature Meta Document
|
2 |
-
=====================================
|
3 |
-
|
4 |
-
1. Summary
|
5 |
-
----------
|
6 |
-
|
7 |
-
This document describes the *delegate lookup feature*.
|
8 |
-
Containers are not required to implement this feature to respect the `ContainerInterface`.
|
9 |
-
However, containers implementing this feature will offer a greater lever of interoperability
|
10 |
-
with other containers, allowing multiple containers to share entries in the same application.
|
11 |
-
Implementation of this feature is therefore recommanded.
|
12 |
-
|
13 |
-
2. Why Bother?
|
14 |
-
--------------
|
15 |
-
|
16 |
-
The [`ContainerInterface`](../src/Interop/Container/ContainerInterface.php) ([meta doc](ContainerInterface.md))
|
17 |
-
standardizes how frameworks and libraries make use of a container to obtain objects and parameters.
|
18 |
-
|
19 |
-
By standardizing such a behavior, frameworks and libraries relying on the `ContainerInterface`
|
20 |
-
could work with any compatible container.
|
21 |
-
That would allow end users to choose their own container based on their own preferences.
|
22 |
-
|
23 |
-
The `ContainerInterface` is also enough if we want to have several containers side-by-side in the same
|
24 |
-
application. For instance, this is what the [CompositeContainer](https://github.com/jeremeamia/acclimate-container/blob/master/src/CompositeContainer.php)
|
25 |
-
class of [Acclimate](https://github.com/jeremeamia/acclimate-container) is designed for:
|
26 |
-
|
27 |
-
![Side by side containers](images/side_by_side_containers.png)
|
28 |
-
|
29 |
-
However, an instance in container 1 cannot reference an instance in container 2.
|
30 |
-
|
31 |
-
It would be better if an instance of container 1 could reference an instance in container 2,
|
32 |
-
and the opposite should be true.
|
33 |
-
|
34 |
-
![Interoperating containers](images/interoperating_containers.png)
|
35 |
-
|
36 |
-
In the sample above, entry 1 in container 1 is referencing entry 3 in container 2.
|
37 |
-
|
38 |
-
3. Scope
|
39 |
-
--------
|
40 |
-
|
41 |
-
### 3.1 Goals
|
42 |
-
|
43 |
-
The goal of the *delegate lookup* feature is to allow several containers to share entries.
|
44 |
-
|
45 |
-
4. Approaches
|
46 |
-
-------------
|
47 |
-
|
48 |
-
### 4.1 Chosen Approach
|
49 |
-
|
50 |
-
Containers implementing this feature can perform dependency lookups in other containers.
|
51 |
-
|
52 |
-
A container implementing this feature:
|
53 |
-
|
54 |
-
- must implement the `ContainerInterface`
|
55 |
-
- must provide a way to register a *delegate container* (using a constructor parameter, or a setter, or any
|
56 |
-
possible way). The *delegate container* must implement the `ContainerInterface`.
|
57 |
-
|
58 |
-
When a *delegate container* is configured on a container:
|
59 |
-
|
60 |
-
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
61 |
-
If the entry is not part of the container, an exception should be thrown (as required in the `ContainerInterface`).
|
62 |
-
- Calls to the `has` method should only return *true* if the entry is part of the container.
|
63 |
-
If the entry is not part of the container, *false* should be returned.
|
64 |
-
- Finally, the important part: if the entry we are fetching has dependencies,
|
65 |
-
**instead** of perfoming the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
66 |
-
|
67 |
-
Important! By default, the lookup should be performed on the delegate container **only**, not on the container itself.
|
68 |
-
|
69 |
-
It is however allowed for containers to provide exception cases for special entries, and a way to lookup into
|
70 |
-
the same container (or another container) instead of the delegate container.
|
71 |
-
|
72 |
-
### 4.2 Typical usage
|
73 |
-
|
74 |
-
The *delegate container* will usually be a composite container. A composite container is a container that
|
75 |
-
contains several other containers. When performing a lookup on a composite container, the inner containers are
|
76 |
-
queried until one container returns an entry.
|
77 |
-
An inner container implementing the *delegate lookup feature* will return entries it contains, but if these
|
78 |
-
entries have dependencies, the dependencies lookup calls will be performed on the composite container, giving
|
79 |
-
a chance to all containers to answer.
|
80 |
-
|
81 |
-
Interestingly enough, the order in which containers are added in the composite container matters. Indeed,
|
82 |
-
the first containers to be added in the composite container can "override" the entries of containers with
|
83 |
-
lower priority.
|
84 |
-
|
85 |
-
![Containers priority](images/priority.png)
|
86 |
-
|
87 |
-
In the example above, "container 2" contains a controller "myController" and the controller is referencing an
|
88 |
-
"entityManager" entry. "Container 1" contains also an entry named "entityManager".
|
89 |
-
Without the *delegate lookup* feature, when requesting the "myController" instance to container 2, it would take
|
90 |
-
in charge the instanciation of both entries.
|
91 |
-
|
92 |
-
However, using the *delegate lookup* feature, here is what happens when we ask the composite container for the
|
93 |
-
"myController" instance:
|
94 |
-
|
95 |
-
- The composite container asks container 1 if if contains the "myController" instance. The answer is no.
|
96 |
-
- The composite container asks container 2 if if contains the "myController" instance. The answer is yes.
|
97 |
-
- The composite container performs a `get` call on container 2 for the "myController" instance.
|
98 |
-
- Container 2 sees that "myController" has a dependency on "entityManager".
|
99 |
-
- Container 2 delegates the lookup of "entityManager" to the composite container.
|
100 |
-
- The composite container asks container 1 if if contains the "entityManager" instance. The answer is yes.
|
101 |
-
- The composite container performs a `get` call on container 1 for the "entityManager" instance.
|
102 |
-
|
103 |
-
In the end, we get a controller instanciated by container 2 that references an entityManager instanciated
|
104 |
-
by container 1.
|
105 |
-
|
106 |
-
### 4.3 Alternative: the fallback strategy
|
107 |
-
|
108 |
-
The first proposed approach we tried was to perform all the lookups in the "local" container,
|
109 |
-
and if a lookup fails in the container, to use the delegate container. In this scenario, the
|
110 |
-
delegate container is used in "fallback" mode.
|
111 |
-
|
112 |
-
This strategy has been described in @moufmouf blog post: http://mouf-php.com/container-interop-whats-next (solution 1).
|
113 |
-
It was also discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-33570697) and
|
114 |
-
[here](https://github.com/container-interop/container-interop/pull/20#issuecomment-56599631).
|
115 |
-
|
116 |
-
Problems with this strategy:
|
117 |
-
|
118 |
-
- Heavy problem regarding infinite loops
|
119 |
-
- Unable to overload a container entry with the delegate container entry
|
120 |
-
|
121 |
-
### 4.4 Alternative: force implementing an interface
|
122 |
-
|
123 |
-
The first proposed approach was to develop a `ParentAwareContainerInterface` interface.
|
124 |
-
It was proposed here: https://github.com/container-interop/container-interop/pull/8
|
125 |
-
|
126 |
-
The interface would have had the behaviour of the delegate lookup feature but would have forced the addition of
|
127 |
-
a `setParentContainter` method:
|
128 |
-
|
129 |
-
```php
|
130 |
-
interface ParentAwareContainerInterface extends ReadableContainerInterface {
|
131 |
-
/**
|
132 |
-
* Sets the parent container associated to that container. This container will call
|
133 |
-
* the parent container to fetch dependencies.
|
134 |
-
*
|
135 |
-
* @param ContainerInterface $container
|
136 |
-
*/
|
137 |
-
public function setParentContainer(ContainerInterface $container);
|
138 |
-
}
|
139 |
-
```
|
140 |
-
|
141 |
-
The interface idea was first questioned by @Ocramius [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777).
|
142 |
-
@Ocramius expressed the idea that an interface should not contain setters, otherwise, it is forcing implementation
|
143 |
-
details on the class implementing the interface.
|
144 |
-
Then @mnapoli made a proposal for a "convention" [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51841079),
|
145 |
-
this idea was further discussed until all participants in the discussion agreed to remove the interface idea
|
146 |
-
and replace it with a "standard" feature.
|
147 |
-
|
148 |
-
**Pros:**
|
149 |
-
|
150 |
-
If we had had an interface, we could have delegated the registration of the delegate/composite container to the
|
151 |
-
the delegate/composite container itself.
|
152 |
-
For instance:
|
153 |
-
|
154 |
-
```php
|
155 |
-
$containerA = new ContainerA();
|
156 |
-
$containerB = new ContainerB();
|
157 |
-
|
158 |
-
$compositeContainer = new CompositeContainer([$containerA, $containerB]);
|
159 |
-
|
160 |
-
// The call to 'setParentContainer' is delegated to the CompositeContainer
|
161 |
-
// It is not the responsibility of the user anymore.
|
162 |
-
class CompositeContainer {
|
163 |
-
...
|
164 |
-
|
165 |
-
public function __construct($containers) {
|
166 |
-
foreach ($containers as $container) {
|
167 |
-
if ($container instanceof ParentAwareContainerInterface) {
|
168 |
-
$container->setParentContainer($this);
|
169 |
-
}
|
170 |
-
}
|
171 |
-
...
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
```
|
176 |
-
|
177 |
-
**Cons:**
|
178 |
-
|
179 |
-
Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777).
|
180 |
-
Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments,
|
181 |
-
and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface.
|
182 |
-
|
183 |
-
### 4.4 Alternative: no exception case for delegate lookups
|
184 |
-
|
185 |
-
Originally, the proposed wording for delegate lookup calls was:
|
186 |
-
|
187 |
-
> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself.
|
188 |
-
|
189 |
-
This was later replaced by:
|
190 |
-
|
191 |
-
> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
|
192 |
-
>
|
193 |
-
> It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
194 |
-
> into the same container (or another container) instead of the delegate container.
|
195 |
-
|
196 |
-
Exception cases have been allowed to avoid breaking dependencies with some services that must be provided
|
197 |
-
by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235
|
198 |
-
|
199 |
-
### 4.5 Alternative: having one of the containers act as the composite container
|
200 |
-
|
201 |
-
In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to
|
202 |
-
add another DI container to this container. Most of the time, the "big" framework will be responsible for
|
203 |
-
creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted,
|
204 |
-
the "big" framework will not be aware of the existence of a composite container that it should use instead
|
205 |
-
of its own container.
|
206 |
-
|
207 |
-
For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container
|
208 |
-
to make it act as a composite container.
|
209 |
-
|
210 |
-
This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194)
|
211 |
-
and [here](http://mouf-php.com/container-interop-whats-next#solution4).
|
212 |
-
|
213 |
-
This was implemented in Symfony 2 using:
|
214 |
-
|
215 |
-
- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0)
|
216 |
-
- [framework interop](https://github.com/mnapoli/framework-interop/)
|
217 |
-
|
218 |
-
This was implemented in Silex using:
|
219 |
-
|
220 |
-
- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di)
|
221 |
-
|
222 |
-
Having a container act as the composite container is not part of the delegate lookup standard because it is
|
223 |
-
simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop
|
224 |
-
play nice with other DI containers.
|
225 |
-
|
226 |
-
|
227 |
-
5. Implementations
|
228 |
-
------------------
|
229 |
-
|
230 |
-
The following projects already implement the delegate lookup feature:
|
231 |
-
|
232 |
-
- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120)
|
233 |
-
- [PHP-DI](http://php-di.org/), through the [`$wrapperContainer` parameter of the constructor](https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Container.php#L72)
|
234 |
-
- [pimple-interop](https://github.com/moufmouf/pimple-interop), through the [`$container` parameter of the constructor](https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L62)
|
235 |
-
|
236 |
-
6. People
|
237 |
-
---------
|
238 |
-
|
239 |
-
Are listed here all people that contributed in the discussions, by alphabetical order:
|
240 |
-
|
241 |
-
- [Alexandru Pătrănescu](https://github.com/drealecs)
|
242 |
-
- [Ben Peachey](https://github.com/potherca)
|
243 |
-
- [David Négrier](https://github.com/moufmouf)
|
244 |
-
- [Jeremy Lindblom](https://github.com/jeremeamia)
|
245 |
-
- [Marco Pivetta](https://github.com/Ocramius)
|
246 |
-
- [Matthieu Napoli](https://github.com/mnapoli)
|
247 |
-
- [Nelson J Morais](https://github.com/njasm)
|
248 |
-
- [Phil Sturgeon](https://github.com/philsturgeon)
|
249 |
-
- [Stephan Hochdörfer](https://github.com/shochdoerfer)
|
250 |
-
|
251 |
-
7. Relevant Links
|
252 |
-
-----------------
|
253 |
-
|
254 |
-
_**Note:** Order descending chronologically._
|
255 |
-
|
256 |
-
- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20)
|
257 |
-
- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8)
|
258 |
-
- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next)
|
259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/docs/Delegate-lookup.md
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
Delegate lookup feature
|
2 |
-
=======================
|
3 |
-
|
4 |
-
This document describes a standard for dependency injection containers.
|
5 |
-
|
6 |
-
The goal set by the *delegate lookup* feature is to allow several containers to share entries.
|
7 |
-
Containers implementing this feature can perform dependency lookups in other containers.
|
8 |
-
|
9 |
-
Containers implementing this feature will offer a greater lever of interoperability
|
10 |
-
with other containers. Implementation of this feature is therefore RECOMMENDED.
|
11 |
-
|
12 |
-
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
13 |
-
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
14 |
-
interpreted as described in [RFC 2119][].
|
15 |
-
|
16 |
-
The word `implementor` in this document is to be interpreted as someone
|
17 |
-
implementing the delegate lookup feature in a dependency injection-related library or framework.
|
18 |
-
Users of dependency injections containers (DIC) are referred to as `user`.
|
19 |
-
|
20 |
-
[RFC 2119]: http://tools.ietf.org/html/rfc2119
|
21 |
-
|
22 |
-
1. Vocabulary
|
23 |
-
-------------
|
24 |
-
|
25 |
-
In a dependency injection container, the container is used to fetch entries.
|
26 |
-
Entries can have dependencies on other entries. Usually, these other entries are fetched by the container.
|
27 |
-
|
28 |
-
The *delegate lookup* feature is the ability for a container to fetch dependencies in
|
29 |
-
another container. In the rest of the document, the word "container" will reference the container
|
30 |
-
implemented by the implementor. The word "delegate container" will reference the container we are
|
31 |
-
fetching the dependencies from.
|
32 |
-
|
33 |
-
2. Specification
|
34 |
-
----------------
|
35 |
-
|
36 |
-
A container implementing the *delegate lookup* feature:
|
37 |
-
|
38 |
-
- MUST implement the [`ContainerInterface`](ContainerInterface.md)
|
39 |
-
- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
|
40 |
-
or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md).
|
41 |
-
|
42 |
-
When a container is configured to use a delegate container for dependencies:
|
43 |
-
|
44 |
-
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
45 |
-
If the entry is not part of the container, an exception should be thrown
|
46 |
-
(as requested by the [`ContainerInterface`](ContainerInterface.md)).
|
47 |
-
- Calls to the `has` method should only return `true` if the entry is part of the container.
|
48 |
-
If the entry is not part of the container, `false` should be returned.
|
49 |
-
- If the fetched entry has dependencies, **instead** of performing
|
50 |
-
the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
51 |
-
|
52 |
-
Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself.
|
53 |
-
|
54 |
-
It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
55 |
-
into the same container (or another container) instead of the delegate container.
|
56 |
-
|
57 |
-
3. Package / Interface
|
58 |
-
----------------------
|
59 |
-
|
60 |
-
This feature is not tied to any code, interface or package.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/docs/images/interoperating_containers.png
DELETED
Binary file
|
vendor/container-interop/container-interop/docs/images/priority.png
DELETED
Binary file
|
vendor/container-interop/container-interop/docs/images/side_by_side_containers.png
DELETED
Binary file
|
vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace Interop\Container;
|
7 |
-
|
8 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace Interop\Container\Exception;
|
7 |
-
|
8 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace Interop\Container\Exception;
|
7 |
-
|
8 |
-
use Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* No entry was found in the container.
|
12 |
-
*/
|
13 |
-
interface NotFoundException extends ContainerException, PsrNotFoundException
|
14 |
-
{
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/CHANGELOG.md
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
# Changelog
|
2 |
-
|
3 |
-
All Notable changes to `League\Container` will be documented in this file
|
4 |
-
|
5 |
-
## 2.3.0
|
6 |
-
|
7 |
-
### Added
|
8 |
-
- Now implementation of the PSR-11.
|
9 |
-
|
10 |
-
### Changed
|
11 |
-
- Can now wrap shared objects as `RawArgument`.
|
12 |
-
- Ability to override shared items.
|
13 |
-
|
14 |
-
### Fixed
|
15 |
-
- Booleans now recognised as accepted values.
|
16 |
-
- Various docblock fixes.
|
17 |
-
- Unused imports removed.
|
18 |
-
- Unreachable arguments no longer passed.
|
19 |
-
|
20 |
-
## 2.2.0
|
21 |
-
|
22 |
-
### Changed
|
23 |
-
- Service providers can now be added multiple times by giving them a signature.
|
24 |
-
|
25 |
-
## 2.1.0
|
26 |
-
|
27 |
-
### Added
|
28 |
-
- Allow resolving of `RawArgument` objects as first class dependencies.
|
29 |
-
|
30 |
-
### Changed
|
31 |
-
- Unnecessary recursion removed from `Container::get`.
|
32 |
-
|
33 |
-
## 2.0.3
|
34 |
-
|
35 |
-
### Fixed
|
36 |
-
- Bug where delegating container was not passed to delegate when needed.
|
37 |
-
- Bug where `Container::extend` would not return a shared definition to extend.
|
38 |
-
|
39 |
-
## 2.0.2
|
40 |
-
|
41 |
-
### Fixed
|
42 |
-
- Bug introduced in 2.0.1 where shared definitions registered via a service provider would never be returned as shared.
|
43 |
-
|
44 |
-
## 2.0.1
|
45 |
-
|
46 |
-
### Fixed
|
47 |
-
- Bug where shared definitions were not stored as shared.
|
48 |
-
|
49 |
-
## 2.0.0
|
50 |
-
|
51 |
-
### Added
|
52 |
-
- Now implementation of the container-interop project.
|
53 |
-
- `BootableServiceProviderInterface` for eagerly loaded service providers.
|
54 |
-
- Delegate container functionality.
|
55 |
-
- `RawArgument` to ensure scalars are not resolved from the container but seen as an argument.
|
56 |
-
|
57 |
-
### Altered
|
58 |
-
- Refactor of definition functionality.
|
59 |
-
- `Container::share` replaces `singleton` functionality to improve understanding.
|
60 |
-
- Auto wiring is now disabled by default.
|
61 |
-
- Auto wiring abstracted to be a delegate container `ReflectionContainer` handling all reflection based functionality.
|
62 |
-
- Inflection functionality abstracted to an aggregate.
|
63 |
-
- Service provider functionality abstracted to an aggregate.
|
64 |
-
- Much bloat removed.
|
65 |
-
- `Container::call` now proxies to `ReflectionContainer::call` and handles argument resolution in a much more efficient way.
|
66 |
-
|
67 |
-
### Removed
|
68 |
-
- Ability to register invokables, this functionality added a layer of complexity too large for the problem it solved.
|
69 |
-
- Container no longer accepts a configuration array, this functionality will now be provided by an external service provider package.
|
70 |
-
|
71 |
-
## 1.4.0
|
72 |
-
|
73 |
-
### Added
|
74 |
-
- Added `isRegisteredCallable` method to public API.
|
75 |
-
- Invoking `call` now accepts named arguments at runtime.
|
76 |
-
|
77 |
-
### Fixed
|
78 |
-
- Container now stores instantiated Service Providers after first instantiation.
|
79 |
-
- Extending a definition now looks in Service Providers as well as just Definitions.
|
80 |
-
|
81 |
-
## 1.3.1 - 2015-02-21
|
82 |
-
|
83 |
-
### Fixed
|
84 |
-
- Fixed bug where arbitrary values were attempted to be resolved as classes.
|
85 |
-
|
86 |
-
## 1.3.0 - 2015-02-09
|
87 |
-
|
88 |
-
### Added
|
89 |
-
- Added `ServiceProvider` functionality to allow cleaner resolving of complex dependencies.
|
90 |
-
- Added `Inflector` functionality to allow for manipulation of resolved objects of a specific type.
|
91 |
-
- Improvements to DRY throughout the package.
|
92 |
-
|
93 |
-
### Fixed
|
94 |
-
- Setter in `ContainerAwareTrait` now returns self (`$this`).
|
95 |
-
|
96 |
-
## 1.2.1 - 2015-01-29
|
97 |
-
|
98 |
-
### Fixed
|
99 |
-
- Allow arbitrary values to be registered via container config.
|
100 |
-
|
101 |
-
## 1.2.0 - 2015-01-13
|
102 |
-
|
103 |
-
### Added
|
104 |
-
- Improvements to `Container::call` functionality.
|
105 |
-
|
106 |
-
### Fixed
|
107 |
-
- General code tidy.
|
108 |
-
- Improvements to test suite.
|
109 |
-
|
110 |
-
## 1.1.1 - 2015-01-13
|
111 |
-
|
112 |
-
### Fixed
|
113 |
-
- Allow singleton to be passed as method argument.
|
114 |
-
|
115 |
-
## 1.1.0 - 2015-01-12
|
116 |
-
|
117 |
-
### Added
|
118 |
-
- Addition of `ContainerAwareTrait` to provide functionality from `ContainerAwareInterface`.
|
119 |
-
|
120 |
-
## 1.0.0 - 2015-01-12
|
121 |
-
|
122 |
-
### Added
|
123 |
-
- Migrated from [Orno\Di](https://github.com/orno/di).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/CONTRIBUTING.md
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
# Contributing
|
2 |
-
|
3 |
-
Contributions are **welcome** and will be fully **credited**.
|
4 |
-
|
5 |
-
We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/container).
|
6 |
-
|
7 |
-
## Pull Requests
|
8 |
-
|
9 |
-
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
|
10 |
-
|
11 |
-
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
|
12 |
-
|
13 |
-
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
14 |
-
|
15 |
-
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
|
16 |
-
|
17 |
-
- **Create feature branches** - Don't ask us to pull from your master branch.
|
18 |
-
|
19 |
-
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
|
20 |
-
|
21 |
-
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
|
22 |
-
|
23 |
-
## Running Tests
|
24 |
-
|
25 |
-
``` bash
|
26 |
-
$ phpunit
|
27 |
-
```
|
28 |
-
|
29 |
-
**Happy coding**!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/LICENSE.md
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
# The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2014 Phil Bennett <philipobenito@gmail.com>
|
4 |
-
|
5 |
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
-
> of this software and associated documentation files (the "Software"), to deal
|
7 |
-
> in the Software without restriction, including without limitation the rights
|
8 |
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
-
> copies of the Software, and to permit persons to whom the Software is
|
10 |
-
> furnished to do so, subject to the following conditions:
|
11 |
-
>
|
12 |
-
> The above copyright notice and this permission notice shall be included in
|
13 |
-
> all copies or substantial portions of the Software.
|
14 |
-
>
|
15 |
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
-
> THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/README.md
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
# Container (Dependency Injection)
|
2 |
-
|
3 |
-
[![Author](http://img.shields.io/badge/author-@philipobenito-blue.svg?style=flat-square)](https://twitter.com/philipobenito)
|
4 |
-
[![Latest Version](https://img.shields.io/github/release/thephpleague/container.svg?style=flat-square)](https://github.com/thephpleague/container/releases)
|
5 |
-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
|
6 |
-
[![Build Status](https://img.shields.io/travis/thephpleague/container/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/container)
|
7 |
-
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/container.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/container/code-structure)
|
8 |
-
[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/container.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/container)
|
9 |
-
[![Total Downloads](https://img.shields.io/packagist/dt/league/container.svg?style=flat-square)](https://packagist.org/packages/league/container)
|
10 |
-
|
11 |
-
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/ad6b4c3e-8f93-4968-8dd3-391d39a4c3c2/big.png)](https://insight.sensiolabs.com/projects/ad6b4c3e-8f93-4968-8dd3-391d39a4c3c2)
|
12 |
-
|
13 |
-
This package is compliant with [PSR-1], [PSR-2] and [PSR-4]. If you notice compliance oversights,
|
14 |
-
please send a patch via pull request.
|
15 |
-
|
16 |
-
[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
|
17 |
-
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
|
18 |
-
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
|
19 |
-
[PSR-11]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md
|
20 |
-
|
21 |
-
## Install
|
22 |
-
|
23 |
-
Via Composer
|
24 |
-
|
25 |
-
``` bash
|
26 |
-
$ composer require league/container
|
27 |
-
```
|
28 |
-
|
29 |
-
## Requirements
|
30 |
-
|
31 |
-
The following versions of PHP are supported by this version.
|
32 |
-
|
33 |
-
* PHP 5.4
|
34 |
-
* PHP 5.5
|
35 |
-
* PHP 5.6
|
36 |
-
* PHP 7.0
|
37 |
-
* PHP 7.1
|
38 |
-
* HHVM
|
39 |
-
|
40 |
-
## Documentation
|
41 |
-
|
42 |
-
Container has [full documentation](http://container.thephpleague.com), powered by [Jekyll](http://jekyllrb.com/).
|
43 |
-
|
44 |
-
Contribute to this documentation in the [gh-pages branch](https://github.com/thephpleague/container/tree/gh-pages/).
|
45 |
-
|
46 |
-
## Testing
|
47 |
-
|
48 |
-
``` bash
|
49 |
-
$ vendor/bin/phpunit
|
50 |
-
```
|
51 |
-
|
52 |
-
## Contributing
|
53 |
-
|
54 |
-
Please see [CONTRIBUTING](https://github.com/thephpleague/container/blob/master/CONTRIBUTING.md) for details.
|
55 |
-
|
56 |
-
## Security
|
57 |
-
|
58 |
-
If you discover any security related issues, please email philipobenito@gmail.com instead of using the issue tracker.
|
59 |
-
|
60 |
-
## Credits
|
61 |
-
|
62 |
-
- [Phil Bennett](https://github.com/philipobenito)
|
63 |
-
- [All Contributors](https://github.com/thephpleague/container/contributors)
|
64 |
-
|
65 |
-
All `Orno\Di` contributions can be found [here](https://github.com/orno/di/graphs/contributors).
|
66 |
-
|
67 |
-
## License
|
68 |
-
|
69 |
-
The MIT License (MIT). Please see [License File](https://github.com/thephpleague/container/blob/master/LICENSE.md) for more information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/composer.json
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "league/container",
|
3 |
-
"description": "A fast and intuitive dependency injection container.",
|
4 |
-
"keywords": [
|
5 |
-
"league",
|
6 |
-
"container",
|
7 |
-
"dependency",
|
8 |
-
"injection",
|
9 |
-
"di",
|
10 |
-
"service",
|
11 |
-
"provider"
|
12 |
-
],
|
13 |
-
"homepage": "https://github.com/thephpleague/container",
|
14 |
-
"license": "MIT",
|
15 |
-
"authors": [
|
16 |
-
{
|
17 |
-
"name": "Phil Bennett",
|
18 |
-
"email": "philipobenito@gmail.com",
|
19 |
-
"homepage": "http://www.philipobenito.com",
|
20 |
-
"role": "Developer"
|
21 |
-
}
|
22 |
-
],
|
23 |
-
"require": {
|
24 |
-
"php": "^5.4.0 || ^7.0",
|
25 |
-
"container-interop/container-interop": "^1.2"
|
26 |
-
},
|
27 |
-
"require-dev": {
|
28 |
-
"phpunit/phpunit" : "4.*"
|
29 |
-
},
|
30 |
-
"provide": {
|
31 |
-
"container-interop/container-interop-implementation": "^1.2",
|
32 |
-
"psr/container-implementation": "^1.0"
|
33 |
-
},
|
34 |
-
"replace": {
|
35 |
-
"orno/di": "~2.0"
|
36 |
-
},
|
37 |
-
"autoload": {
|
38 |
-
"psr-4": {
|
39 |
-
"League\\Container\\": "src"
|
40 |
-
}
|
41 |
-
},
|
42 |
-
"autoload-dev": {
|
43 |
-
"psr-4": {
|
44 |
-
"League\\Container\\Test\\": "tests"
|
45 |
-
}
|
46 |
-
},
|
47 |
-
"extra": {
|
48 |
-
"branch-alias": {
|
49 |
-
"dev-2.x": "2.x-dev",
|
50 |
-
"dev-1.x": "1.x-dev"
|
51 |
-
}
|
52 |
-
}
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Argument/ArgumentResolverInterface.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Argument;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Argument/ArgumentResolverTrait.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Argument;
|
4 |
-
|
5 |
-
use League\Container\Exception\NotFoundException;
|
6 |
-
use 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 \League\Container\ContainerInterface
|
80 |
-
*/
|
81 |
-
abstract public function getContainer();
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Argument/RawArgument.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Argument/RawArgumentInterface.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Container.php
DELETED
@@ -1,305 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
-
use League\Container\Argument\RawArgumentInterface;
|
7 |
-
use League\Container\Definition\DefinitionFactory;
|
8 |
-
use League\Container\Definition\DefinitionFactoryInterface;
|
9 |
-
use League\Container\Definition\DefinitionInterface;
|
10 |
-
use League\Container\Exception\NotFoundException;
|
11 |
-
use League\Container\Inflector\InflectorAggregate;
|
12 |
-
use League\Container\Inflector\InflectorAggregateInterface;
|
13 |
-
use League\Container\ServiceProvider\ServiceProviderAggregate;
|
14 |
-
use League\Container\ServiceProvider\ServiceProviderAggregateInterface;
|
15 |
-
|
16 |
-
class Container implements ContainerInterface
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @var \League\Container\Definition\DefinitionFactoryInterface
|
20 |
-
*/
|
21 |
-
protected $definitionFactory;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @var \League\Container\Definition\DefinitionInterface[]
|
25 |
-
*/
|
26 |
-
protected $definitions = [];
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @var \League\Container\Definition\DefinitionInterface[]
|
30 |
-
*/
|
31 |
-
protected $sharedDefinitions = [];
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @var \League\Container\Inflector\InflectorAggregateInterface
|
35 |
-
*/
|
36 |
-
protected $inflectors;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @var \League\Container\ServiceProvider\ServiceProviderAggregateInterface
|
40 |
-
*/
|
41 |
-
protected $providers;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @var array
|
45 |
-
*/
|
46 |
-
protected $shared = [];
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @var \Interop\Container\ContainerInterface[]
|
50 |
-
*/
|
51 |
-
protected $delegates = [];
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Constructor.
|
55 |
-
*
|
56 |
-
* @param \League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers
|
57 |
-
* @param \League\Container\Inflector\InflectorAggregateInterface|null $inflectors
|
58 |
-
* @param \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 \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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ContainerAwareInterface.php
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
interface ContainerAwareInterface
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* Set a container
|
9 |
-
*
|
10 |
-
* @param \League\Container\ContainerInterface $container
|
11 |
-
*/
|
12 |
-
public function setContainer(ContainerInterface $container);
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Get the container
|
16 |
-
*
|
17 |
-
* @return \League\Container\ContainerInterface
|
18 |
-
*/
|
19 |
-
public function getContainer();
|
20 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ContainerAwareTrait.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
trait ContainerAwareTrait
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* @var \League\Container\ContainerInterface
|
9 |
-
*/
|
10 |
-
protected $container;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Set a container.
|
14 |
-
*
|
15 |
-
* @param \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 \League\Container\ContainerInterface
|
29 |
-
*/
|
30 |
-
public function getContainer()
|
31 |
-
{
|
32 |
-
return $this->container;
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ContainerInterface.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 \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 \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|\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 \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 \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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/AbstractDefinition.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Definition;
|
4 |
-
|
5 |
-
use League\Container\Argument\ArgumentResolverInterface;
|
6 |
-
use League\Container\Argument\ArgumentResolverTrait;
|
7 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/CallableDefinition.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/ClassDefinition.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/ClassDefinitionInterface.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/DefinitionFactory.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Definition;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/DefinitionFactoryInterface.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Definition;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Definition/DefinitionInterface.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Exception/NotFoundException.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Exception;
|
4 |
-
|
5 |
-
use Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface;
|
6 |
-
use InvalidArgumentException;
|
7 |
-
|
8 |
-
class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
|
9 |
-
{
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ImmutableContainerAwareInterface.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
-
|
7 |
-
interface ImmutableContainerAwareInterface
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* Set a container
|
11 |
-
*
|
12 |
-
* @param \Interop\Container\ContainerInterface $container
|
13 |
-
*/
|
14 |
-
public function setContainer(InteropContainerInterface $container);
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Get the container
|
18 |
-
*
|
19 |
-
* @return \League\Container\ImmutableContainerInterface
|
20 |
-
*/
|
21 |
-
public function getContainer();
|
22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ImmutableContainerAwareTrait.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
-
|
7 |
-
trait ImmutableContainerAwareTrait
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* @var \Interop\Container\ContainerInterface
|
11 |
-
*/
|
12 |
-
protected $container;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Set a container.
|
16 |
-
*
|
17 |
-
* @param \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 \League\Container\ImmutableContainerInterface
|
31 |
-
*/
|
32 |
-
public function getContainer()
|
33 |
-
{
|
34 |
-
return $this->container;
|
35 |
-
}
|
36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ImmutableContainerInterface.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface as InteropContainerInterface;
|
6 |
-
|
7 |
-
interface ImmutableContainerInterface extends InteropContainerInterface
|
8 |
-
{
|
9 |
-
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Inflector/Inflector.php
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Inflector;
|
4 |
-
|
5 |
-
use League\Container\ImmutableContainerAwareTrait;
|
6 |
-
use League\Container\Argument\ArgumentResolverInterface;
|
7 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Inflector/InflectorAggregate.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Inflector;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/Inflector/InflectorAggregateInterface.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\Inflector;
|
4 |
-
|
5 |
-
use 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 \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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ReflectionContainer.php
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container;
|
4 |
-
|
5 |
-
use League\Container\Argument\ArgumentResolverInterface;
|
6 |
-
use League\Container\Argument\ArgumentResolverTrait;
|
7 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/AbstractServiceProvider.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\ServiceProvider;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/BootableServiceProviderInterface.php
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\ServiceProvider;
|
4 |
-
|
5 |
-
use League\Container\ContainerAwareInterface;
|
6 |
-
use 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 (\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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\ServiceProvider;
|
4 |
-
|
5 |
-
use League\Container\ContainerAwareInterface;
|
6 |
-
|
7 |
-
interface ServiceProviderAggregateInterface extends ContainerAwareInterface
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* Add a service provider to the aggregate.
|
11 |
-
*
|
12 |
-
* @param string|\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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/ServiceProviderInterface.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace League\Container\ServiceProvider;
|
4 |
-
|
5 |
-
use 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/.gitignore
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
composer.lock
|
2 |
-
composer.phar
|
3 |
-
/vendor/
|
|
|
|
|
|
vendor/psr/container/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2013-2016 container-interop
|
4 |
-
Copyright (c) 2016 PHP Framework Interoperability Group
|
5 |
-
|
6 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7 |
-
this software and associated documentation files (the "Software"), to deal in
|
8 |
-
the Software without restriction, including without limitation the rights to
|
9 |
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
10 |
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
11 |
-
subject to the following conditions:
|
12 |
-
|
13 |
-
The above copyright notice and this permission notice shall be included in all
|
14 |
-
copies or substantial portions of the Software.
|
15 |
-
|
16 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
18 |
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
19 |
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
20 |
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21 |
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
# PSR Container
|
2 |
-
|
3 |
-
This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md).
|
4 |
-
|
5 |
-
Note that this is not a container implementation of its own. See the specification for more details.
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/composer.json
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "psr/container",
|
3 |
-
"type": "library",
|
4 |
-
"description": "Common Container Interface (PHP FIG PSR-11)",
|
5 |
-
"keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"],
|
6 |
-
"homepage": "https://github.com/php-fig/container",
|
7 |
-
"license": "MIT",
|
8 |
-
"authors": [
|
9 |
-
{
|
10 |
-
"name": "PHP-FIG",
|
11 |
-
"homepage": "http://www.php-fig.org/"
|
12 |
-
}
|
13 |
-
],
|
14 |
-
"require": {
|
15 |
-
"php": ">=5.3.0"
|
16 |
-
},
|
17 |
-
"autoload": {
|
18 |
-
"psr-4": {
|
19 |
-
"Psr\\Container\\": "src/"
|
20 |
-
}
|
21 |
-
},
|
22 |
-
"extra": {
|
23 |
-
"branch-alias": {
|
24 |
-
"dev-master": "1.0.x-dev"
|
25 |
-
}
|
26 |
-
}
|
27 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/src/ContainerExceptionInterface.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace Psr\Container;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Base interface representing a generic exception in a container.
|
10 |
-
*/
|
11 |
-
interface ContainerExceptionInterface
|
12 |
-
{
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/src/ContainerInterface.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace 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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/container/src/NotFoundExceptionInterface.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace Psr\Container;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* No entry was found in the container.
|
10 |
-
*/
|
11 |
-
interface NotFoundExceptionInterface extends ContainerExceptionInterface
|
12 |
-
{
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wp-media/rocket-lazyload-common/src/Assets.php
CHANGED
@@ -39,18 +39,18 @@ class Assets {
|
|
39 |
];
|
40 |
|
41 |
$allowed_options = [
|
42 |
-
'container'
|
43 |
-
'thresholds'
|
44 |
-
'data_bg'
|
45 |
-
'class_error'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'callback_enter'
|
49 |
-
'callback_exit'
|
50 |
-
'
|
51 |
-
'callback_error'
|
52 |
-
'callback_finish'
|
53 |
-
'use_native'
|
54 |
];
|
55 |
|
56 |
$args = wp_parse_args( $args, $defaults );
|
39 |
];
|
40 |
|
41 |
$allowed_options = [
|
42 |
+
'container' => 1,
|
43 |
+
'thresholds' => 1,
|
44 |
+
'data_bg' => 1,
|
45 |
+
'class_error' => 1,
|
46 |
+
'cancel_on_exit' => 1,
|
47 |
+
'unobserve_completed' => 1,
|
48 |
+
'callback_enter' => 1,
|
49 |
+
'callback_exit' => 1,
|
50 |
+
'callback_loading' => 1,
|
51 |
+
'callback_error' => 1,
|
52 |
+
'callback_finish' => 1,
|
53 |
+
'use_native' => 1,
|
54 |
];
|
55 |
|
56 |
$args = wp_parse_args( $args, $defaults );
|
vendor/wp-media/rocket-lazyload-common/src/Image.php
CHANGED
@@ -20,7 +20,9 @@ class Image {
|
|
20 |
* @return string
|
21 |
*/
|
22 |
public function lazyloadImages( $html, $buffer ) {
|
23 |
-
|
|
|
|
|
24 |
return $html;
|
25 |
}
|
26 |
|
@@ -51,7 +53,7 @@ class Image {
|
|
51 |
* @return string
|
52 |
*/
|
53 |
public function lazyloadBackgroundImages( $html, $buffer ) {
|
54 |
-
if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
|
55 |
return $html;
|
56 |
}
|
57 |
|
@@ -64,7 +66,15 @@ class Image {
|
|
64 |
continue;
|
65 |
}
|
66 |
|
67 |
-
$url['url'] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
|
70 |
continue;
|
@@ -72,7 +82,7 @@ class Image {
|
|
72 |
|
73 |
$lazy_bg = $this->addLazyCLass( $element[0] );
|
74 |
$lazy_bg = str_replace( $url[0], '', $lazy_bg );
|
75 |
-
$lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="
|
76 |
|
77 |
$html = str_replace( $element[0], $lazy_bg, $html );
|
78 |
unset( $lazy_bg );
|
@@ -88,17 +98,142 @@ class Image {
|
|
88 |
* @return string
|
89 |
*/
|
90 |
private function addLazyClass( $element ) {
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
|
104 |
/**
|
@@ -149,8 +284,10 @@ class Image {
|
|
149 |
continue;
|
150 |
}
|
151 |
|
152 |
-
$img_lazy
|
153 |
-
$
|
|
|
|
|
154 |
|
155 |
unset( $img_lazy );
|
156 |
}
|
20 |
* @return string
|
21 |
*/
|
22 |
public function lazyloadImages( $html, $buffer ) {
|
23 |
+
$clean_buffer = preg_replace( '/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html );
|
24 |
+
$clean_buffer = preg_replace( '#<noscript>(?:.+)</noscript>#Umsi', '', $clean_buffer );
|
25 |
+
if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $clean_buffer, $images, PREG_SET_ORDER)) {
|
26 |
return $html;
|
27 |
}
|
28 |
|
53 |
* @return string
|
54 |
*/
|
55 |
public function lazyloadBackgroundImages( $html, $buffer ) {
|
56 |
+
if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li|a)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
|
57 |
return $html;
|
58 |
}
|
59 |
|
66 |
continue;
|
67 |
}
|
68 |
|
69 |
+
$url['url'] = esc_url(
|
70 |
+
trim(
|
71 |
+
strip_tags(
|
72 |
+
html_entity_decode(
|
73 |
+
$url['url'], ENT_QUOTES|ENT_HTML5
|
74 |
+
)
|
75 |
+
), '\'" '
|
76 |
+
)
|
77 |
+
);
|
78 |
|
79 |
if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
|
80 |
continue;
|
82 |
|
83 |
$lazy_bg = $this->addLazyCLass( $element[0] );
|
84 |
$lazy_bg = str_replace( $url[0], '', $lazy_bg );
|
85 |
+
$lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="' . esc_attr( $url['url'] ) . '"', $lazy_bg );
|
86 |
|
87 |
$html = str_replace( $element[0], $lazy_bg, $html );
|
88 |
unset( $lazy_bg );
|
98 |
* @return string
|
99 |
*/
|
100 |
private function addLazyClass( $element ) {
|
101 |
+
$class = $this->getClasses( $element );
|
102 |
+
if ( empty( $class ) ) {
|
103 |
+
return preg_replace( '#<(img|div|figure|section|li|span|a)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element );
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( empty( $class['attribute'] ) || empty( $class['classes'] ) ) {
|
107 |
+
return str_replace( $class['attribute'], 'class="rocket-lazyload"', $element );
|
108 |
+
}
|
109 |
+
|
110 |
+
$quotes = $this->getAttributeQuotes( $class['classes'] );
|
111 |
+
$classes = $this->trimOuterQuotes( $class['classes'], $quotes );
|
112 |
+
|
113 |
+
if ( empty( $classes ) ) {
|
114 |
+
return str_replace( $class['attribute'], 'class="rocket-lazyload"', $element );
|
115 |
+
}
|
116 |
+
|
117 |
+
$classes .= ' rocket-lazyload';
|
118 |
|
119 |
+
return str_replace(
|
120 |
+
$class['attribute'],
|
121 |
+
'class=' . $this->normalizeClasses( $classes, $quotes ),
|
122 |
+
$element
|
123 |
+
);
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Gets the attribute value's outer quotation mark, if one exists, i.e. " or '.
|
128 |
+
*
|
129 |
+
* @param string $attribute_value The target attribute's value.
|
130 |
+
*
|
131 |
+
* @return bool|string quotation character; else false when no quotation mark.
|
132 |
+
*/
|
133 |
+
private function getAttributeQuotes( $attribute_value ) {
|
134 |
+
$attribute_value = trim( $attribute_value );
|
135 |
+
$first_char = $attribute_value[0];
|
136 |
|
137 |
+
if ( '"' === $first_char || "'" === $first_char ) {
|
138 |
+
return $first_char;
|
139 |
+
}
|
140 |
+
|
141 |
+
return false;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Gets the class attribute and values from the given element, if it exists.
|
146 |
+
*
|
147 |
+
* @param string $element Given HTML element to extract classes from.
|
148 |
+
*
|
149 |
+
* @return bool|string[] {
|
150 |
+
* @type string $attribute Class attribute and value, e.g. class="value"
|
151 |
+
* @type string $classes String of class attribute's value(s)
|
152 |
+
* }; else, false when no class attribute exists.
|
153 |
+
*/
|
154 |
+
private function getClasses( $element ) {
|
155 |
+
if ( ! preg_match( '#class\s*=\s*(?<classes>["\'].*?["\']|[^\s]+)#is', $element, $class ) ) {
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( empty( $class ) ) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
+
if ( ! isset( $class['classes'] ) ) {
|
164 |
+
return false;
|
165 |
}
|
166 |
|
167 |
+
return [
|
168 |
+
'attribute' => $class[0],
|
169 |
+
'classes' => $class['classes'],
|
170 |
+
];
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Removes outer single or double quotations.
|
175 |
+
*
|
176 |
+
* @param string $string String to strip quotes from.
|
177 |
+
* @param string $quotes The outer quotes to remove.
|
178 |
+
*
|
179 |
+
* @return string string without quotes.
|
180 |
+
*/
|
181 |
+
private function trimOuterQuotes( $string, $quotes ) {
|
182 |
+
$string = trim( $string );
|
183 |
+
if ( empty( $string ) ) {
|
184 |
+
return '';
|
185 |
+
}
|
186 |
+
|
187 |
+
if ( empty( $quotes ) ) {
|
188 |
+
return $string;
|
189 |
+
}
|
190 |
+
|
191 |
+
$string = ltrim( $string, $quotes );
|
192 |
+
$string = rtrim( $string, $quotes );
|
193 |
+
return trim( $string );
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Normalizes the class attribute values to ensure well-formed.
|
198 |
+
*
|
199 |
+
* @param string $classes String of class attribute value(s).
|
200 |
+
* @param string|bool $quotes Optional. Quotation mark to wrap around the classes.
|
201 |
+
*
|
202 |
+
* @return string well-formed class attributes.
|
203 |
+
*/
|
204 |
+
private function normalizeClasses( $classes, $quotes = '"' ) {
|
205 |
+
$array_of_classes = $this->stringToArray( $classes );
|
206 |
+
$classes = implode( ' ', $array_of_classes );
|
207 |
+
|
208 |
+
if ( false === $quotes ) {
|
209 |
+
$quotes = '"';
|
210 |
+
}
|
211 |
+
|
212 |
+
return $quotes . $classes . $quotes;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Converts the given string into an array of strings.
|
217 |
+
*
|
218 |
+
* Note:
|
219 |
+
* 1. Removes empties.
|
220 |
+
* 2. Trims each string.
|
221 |
+
*
|
222 |
+
* @param string $string The target string to convert.
|
223 |
+
* @param string $delimiter Optional. Default: ' ' empty string.
|
224 |
+
*
|
225 |
+
* @return array An array of trimmed strings.
|
226 |
+
*/
|
227 |
+
private function stringToArray( $string, $delimiter = ' ' ) {
|
228 |
+
if ( empty( $string ) ) {
|
229 |
+
return [];
|
230 |
+
}
|
231 |
+
|
232 |
+
$array = explode( $delimiter, $string );
|
233 |
+
$array = array_map('trim', $array );
|
234 |
+
|
235 |
+
// Remove empties.
|
236 |
+
return array_filter( $array );
|
237 |
}
|
238 |
|
239 |
/**
|
284 |
continue;
|
285 |
}
|
286 |
|
287 |
+
$img_lazy = $this->replaceImage( $img );
|
288 |
+
$img_lazy .= $this->noscript( $img[0] );
|
289 |
+
$safe_img = str_replace('/', '\/', preg_quote( $img[0], '#' ));
|
290 |
+
$html = preg_replace( '#<noscript[^>]*>.*' . $safe_img . '.*<\/noscript>(*SKIP)(*FAIL)|' . $safe_img . '#iU', $img_lazy, $html );
|
291 |
|
292 |
unset( $img_lazy );
|
293 |
}
|