Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
functions.php
001 <?php
002
003 namespace GuzzleHttp\Promise;
004
005 /**
006 * Get the global task queue used for promise resolution.
007 *
008 * This task queue MUST be run in an event loop in order for promises to be
009 * settled asynchronously. It will be automatically run when synchronously
010 * waiting on a promise.
011 *
012 * <code>
013 * while ($eventLoop->isRunning()) {
014 * GuzzleHttp\Promise\queue()->run();
015 * }
016 * </code>
017 *
018 * @param TaskQueueInterface $assign Optionally specify a new queue instance.
019 *
020 * @return TaskQueueInterface
021 *
022 * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
023 */
024 function queue(TaskQueueInterface $assign = null)
025 {
026 return Utils::queue($assign);
027 }
028
029 /**
030 * Adds a function to run in the task queue when it is next `run()` and returns
031 * a promise that is fulfilled or rejected with the result.
032 *
033 * @param callable $task Task function to run.
034 *
035 * @return PromiseInterface
036 *
037 * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
038 */
039 function task(callable $task)
040 {
041 return Utils::task($task);
042 }
043
044 /**
045 * Creates a promise for a value if the value is not a promise.
046 *
047 * @param mixed $value Promise or value.
048 *
049 * @return PromiseInterface
050 *
051 * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
052 */
053 function promise_for($value)
054 {
055 return Create::promiseFor($value);
056 }
057
058 /**
059 * Creates a rejected promise for a reason if the reason is not a promise. If
060 * the provided reason is a promise, then it is returned as-is.
061 *
062 * @param mixed $reason Promise or reason.
063 *
064 * @return PromiseInterface
065 *
066 * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
067 */
068 function rejection_for($reason)
069 {
070 return Create::rejectionFor($reason);
071 }
072
073 /**
074 * Create an exception for a rejected promise value.
075 *
076 * @param mixed $reason
077 *
078 * @return \Exception|\Throwable
079 *
080 * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
081 */
082 function exception_for($reason)
083 {
084 return Create::exceptionFor($reason);
085 }
086
087 /**
088 * Returns an iterator for the given value.
089 *
090 * @param mixed $value
091 *
092 * @return \Iterator
093 *
094 * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
095 */
096 function iter_for($value)
097 {
098 return Create::iterFor($value);
099 }
100
101 /**
102 * Synchronously waits on a promise to resolve and returns an inspection state
103 * array.
104 *
105 * Returns a state associative array containing a "state" key mapping to a
106 * valid promise state. If the state of the promise is "fulfilled", the array
107 * will contain a "value" key mapping to the fulfilled value of the promise. If
108 * the promise is rejected, the array will contain a "reason" key mapping to
109 * the rejection reason of the promise.
110 *
111 * @param PromiseInterface $promise Promise or value.
112 *
113 * @return array
114 *
115 * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
116 */
117 function inspect(PromiseInterface $promise)
118 {
119 return Utils::inspect($promise);
120 }
121
122 /**
123 * Waits on all of the provided promises, but does not unwrap rejected promises
124 * as thrown exception.
125 *
126 * Returns an array of inspection state arrays.
127 *
128 * @see inspect for the inspection state array format.
129 *
130 * @param PromiseInterface[] $promises Traversable of promises to wait upon.
131 *
132 * @return array
133 *
134 * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
135 */
136 function inspect_all($promises)
137 {
138 return Utils::inspectAll($promises);
139 }
140
141 /**
142 * Waits on all of the provided promises and returns the fulfilled values.
143 *
144 * Returns an array that contains the value of each promise (in the same order
145 * the promises were provided). An exception is thrown if any of the promises
146 * are rejected.
147 *
148 * @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
149 *
150 * @return array
151 *
152 * @throws \Exception on error
153 * @throws \Throwable on error in PHP >=7
154 *
155 * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
156 */
157 function unwrap($promises)
158 {
159 return Utils::unwrap($promises);
160 }
161
162 /**
163 * Given an array of promises, return a promise that is fulfilled when all the
164 * items in the array are fulfilled.
165 *
166 * The promise's fulfillment value is an array with fulfillment values at
167 * respective positions to the original array. If any promise in the array
168 * rejects, the returned promise is rejected with the rejection reason.
169 *
170 * @param mixed $promises Promises or values.
171 * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
172 *
173 * @return PromiseInterface
174 *
175 * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
176 */
177 function all($promises, $recursive = false)
178 {
179 return Utils::all($promises, $recursive);
180 }
181
182 /**
183 * Initiate a competitive race between multiple promises or values (values will
184 * become immediately fulfilled promises).
185 *
186 * When count amount of promises have been fulfilled, the returned promise is
187 * fulfilled with an array that contains the fulfillment values of the winners
188 * in order of resolution.
189 *
190 * This promise is rejected with a {@see AggregateException} if the number of
191 * fulfilled promises is less than the desired $count.
192 *
193 * @param int $count Total number of promises.
194 * @param mixed $promises Promises or values.
195 *
196 * @return PromiseInterface
197 *
198 * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
199 */
200 function some($count, $promises)
201 {
202 return Utils::some($count, $promises);
203 }
204
205 /**
206 * Like some(), with 1 as count. However, if the promise fulfills, the
207 * fulfillment value is not an array of 1 but the value directly.
208 *
209 * @param mixed $promises Promises or values.
210 *
211 * @return PromiseInterface
212 *
213 * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
214 */
215 function any($promises)
216 {
217 return Utils::any($promises);
218 }
219
220 /**
221 * Returns a promise that is fulfilled when all of the provided promises have
222 * been fulfilled or rejected.
223 *
224 * The returned promise is fulfilled with an array of inspection state arrays.
225 *
226 * @see inspect for the inspection state array format.
227 *
228 * @param mixed $promises Promises or values.
229 *
230 * @return PromiseInterface
231 *
232 * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
233 */
234 function settle($promises)
235 {
236 return Utils::settle($promises);
237 }
238
239 /**
240 * Given an iterator that yields promises or values, returns a promise that is
241 * fulfilled with a null value when the iterator has been consumed or the
242 * aggregate promise has been fulfilled or rejected.
243 *
244 * $onFulfilled is a function that accepts the fulfilled value, iterator index,
245 * and the aggregate promise. The callback can invoke any necessary side
246 * effects and choose to resolve or reject the aggregate if needed.
247 *
248 * $onRejected is a function that accepts the rejection reason, iterator index,
249 * and the aggregate promise. The callback can invoke any necessary side
250 * effects and choose to resolve or reject the aggregate if needed.
251 *
252 * @param mixed $iterable Iterator or array to iterate over.
253 * @param callable $onFulfilled
254 * @param callable $onRejected
255 *
256 * @return PromiseInterface
257 *
258 * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
259 */
260 function each(
261 $iterable,
262 callable $onFulfilled = null,
263 callable $onRejected = null
264 ) {
265 return Each::of($iterable, $onFulfilled, $onRejected);
266 }
267
268 /**
269 * Like each, but only allows a certain number of outstanding promises at any
270 * given time.
271 *
272 * $concurrency may be an integer or a function that accepts the number of
273 * pending promises and returns a numeric concurrency limit value to allow for
274 * dynamic a concurrency size.
275 *
276 * @param mixed $iterable
277 * @param int|callable $concurrency
278 * @param callable $onFulfilled
279 * @param callable $onRejected
280 *
281 * @return PromiseInterface
282 *
283 * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
284 */
285 function each_limit(
286 $iterable,
287 $concurrency,
288 callable $onFulfilled = null,
289 callable $onRejected = null
290 ) {
291 return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
292 }
293
294 /**
295 * Like each_limit, but ensures that no promise in the given $iterable argument
296 * is rejected. If any promise is rejected, then the aggregate promise is
297 * rejected with the encountered rejection.
298 *
299 * @param mixed $iterable
300 * @param int|callable $concurrency
301 * @param callable $onFulfilled
302 *
303 * @return PromiseInterface
304 *
305 * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
306 */
307 function each_limit_all(
308 $iterable,
309 $concurrency,
310 callable $onFulfilled = null
311 ) {
312 return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
313 }
314
315 /**
316 * Returns true if a promise is fulfilled.
317 *
318 * @return bool
319 *
320 * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
321 */
322 function is_fulfilled(PromiseInterface $promise)
323 {
324 return Is::fulfilled($promise);
325 }
326
327 /**
328 * Returns true if a promise is rejected.
329 *
330 * @return bool
331 *
332 * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
333 */
334 function is_rejected(PromiseInterface $promise)
335 {
336 return Is::rejected($promise);
337 }
338
339 /**
340 * Returns true if a promise is fulfilled or rejected.
341 *
342 * @return bool
343 *
344 * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
345 */
346 function is_settled(PromiseInterface $promise)
347 {
348 return Is::settled($promise);
349 }
350
351 /**
352 * Create a new coroutine.
353 *
354 * @see Coroutine
355 *
356 * @return PromiseInterface
357 *
358 * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
359 */
360 function coroutine(callable $generatorFn)
361 {
362 return Coroutine::of($generatorFn);
363 }
364