forked from friendica/friendica-addons
Compare commits
235 commits
stable
...
2024.09-rc
Author | SHA1 | Date | |
---|---|---|---|
7172695705 | |||
5f50fd2498 | |||
0697f078f1 | |||
f2a9eb151d | |||
16e06f9b2b | |||
d0e8b2b4be | |||
01ec6ecb8e | |||
4437f79380 | |||
52b18c7d9a | |||
f29908464b | |||
3719d1eee5 | |||
a04d22ad01 | |||
b3c286ab85 | |||
51c6b5c6cc | |||
176cbcaf3a | |||
fecae6564b | |||
422e4fd48f | |||
6a2c0d974e | |||
f52bb75c97 | |||
8989e0dab6 | |||
7fcbd76c6b | |||
dc0b79bed1 | |||
|
a0c727ac35 | ||
e133a693c2 | |||
aa5130247b | |||
aeefb92926 | |||
c22e0ae831 | |||
f499875f5b | |||
6a1cbe9040 | |||
6980d3b02b | |||
e89b5b1466 | |||
5638e7f065 | |||
4165479079 | |||
fca2d609c9 | |||
8b694fbb4c | |||
5a9dafec70 | |||
586ebe9699 | |||
10bd219bd1 | |||
08c17c9dd4 | |||
feb7722f72 | |||
f8f63532f4 | |||
ef37aa60e3 | |||
6f3ba10466 | |||
778b9e3f61 | |||
10521115c4 | |||
956233ff1d | |||
14e1c96775 | |||
7a7dbb579d | |||
712edf4236 | |||
5c0cddfc1d | |||
3dc77b2102 | |||
6c43a14198 | |||
0dfb345f85 | |||
ab837dfec5 | |||
2f9076bffd | |||
454e9834bf | |||
50930c301d | |||
3457ab2f3f | |||
276c27678f | |||
cd95ca1a0a | |||
5c04e7136f | |||
179382d8a9 | |||
a55f80cb39 | |||
4ad7d61893 | |||
4bfdb45e81 | |||
4414471100 | |||
|
46a55f13f7 | ||
a97cccb6b2 | |||
c0535db742 | |||
0c04b086cb | |||
|
589cf712cc | ||
ce53e48cb2 | |||
|
f3db763c59 | ||
4e5998c73d | |||
|
5f27f72b0d | ||
b0a95ca2d2 | |||
b2108c7a4c | |||
abca07b29d | |||
14e7413eb2 | |||
d3dcd5428c | |||
|
18e512cc8b | ||
|
7d5446a778 | ||
38ea90104d | |||
|
08b46e5536 | ||
39567cf701 | |||
2789e880dc | |||
1556ebfb33 | |||
|
3e1b98d5d9 | ||
ed07c987a6 | |||
af868f45ab | |||
7f0cf2527c | |||
9525259fc8 | |||
f7ca152754 | |||
6f56932f12 | |||
b6f2e7dd50 | |||
fa16adccaf | |||
252f3e222a | |||
231d830db0 | |||
27e362213f | |||
734d35d22b | |||
722fdc07fb | |||
77c471ab4d | |||
bac665864e | |||
c7f4d183b1 | |||
7f073ec520 | |||
39247ca28f | |||
084a2a7057 | |||
c8fab935ee | |||
9ae8925069 | |||
0eff72fa03 | |||
2306261ab2 | |||
26eea26f95 | |||
e7dd7111ac | |||
60f5d14b8e | |||
c7a6ecb346 | |||
38b75b6529 | |||
67b464cc47 | |||
20f2f12871 | |||
85d254f2f8 | |||
a4598a2427 | |||
6c76139ce1 | |||
8e81330f21 | |||
b9d0cece0a | |||
d4abc9bac8 | |||
dc7a8adf29 | |||
739041b74f | |||
9c6a86ffaa | |||
38466415b3 | |||
3bf547ee6e | |||
9627e95b19 | |||
aea944c8b5 | |||
340f5e627c | |||
9153ca05fd | |||
3bdbcd3b02 | |||
010261c1dc | |||
3f26f9785e | |||
b4eee553d1 | |||
04ce1fd2b4 | |||
569931986d | |||
0a69c66d09 | |||
7bff983d21 | |||
d910502a17 | |||
c6b2ed96d7 | |||
a020ac4309 | |||
d838fc6421 | |||
b0ee9fdf2a | |||
46c65b79be | |||
11cc359434 | |||
872a438dcf | |||
da8681c8c4 | |||
67c44792fd | |||
|
cfbbeaac62 | ||
|
32f698ce10 | ||
|
a110b2f6c1 | ||
|
fc33555cd6 | ||
|
e24e3f758a | ||
|
127ab370fc | ||
|
890bc3712f | ||
|
2cff751b12 | ||
|
89134542b4 | ||
|
453772e393 | ||
|
0bcf2d7c89 | ||
|
c6daf2381c | ||
|
51797d975b | ||
|
a40bd7009b | ||
|
1bcd23f684 | ||
f3bddaf7d6 | |||
4a14bc47ee | |||
09b3f01558 | |||
e1f27d88b7 | |||
57c4735ad6 | |||
372a850103 | |||
7e890124a8 | |||
904bf11e54 | |||
1af97e5c9e | |||
02a6fdd9a2 | |||
d11efc108c | |||
d5dfa8028c | |||
3da448b01f | |||
0fc8285f87 | |||
167b7f9466 | |||
ef7548f5bc | |||
c9923e47de | |||
6a9287dc6f | |||
eeb783d71d | |||
0812886b61 | |||
09ae5cfaff | |||
0751b2ac16 | |||
ed641e6ccb | |||
a05e429470 | |||
6e355979e8 | |||
3c0f4e3926 | |||
affa8829d5 | |||
b6d706822a | |||
c49b61be8b | |||
90ec1bc838 | |||
dcafad573e | |||
dc709c699a | |||
|
58cb933779 | ||
53be7d9423 | |||
2ee78d2f0b | |||
d19b9ba9e3 | |||
5f7233fd20 | |||
9168f3d167 | |||
7580054394 | |||
bdc27184fc | |||
346e22c5f5 | |||
de784bdc95 | |||
6d578d1495 | |||
bcef83e148 | |||
2b5f8e9c82 | |||
e4bb463b5b | |||
52f7910f4c | |||
9208fd46a4 | |||
810dc02dd4 | |||
f678468d42 | |||
52ea77eabb | |||
84fc5ba922 | |||
d5c7a49db2 | |||
c9f985d842 | |||
2452b05cc5 | |||
8b35c9fddb | |||
446fd9b17b | |||
a30e9b788c | |||
b05a95cc45 | |||
c28af61873 | |||
2b391eb368 | |||
07a7a87c37 | |||
4dd903b473 | |||
a179bab747 | |||
13fd713b66 | |||
4dedd24320 | |||
|
bddb7f4d49 | ||
82073db292 | |||
a26e90b202 |
819 changed files with 32403 additions and 25739 deletions
|
@ -27,3 +27,6 @@ indent_size = 2
|
|||
[*.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[composer.json]
|
||||
indent_size = 4
|
||||
|
|
|
@ -4,6 +4,9 @@ pipeline:
|
|||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git config --global --add safe.directory $CI_WORKSPACE
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
when:
|
||||
|
@ -13,7 +16,7 @@ pipeline:
|
|||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- git clone $CI_REPO_CLONE_URL addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
|
|
|
@ -9,6 +9,9 @@ pipeline:
|
|||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git config --global --add safe.directory $CI_WORKSPACE
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
when:
|
||||
|
@ -20,7 +23,7 @@ pipeline:
|
|||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- git clone $CI_REPO_CLONE_URL addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
|
@ -45,7 +48,7 @@ pipeline:
|
|||
branch: [ develop, '*-rc' ]
|
||||
event: push
|
||||
composer_install:
|
||||
image: friendicaci/php7.4:php7.4.33
|
||||
image: friendicaci/php8.2:php8.2.16
|
||||
commands:
|
||||
- export COMPOSER_HOME=.composer
|
||||
- composer validate
|
||||
|
|
|
@ -4,6 +4,9 @@ pipeline:
|
|||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git config --global --add safe.directory $CI_WORKSPACE
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
when:
|
||||
|
@ -13,7 +16,7 @@ pipeline:
|
|||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- git clone $CI_REPO_CLONE_URL addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
|
|
|
@ -5,9 +5,11 @@ matrix:
|
|||
- PHP_MAJOR_VERSION: 8.0
|
||||
PHP_VERSION: 8.0.30
|
||||
- PHP_MAJOR_VERSION: 8.1
|
||||
PHP_VERSION: 8.1.23
|
||||
PHP_VERSION: 8.1.27
|
||||
- PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.11
|
||||
PHP_VERSION: 8.2.16
|
||||
- PHP_MAJOR_VERSION: 8.3
|
||||
PHP_VERSION: 8.3.3
|
||||
|
||||
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
||||
labels:
|
||||
|
@ -19,6 +21,9 @@ pipeline:
|
|||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git config --global --add safe.directory $CI_WORKSPACE
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
clone_friendica_addon:
|
||||
|
@ -26,7 +31,7 @@ pipeline:
|
|||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- git clone $CI_REPO_CLONE_URL addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
|
@ -76,7 +81,7 @@ pipeline:
|
|||
- cp config/local-sample.config.php config/local.config.php
|
||||
- if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
|
||||
- mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
|
||||
- if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
|
||||
- if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
|
||||
phpenmod xdebug;
|
||||
export XDEBUG_MODE=coverage;
|
||||
phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml;
|
||||
|
@ -87,15 +92,15 @@ pipeline:
|
|||
image: friendicaci/codecov
|
||||
when:
|
||||
matrix:
|
||||
PHP_MAJOR_VERSION: 7.4
|
||||
PHP_VERSION: 7.4.33
|
||||
PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.16
|
||||
repo:
|
||||
- friendica/friendica-addons
|
||||
commands:
|
||||
- codecov -R '.' -Z -f 'clover.xml'
|
||||
secrets:
|
||||
- source: codecov-token
|
||||
target: codecov_token
|
||||
environment:
|
||||
CODECOV_TOKEN:
|
||||
from_secret: codecov-token
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
|
|
|
@ -9,6 +9,9 @@ pipeline:
|
|||
clone_friendica_base:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git config --global --add safe.directory $CI_WORKSPACE
|
||||
- git clone https://github.com/friendica/friendica.git .
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
when:
|
||||
|
@ -19,7 +22,7 @@ pipeline:
|
|||
commands:
|
||||
- git config --global user.email "no-reply@friendi.ca"
|
||||
- git config --global user.name "Friendica"
|
||||
- git clone $CI_REPO_LINK addon
|
||||
- git clone $CI_REPO_CLONE_URL addon
|
||||
- cd addon/
|
||||
- git checkout $CI_COMMIT_BRANCH
|
||||
- git fetch origin $CI_COMMIT_REF
|
||||
|
@ -42,7 +45,7 @@ pipeline:
|
|||
repo: friendica/friendica-addons
|
||||
event: tag
|
||||
composer_install:
|
||||
image: friendicaci/php7.4:php7.4.33
|
||||
image: friendicaci/php8.2:php8.2.16
|
||||
commands:
|
||||
- export COMPOSER_HOME=.composer
|
||||
- composer validate
|
||||
|
|
|
@ -54,7 +54,7 @@ new Vue({
|
|||
self.rules.push(responseJSON.rule);
|
||||
self.resetForm();
|
||||
}, function (response) {
|
||||
self.errorMessage = response.responseJSON.message;
|
||||
self.errorMessage = response.responseJSON.exception[0].message;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -74,7 +74,7 @@ new Vue({
|
|||
self.rules[self.editedIndex] = rule;
|
||||
self.resetForm();
|
||||
}, function (response) {
|
||||
self.errorMessage = response.responseJSON.message;
|
||||
self.errorMessage = response.responseJSON.exception[0].message;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ function advancedcontentfilter_module() {}
|
|||
function advancedcontentfilter_init()
|
||||
{
|
||||
if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'api') {
|
||||
$slim = new \Slim\App();
|
||||
$slim = \Slim\Factory\AppFactory::create();
|
||||
|
||||
require __DIR__ . '/src/middlewares.php';
|
||||
|
||||
|
@ -253,7 +253,7 @@ function advancedcontentfilter_content()
|
|||
'cancel' => DI::l10n()->t('Cancel'),
|
||||
],
|
||||
'$current_theme' => DI::app()->getCurrentTheme(),
|
||||
'$rules' => advancedcontentfilter_get_rules(),
|
||||
'$rules' => DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])),
|
||||
'$form_security_token' => BaseModule::getFormSecurityToken()
|
||||
]);
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ function advancedcontentfilter_build_fields($data)
|
|||
* API
|
||||
*/
|
||||
|
||||
function advancedcontentfilter_get_rules()
|
||||
function advancedcontentfilter_get_rules(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method'));
|
||||
|
@ -313,7 +313,8 @@ function advancedcontentfilter_get_rules()
|
|||
|
||||
$rules = DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()]));
|
||||
|
||||
return json_encode($rules);
|
||||
$response->getBody()->write(json_encode($rules));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args)
|
||||
|
@ -324,10 +325,11 @@ function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, Res
|
|||
|
||||
$rule = DBA::selectFirst('advancedcontentfilter_rules', [], ['id' => $args['id'], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||
|
||||
return json_encode($rule);
|
||||
$response->getBody()->write(json_encode($rule));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
function advancedcontentfilter_post_rules(ServerRequestInterface $request)
|
||||
function advancedcontentfilter_post_rules(ServerRequestInterface $request, ResponseInterface $response)
|
||||
{
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method'));
|
||||
|
@ -360,7 +362,8 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request)
|
|||
|
||||
DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId());
|
||||
|
||||
return json_encode(['message' => DI::l10n()->t('Rule successfully added'), 'rule' => $rule]);
|
||||
$response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully added'), 'rule' => $rule]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args)
|
||||
|
@ -391,7 +394,8 @@ function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, Res
|
|||
|
||||
DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId());
|
||||
|
||||
return json_encode(['message' => DI::l10n()->t('Rule successfully updated')]);
|
||||
$response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully updated')]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args)
|
||||
|
@ -414,7 +418,8 @@ function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request,
|
|||
|
||||
DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId());
|
||||
|
||||
return json_encode(['message' => DI::l10n()->t('Rule successfully deleted')]);
|
||||
$response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully deleted')]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
function advancedcontentfilter_get_variables_guid(ServerRequestInterface $request, ResponseInterface $response, $args)
|
||||
|
@ -437,7 +442,8 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques
|
|||
|
||||
$return = advancedcontentfilter_get_filter_fields(advancedcontentfilter_prepare_item_row($item_row));
|
||||
|
||||
return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]);
|
||||
$response->getBody()->write(json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
{
|
||||
"name": "friendica-addons/advancedcontentfilter",
|
||||
"description": "Advanced Content Filter addon for Friendica",
|
||||
"type": "friendica-addon",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Hypolite Petovan",
|
||||
"email": "hypolite@mrpetovan.com",
|
||||
"homepage": "https://friendica.mrpetovan.com/profile/hypolite",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"slim/slim": "^3.1",
|
||||
"symfony/expression-language": "^3.4"
|
||||
},
|
||||
"license": "3-clause BSD license",
|
||||
"minimum-stability": "stable",
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"autoloader-suffix": "AdvancedContentFilterAddon",
|
||||
"preferred-install": "dist"
|
||||
}
|
||||
"name": "friendica-addons/advancedcontentfilter",
|
||||
"description": "Advanced Content Filter addon for Friendica",
|
||||
"type": "friendica-addon",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Hypolite Petovan",
|
||||
"email": "hypolite@mrpetovan.com",
|
||||
"homepage": "https://friendica.mrpetovan.com/profile/hypolite",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"slim/slim": "^4",
|
||||
"symfony/expression-language": "^3.4"
|
||||
},
|
||||
"license": "3-clause BSD license",
|
||||
"minimum-stability": "stable",
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
},
|
||||
"optimize-autoloader": true,
|
||||
"autoloader-suffix": "AdvancedContentFilterAddon",
|
||||
"preferred-install": "dist"
|
||||
}
|
||||
}
|
||||
|
|
1014
advancedcontentfilter/composer.lock
generated
1014
advancedcontentfilter/composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,7 @@
|
|||
#
|
||||
# Translators:
|
||||
# fabrixxm <fabrix.xm@gmail.com>, 2018
|
||||
# Sylke Vicious <silkevicious@gmail.com>, 2021
|
||||
# Sylke Vicious <silkevicious@gmail.com>, 2023
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
|
@ -14,7 +14,7 @@ msgstr ""
|
|||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-05-11 08:54-0400\n"
|
||||
"PO-Revision-Date: 2018-05-24 06:41+0000\n"
|
||||
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>, 2021\n"
|
||||
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>, 2023\n"
|
||||
"Language-Team: Italian (https://app.transifex.com/Friendica/teams/12172/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
@ -125,7 +125,7 @@ msgstr "Annulla"
|
|||
|
||||
#: advancedcontentfilter.php:295
|
||||
msgid "This addon requires this node having at least one post"
|
||||
msgstr ""
|
||||
msgstr "Questo addon richiede che questo nodo abbia almeno un messaggio"
|
||||
|
||||
#: advancedcontentfilter.php:325 advancedcontentfilter.php:336
|
||||
#: advancedcontentfilter.php:347 advancedcontentfilter.php:383
|
||||
|
|
|
@ -27,6 +27,7 @@ $a->strings['Add new rule'] = 'Aggiungi nuova regola';
|
|||
$a->strings['Rule Name'] = 'Nome Regola';
|
||||
$a->strings['Rule Expression'] = 'Espressione Regola';
|
||||
$a->strings['Cancel'] = 'Annulla';
|
||||
$a->strings['This addon requires this node having at least one post'] = 'Questo addon richiede che questo nodo abbia almeno un messaggio';
|
||||
$a->strings['You must be logged in to use this method'] = 'Devi essere autenticato per usare questo metodo';
|
||||
$a->strings['Invalid form security token, please refresh the page.'] = 'Token di sicurezza invalido, aggiorna la pagina.';
|
||||
$a->strings['The rule name and expression are required.'] = 'Il nome e l\'espressione della regola sono richiesti.';
|
||||
|
|
|
@ -21,31 +21,12 @@
|
|||
|
||||
use Friendica\DI;
|
||||
|
||||
$container = $slim->getContainer();
|
||||
/** @var $slim \Slim\App */
|
||||
|
||||
// Error handler based off https://stackoverflow.com/a/48135009/757392
|
||||
$container['errorHandler'] = function () {
|
||||
return function(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, Exception $exception)
|
||||
{
|
||||
$responseCode = 500;
|
||||
/**
|
||||
* The routing middleware should be added before the ErrorMiddleware
|
||||
* Otherwise exceptions thrown from it will not be handled
|
||||
*/
|
||||
$slim->addRoutingMiddleware();
|
||||
|
||||
if (is_a($exception, 'Friendica\Network\HTTPException')) {
|
||||
$responseCode = $exception->getCode();
|
||||
}
|
||||
|
||||
$errors['message'] = $exception->getMessage();
|
||||
|
||||
$errors['responseCode'] = $responseCode;
|
||||
|
||||
return $response
|
||||
->withStatus($responseCode)
|
||||
->withJson($errors);
|
||||
};
|
||||
};
|
||||
|
||||
$container['notFoundHandler'] = function () {
|
||||
return function ()
|
||||
{
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Method not found'));
|
||||
};
|
||||
};
|
||||
$errorMiddleware = $slim->addErrorMiddleware(true, true, true, DI::logger());
|
||||
|
|
|
@ -20,20 +20,17 @@
|
|||
*/
|
||||
|
||||
/* @var $slim Slim\App */
|
||||
$slim->group('/advancedcontentfilter/api', function () {
|
||||
/* @var $this Slim\App */
|
||||
$this->group('/rules', function () {
|
||||
/* @var $this Slim\App */
|
||||
$this->get('', 'advancedcontentfilter_get_rules');
|
||||
$this->post('', 'advancedcontentfilter_post_rules');
|
||||
$slim->group('/advancedcontentfilter/api', function (\Slim\Routing\RouteCollectorProxy $app) {
|
||||
$app->group('/rules', function (\Slim\Routing\RouteCollectorProxy $app) {
|
||||
$app->get('', 'advancedcontentfilter_get_rules');
|
||||
$app->post('', 'advancedcontentfilter_post_rules');
|
||||
|
||||
$this->get('/{id}', 'advancedcontentfilter_get_rules_id');
|
||||
$this->put('/{id}', 'advancedcontentfilter_put_rules_id');
|
||||
$this->delete('/{id}', 'advancedcontentfilter_delete_rules_id');
|
||||
$app->get('/{id}', 'advancedcontentfilter_get_rules_id');
|
||||
$app->put('/{id}', 'advancedcontentfilter_put_rules_id');
|
||||
$app->delete('/{id}', 'advancedcontentfilter_delete_rules_id');
|
||||
});
|
||||
|
||||
$this->group('/variables', function () {
|
||||
/* @var $this Slim\App */
|
||||
$this->get('/{guid}', 'advancedcontentfilter_get_variables_guid');
|
||||
$app->group('/variables', function (\Slim\Routing\RouteCollectorProxy $app) {
|
||||
$app->get('/{guid}', 'advancedcontentfilter_get_variables_guid');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div id="rules"></div>
|
||||
|
||||
<script>
|
||||
var existingRules = {{$rules nofilter}};
|
||||
var existingRules = {{$rules|json_encode nofilter}};
|
||||
|
||||
var messages = {
|
||||
{{foreach $messages as $key => $value}}
|
||||
|
|
18
advancedcontentfilter/vendor/autoload.php
vendored
18
advancedcontentfilter/vendor/autoload.php
vendored
|
@ -2,6 +2,24 @@
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitAdvancedContentFilterAddon::getLoader();
|
||||
|
|
|
@ -37,57 +37,126 @@ namespace Composer\Autoload;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
|
@ -102,22 +171,25 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -126,19 +198,19 @@ class ClassLoader
|
|||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -147,25 +219,28 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
|
@ -175,18 +250,18 @@ class ClassLoader
|
|||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -195,8 +270,10 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
|
@ -211,10 +288,12 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
|
@ -234,6 +313,8 @@ class ClassLoader
|
|||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
|
@ -256,6 +337,8 @@ class ClassLoader
|
|||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
|
@ -276,10 +359,12 @@ class ClassLoader
|
|||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -296,33 +381,55 @@ class ClassLoader
|
|||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -367,6 +474,21 @@ class ClassLoader
|
|||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
|
@ -377,7 +499,7 @@ class ClassLoader
|
|||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
|
@ -432,14 +554,26 @@ class ClassLoader
|
|||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
|
359
advancedcontentfilter/vendor/composer/InstalledVersions.php
vendored
Normal file
359
advancedcontentfilter/vendor/composer/InstalledVersions.php
vendored
Normal file
|
@ -0,0 +1,359 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'FastRoute\\BadRouteException' => $vendorDir . '/nikic/fast-route/src/BadRouteException.php',
|
||||
'FastRoute\\DataGenerator' => $vendorDir . '/nikic/fast-route/src/DataGenerator.php',
|
||||
'FastRoute\\DataGenerator\\CharCountBased' => $vendorDir . '/nikic/fast-route/src/DataGenerator/CharCountBased.php',
|
||||
|
@ -23,27 +25,8 @@ return array(
|
|||
'FastRoute\\RouteCollector' => $vendorDir . '/nikic/fast-route/src/RouteCollector.php',
|
||||
'FastRoute\\RouteParser' => $vendorDir . '/nikic/fast-route/src/RouteParser.php',
|
||||
'FastRoute\\RouteParser\\Std' => $vendorDir . '/nikic/fast-route/src/RouteParser/Std.php',
|
||||
'Interop\\Container\\ContainerInterface' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
|
||||
'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
||||
'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
||||
'Pimple\\Container' => $vendorDir . '/pimple/pimple/src/Pimple/Container.php',
|
||||
'Pimple\\Exception\\ExpectedInvokableException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
|
||||
'Pimple\\Exception\\FrozenServiceException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php',
|
||||
'Pimple\\Exception\\InvalidServiceIdentifierException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php',
|
||||
'Pimple\\Exception\\UnknownIdentifierException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php',
|
||||
'Pimple\\Psr11\\Container' => $vendorDir . '/pimple/pimple/src/Pimple/Psr11/Container.php',
|
||||
'Pimple\\Psr11\\ServiceLocator' => $vendorDir . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
|
||||
'Pimple\\ServiceIterator' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceIterator.php',
|
||||
'Pimple\\ServiceProviderInterface' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
|
||||
'Pimple\\Tests\\Fixtures\\Invokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
|
||||
'Pimple\\Tests\\Fixtures\\NonInvokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
|
||||
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
|
||||
'Pimple\\Tests\\Fixtures\\Service' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
|
||||
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
|
||||
'Pimple\\Tests\\PimpleTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
|
||||
'Pimple\\Tests\\Psr11\\ContainerTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
|
||||
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
|
||||
'Pimple\\Tests\\ServiceIteratorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
|
||||
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
|
||||
'Psr\\Cache\\CacheException' => $vendorDir . '/psr/cache/src/CacheException.php',
|
||||
'Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php',
|
||||
'Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php',
|
||||
|
@ -52,12 +35,20 @@ return array(
|
|||
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
|
||||
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
|
||||
'Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php',
|
||||
'Psr\\Http\\Message\\RequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/RequestFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php',
|
||||
'Psr\\Http\\Message\\ResponseFactoryInterface' => $vendorDir . '/psr/http-factory/src/ResponseFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php',
|
||||
'Psr\\Http\\Message\\ServerRequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/ServerRequestFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php',
|
||||
'Psr\\Http\\Message\\StreamFactoryInterface' => $vendorDir . '/psr/http-factory/src/StreamFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php',
|
||||
'Psr\\Http\\Message\\UploadedFileFactoryInterface' => $vendorDir . '/psr/http-factory/src/UploadedFileFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php',
|
||||
'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php',
|
||||
'Psr\\Http\\Server\\MiddlewareInterface' => $vendorDir . '/psr/http-server-middleware/src/MiddlewareInterface.php',
|
||||
'Psr\\Http\\Server\\RequestHandlerInterface' => $vendorDir . '/psr/http-server-handler/src/RequestHandlerInterface.php',
|
||||
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
|
||||
|
@ -66,83 +57,122 @@ return array(
|
|||
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\SimpleCache\\CacheException' => $vendorDir . '/psr/simple-cache/src/CacheException.php',
|
||||
'Psr\\SimpleCache\\CacheInterface' => $vendorDir . '/psr/simple-cache/src/CacheInterface.php',
|
||||
'Psr\\SimpleCache\\InvalidArgumentException' => $vendorDir . '/psr/simple-cache/src/InvalidArgumentException.php',
|
||||
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
||||
'Slim\\App' => $vendorDir . '/slim/slim/Slim/App.php',
|
||||
'Slim\\CallableResolver' => $vendorDir . '/slim/slim/Slim/CallableResolver.php',
|
||||
'Slim\\CallableResolverAwareTrait' => $vendorDir . '/slim/slim/Slim/CallableResolverAwareTrait.php',
|
||||
'Slim\\Collection' => $vendorDir . '/slim/slim/Slim/Collection.php',
|
||||
'Slim\\Container' => $vendorDir . '/slim/slim/Slim/Container.php',
|
||||
'Slim\\DefaultServicesProvider' => $vendorDir . '/slim/slim/Slim/DefaultServicesProvider.php',
|
||||
'Slim\\DeferredCallable' => $vendorDir . '/slim/slim/Slim/DeferredCallable.php',
|
||||
'Slim\\Exception\\ContainerException' => $vendorDir . '/slim/slim/Slim/Exception/ContainerException.php',
|
||||
'Slim\\Exception\\ContainerValueNotFoundException' => $vendorDir . '/slim/slim/Slim/Exception/ContainerValueNotFoundException.php',
|
||||
'Slim\\Exception\\InvalidMethodException' => $vendorDir . '/slim/slim/Slim/Exception/InvalidMethodException.php',
|
||||
'Slim\\Exception\\MethodNotAllowedException' => $vendorDir . '/slim/slim/Slim/Exception/MethodNotAllowedException.php',
|
||||
'Slim\\Exception\\NotFoundException' => $vendorDir . '/slim/slim/Slim/Exception/NotFoundException.php',
|
||||
'Slim\\Exception\\SlimException' => $vendorDir . '/slim/slim/Slim/Exception/SlimException.php',
|
||||
'Slim\\Handlers\\AbstractError' => $vendorDir . '/slim/slim/Slim/Handlers/AbstractError.php',
|
||||
'Slim\\Handlers\\AbstractHandler' => $vendorDir . '/slim/slim/Slim/Handlers/AbstractHandler.php',
|
||||
'Slim\\Handlers\\Error' => $vendorDir . '/slim/slim/Slim/Handlers/Error.php',
|
||||
'Slim\\Handlers\\NotAllowed' => $vendorDir . '/slim/slim/Slim/Handlers/NotAllowed.php',
|
||||
'Slim\\Handlers\\NotFound' => $vendorDir . '/slim/slim/Slim/Handlers/NotFound.php',
|
||||
'Slim\\Handlers\\PhpError' => $vendorDir . '/slim/slim/Slim/Handlers/PhpError.php',
|
||||
'Slim\\Error\\AbstractErrorRenderer' => $vendorDir . '/slim/slim/Slim/Error/AbstractErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\HtmlErrorRenderer' => $vendorDir . '/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\JsonErrorRenderer' => $vendorDir . '/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\PlainTextErrorRenderer' => $vendorDir . '/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\XmlErrorRenderer' => $vendorDir . '/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php',
|
||||
'Slim\\Exception\\HttpBadRequestException' => $vendorDir . '/slim/slim/Slim/Exception/HttpBadRequestException.php',
|
||||
'Slim\\Exception\\HttpException' => $vendorDir . '/slim/slim/Slim/Exception/HttpException.php',
|
||||
'Slim\\Exception\\HttpForbiddenException' => $vendorDir . '/slim/slim/Slim/Exception/HttpForbiddenException.php',
|
||||
'Slim\\Exception\\HttpGoneException' => $vendorDir . '/slim/slim/Slim/Exception/HttpGoneException.php',
|
||||
'Slim\\Exception\\HttpInternalServerErrorException' => $vendorDir . '/slim/slim/Slim/Exception/HttpInternalServerErrorException.php',
|
||||
'Slim\\Exception\\HttpMethodNotAllowedException' => $vendorDir . '/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php',
|
||||
'Slim\\Exception\\HttpNotFoundException' => $vendorDir . '/slim/slim/Slim/Exception/HttpNotFoundException.php',
|
||||
'Slim\\Exception\\HttpNotImplementedException' => $vendorDir . '/slim/slim/Slim/Exception/HttpNotImplementedException.php',
|
||||
'Slim\\Exception\\HttpSpecializedException' => $vendorDir . '/slim/slim/Slim/Exception/HttpSpecializedException.php',
|
||||
'Slim\\Exception\\HttpTooManyRequestsException' => $vendorDir . '/slim/slim/Slim/Exception/HttpTooManyRequestsException.php',
|
||||
'Slim\\Exception\\HttpUnauthorizedException' => $vendorDir . '/slim/slim/Slim/Exception/HttpUnauthorizedException.php',
|
||||
'Slim\\Factory\\AppFactory' => $vendorDir . '/slim/slim/Slim/Factory/AppFactory.php',
|
||||
'Slim\\Factory\\Psr17\\GuzzlePsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\HttpSoftPsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/HttpSoftPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\LaminasDiactorosPsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\NyholmPsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\Psr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/Psr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\Psr17FactoryProvider' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php',
|
||||
'Slim\\Factory\\Psr17\\ServerRequestCreator' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php',
|
||||
'Slim\\Factory\\Psr17\\SlimHttpPsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\SlimHttpServerRequestCreator' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php',
|
||||
'Slim\\Factory\\Psr17\\SlimPsr17Factory' => $vendorDir . '/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php',
|
||||
'Slim\\Factory\\ServerRequestCreatorFactory' => $vendorDir . '/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php',
|
||||
'Slim\\Handlers\\ErrorHandler' => $vendorDir . '/slim/slim/Slim/Handlers/ErrorHandler.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestHandler' => $vendorDir . '/slim/slim/Slim/Handlers/Strategies/RequestHandler.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponse' => $vendorDir . '/slim/slim/Slim/Handlers/Strategies/RequestResponse.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponseArgs' => $vendorDir . '/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php',
|
||||
'Slim\\Http\\Body' => $vendorDir . '/slim/slim/Slim/Http/Body.php',
|
||||
'Slim\\Http\\Cookies' => $vendorDir . '/slim/slim/Slim/Http/Cookies.php',
|
||||
'Slim\\Http\\Environment' => $vendorDir . '/slim/slim/Slim/Http/Environment.php',
|
||||
'Slim\\Http\\Headers' => $vendorDir . '/slim/slim/Slim/Http/Headers.php',
|
||||
'Slim\\Http\\Message' => $vendorDir . '/slim/slim/Slim/Http/Message.php',
|
||||
'Slim\\Http\\Request' => $vendorDir . '/slim/slim/Slim/Http/Request.php',
|
||||
'Slim\\Http\\RequestBody' => $vendorDir . '/slim/slim/Slim/Http/RequestBody.php',
|
||||
'Slim\\Http\\Response' => $vendorDir . '/slim/slim/Slim/Http/Response.php',
|
||||
'Slim\\Http\\Stream' => $vendorDir . '/slim/slim/Slim/Http/Stream.php',
|
||||
'Slim\\Http\\UploadedFile' => $vendorDir . '/slim/slim/Slim/Http/UploadedFile.php',
|
||||
'Slim\\Http\\Uri' => $vendorDir . '/slim/slim/Slim/Http/Uri.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponseNamedArgs' => $vendorDir . '/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php',
|
||||
'Slim\\Interfaces\\AdvancedCallableResolverInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php',
|
||||
'Slim\\Interfaces\\CallableResolverInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/CallableResolverInterface.php',
|
||||
'Slim\\Interfaces\\CollectionInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/CollectionInterface.php',
|
||||
'Slim\\Interfaces\\Http\\CookiesInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/Http/CookiesInterface.php',
|
||||
'Slim\\Interfaces\\Http\\EnvironmentInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/Http/EnvironmentInterface.php',
|
||||
'Slim\\Interfaces\\Http\\HeadersInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/Http/HeadersInterface.php',
|
||||
'Slim\\Interfaces\\DispatcherInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/DispatcherInterface.php',
|
||||
'Slim\\Interfaces\\ErrorHandlerInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php',
|
||||
'Slim\\Interfaces\\ErrorRendererInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/ErrorRendererInterface.php',
|
||||
'Slim\\Interfaces\\InvocationStrategyInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php',
|
||||
'Slim\\Interfaces\\MiddlewareDispatcherInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php',
|
||||
'Slim\\Interfaces\\Psr17FactoryInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php',
|
||||
'Slim\\Interfaces\\Psr17FactoryProviderInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php',
|
||||
'Slim\\Interfaces\\RequestHandlerInvocationStrategyInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RequestHandlerInvocationStrategyInterface.php',
|
||||
'Slim\\Interfaces\\RouteCollectorInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteCollectorInterface.php',
|
||||
'Slim\\Interfaces\\RouteCollectorProxyInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php',
|
||||
'Slim\\Interfaces\\RouteGroupInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteGroupInterface.php',
|
||||
'Slim\\Interfaces\\RouteInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteInterface.php',
|
||||
'Slim\\Interfaces\\RouterInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouterInterface.php',
|
||||
'Slim\\MiddlewareAwareTrait' => $vendorDir . '/slim/slim/Slim/MiddlewareAwareTrait.php',
|
||||
'Slim\\Routable' => $vendorDir . '/slim/slim/Slim/Routable.php',
|
||||
'Slim\\Route' => $vendorDir . '/slim/slim/Slim/Route.php',
|
||||
'Slim\\RouteGroup' => $vendorDir . '/slim/slim/Slim/RouteGroup.php',
|
||||
'Slim\\Router' => $vendorDir . '/slim/slim/Slim/Router.php',
|
||||
'Slim\\Interfaces\\RouteParserInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteParserInterface.php',
|
||||
'Slim\\Interfaces\\RouteResolverInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/RouteResolverInterface.php',
|
||||
'Slim\\Interfaces\\ServerRequestCreatorInterface' => $vendorDir . '/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php',
|
||||
'Slim\\Logger' => $vendorDir . '/slim/slim/Slim/Logger.php',
|
||||
'Slim\\MiddlewareDispatcher' => $vendorDir . '/slim/slim/Slim/MiddlewareDispatcher.php',
|
||||
'Slim\\Middleware\\BodyParsingMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/BodyParsingMiddleware.php',
|
||||
'Slim\\Middleware\\ContentLengthMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/ContentLengthMiddleware.php',
|
||||
'Slim\\Middleware\\ErrorMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/ErrorMiddleware.php',
|
||||
'Slim\\Middleware\\MethodOverrideMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php',
|
||||
'Slim\\Middleware\\OutputBufferingMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php',
|
||||
'Slim\\Middleware\\RoutingMiddleware' => $vendorDir . '/slim/slim/Slim/Middleware/RoutingMiddleware.php',
|
||||
'Slim\\ResponseEmitter' => $vendorDir . '/slim/slim/Slim/ResponseEmitter.php',
|
||||
'Slim\\Routing\\Dispatcher' => $vendorDir . '/slim/slim/Slim/Routing/Dispatcher.php',
|
||||
'Slim\\Routing\\FastRouteDispatcher' => $vendorDir . '/slim/slim/Slim/Routing/FastRouteDispatcher.php',
|
||||
'Slim\\Routing\\Route' => $vendorDir . '/slim/slim/Slim/Routing/Route.php',
|
||||
'Slim\\Routing\\RouteCollector' => $vendorDir . '/slim/slim/Slim/Routing/RouteCollector.php',
|
||||
'Slim\\Routing\\RouteCollectorProxy' => $vendorDir . '/slim/slim/Slim/Routing/RouteCollectorProxy.php',
|
||||
'Slim\\Routing\\RouteContext' => $vendorDir . '/slim/slim/Slim/Routing/RouteContext.php',
|
||||
'Slim\\Routing\\RouteGroup' => $vendorDir . '/slim/slim/Slim/Routing/RouteGroup.php',
|
||||
'Slim\\Routing\\RouteParser' => $vendorDir . '/slim/slim/Slim/Routing/RouteParser.php',
|
||||
'Slim\\Routing\\RouteResolver' => $vendorDir . '/slim/slim/Slim/Routing/RouteResolver.php',
|
||||
'Slim\\Routing\\RouteRunner' => $vendorDir . '/slim/slim/Slim/Routing/RouteRunner.php',
|
||||
'Slim\\Routing\\RoutingResults' => $vendorDir . '/slim/slim/Slim/Routing/RoutingResults.php',
|
||||
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AbstractAdapter' => $vendorDir . '/symfony/cache/Adapter/AbstractAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AbstractTagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/AbstractTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AdapterInterface' => $vendorDir . '/symfony/cache/Adapter/AdapterInterface.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ApcuAdapter' => $vendorDir . '/symfony/cache/Adapter/ApcuAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ArrayAdapter' => $vendorDir . '/symfony/cache/Adapter/ArrayAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ChainAdapter' => $vendorDir . '/symfony/cache/Adapter/ChainAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\DoctrineAdapter' => $vendorDir . '/symfony/cache/Adapter/DoctrineAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter' => $vendorDir . '/symfony/cache/Adapter/FilesystemAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\FilesystemTagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/FilesystemTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\MemcachedAdapter' => $vendorDir . '/symfony/cache/Adapter/MemcachedAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\NullAdapter' => $vendorDir . '/symfony/cache/Adapter/NullAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PdoAdapter' => $vendorDir . '/symfony/cache/Adapter/PdoAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter' => $vendorDir . '/symfony/cache/Adapter/PhpArrayAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter' => $vendorDir . '/symfony/cache/Adapter/PhpFilesAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ProxyAdapter' => $vendorDir . '/symfony/cache/Adapter/ProxyAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\Psr16Adapter' => $vendorDir . '/symfony/cache/Adapter/Psr16Adapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\RedisAdapter' => $vendorDir . '/symfony/cache/Adapter/RedisAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\RedisTagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/RedisTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\SimpleCacheAdapter' => $vendorDir . '/symfony/cache/Adapter/SimpleCacheAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/TagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TagAwareAdapterInterface' => $vendorDir . '/symfony/cache/Adapter/TagAwareAdapterInterface.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableAdapter' => $vendorDir . '/symfony/cache/Adapter/TraceableAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableAdapterEvent' => $vendorDir . '/symfony/cache/Adapter/TraceableAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableTagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/TraceableTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\CacheItem' => $vendorDir . '/symfony/cache/CacheItem.php',
|
||||
'Symfony\\Component\\Cache\\DataCollector\\CacheDataCollector' => $vendorDir . '/symfony/cache/DataCollector/CacheDataCollector.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CacheCollectorPass' => $vendorDir . '/symfony/cache/DependencyInjection/CacheCollectorPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolClearerPass' => $vendorDir . '/symfony/cache/DependencyInjection/CachePoolClearerPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolPass' => $vendorDir . '/symfony/cache/DependencyInjection/CachePoolPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolPrunerPass' => $vendorDir . '/symfony/cache/DependencyInjection/CachePoolPrunerPass.php',
|
||||
'Symfony\\Component\\Cache\\DoctrineProvider' => $vendorDir . '/symfony/cache/DoctrineProvider.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\CacheException' => $vendorDir . '/symfony/cache/Exception/CacheException.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/cache/Exception/InvalidArgumentException.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\LogicException' => $vendorDir . '/symfony/cache/Exception/LogicException.php',
|
||||
'Symfony\\Component\\Cache\\LockRegistry' => $vendorDir . '/symfony/cache/LockRegistry.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\DefaultMarshaller' => $vendorDir . '/symfony/cache/Marshaller/DefaultMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\DeflateMarshaller' => $vendorDir . '/symfony/cache/Marshaller/DeflateMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\MarshallerInterface' => $vendorDir . '/symfony/cache/Marshaller/MarshallerInterface.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\TagAwareMarshaller' => $vendorDir . '/symfony/cache/Marshaller/TagAwareMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\PruneableInterface' => $vendorDir . '/symfony/cache/PruneableInterface.php',
|
||||
'Symfony\\Component\\Cache\\Psr16Cache' => $vendorDir . '/symfony/cache/Psr16Cache.php',
|
||||
'Symfony\\Component\\Cache\\ResettableInterface' => $vendorDir . '/symfony/cache/ResettableInterface.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\AbstractCache' => $vendorDir . '/symfony/cache/Simple/AbstractCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\ApcuCache' => $vendorDir . '/symfony/cache/Simple/ApcuCache.php',
|
||||
|
@ -158,10 +188,11 @@ return array(
|
|||
'Symfony\\Component\\Cache\\Simple\\Psr6Cache' => $vendorDir . '/symfony/cache/Simple/Psr6Cache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\RedisCache' => $vendorDir . '/symfony/cache/Simple/RedisCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\TraceableCache' => $vendorDir . '/symfony/cache/Simple/TraceableCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\TraceableCacheEvent' => $vendorDir . '/symfony/cache/Simple/TraceableCache.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\AbstractAdapterTrait' => $vendorDir . '/symfony/cache/Traits/AbstractAdapterTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\AbstractTrait' => $vendorDir . '/symfony/cache/Traits/AbstractTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ApcuTrait' => $vendorDir . '/symfony/cache/Traits/ApcuTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ArrayTrait' => $vendorDir . '/symfony/cache/Traits/ArrayTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ContractsTrait' => $vendorDir . '/symfony/cache/Traits/ContractsTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\DoctrineTrait' => $vendorDir . '/symfony/cache/Traits/DoctrineTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\FilesystemCommonTrait' => $vendorDir . '/symfony/cache/Traits/FilesystemCommonTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\FilesystemTrait' => $vendorDir . '/symfony/cache/Traits/FilesystemTrait.php',
|
||||
|
@ -170,6 +201,8 @@ return array(
|
|||
'Symfony\\Component\\Cache\\Traits\\PhpArrayTrait' => $vendorDir . '/symfony/cache/Traits/PhpArrayTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\PhpFilesTrait' => $vendorDir . '/symfony/cache/Traits/PhpFilesTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ProxyTrait' => $vendorDir . '/symfony/cache/Traits/ProxyTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisClusterNodeProxy' => $vendorDir . '/symfony/cache/Traits/RedisClusterNodeProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisClusterProxy' => $vendorDir . '/symfony/cache/Traits/RedisClusterProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisProxy' => $vendorDir . '/symfony/cache/Traits/RedisProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisTrait' => $vendorDir . '/symfony/cache/Traits/RedisTrait.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\Compiler' => $vendorDir . '/symfony/expression-language/Compiler.php',
|
||||
|
@ -197,5 +230,32 @@ return array(
|
|||
'Symfony\\Component\\ExpressionLanguage\\SyntaxError' => $vendorDir . '/symfony/expression-language/SyntaxError.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\Token' => $vendorDir . '/symfony/expression-language/Token.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\TokenStream' => $vendorDir . '/symfony/expression-language/TokenStream.php',
|
||||
'Symfony\\Polyfill\\Apcu\\Apcu' => $vendorDir . '/symfony/polyfill-apcu/Apcu.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\ClassNotFoundException' => $vendorDir . '/symfony/var-exporter/Exception/ClassNotFoundException.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/var-exporter/Exception/ExceptionInterface.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\NotInstantiableTypeException' => $vendorDir . '/symfony/var-exporter/Exception/NotInstantiableTypeException.php',
|
||||
'Symfony\\Component\\VarExporter\\Instantiator' => $vendorDir . '/symfony/var-exporter/Instantiator.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Exporter' => $vendorDir . '/symfony/var-exporter/Internal/Exporter.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Hydrator' => $vendorDir . '/symfony/var-exporter/Internal/Hydrator.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Reference' => $vendorDir . '/symfony/var-exporter/Internal/Reference.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Registry' => $vendorDir . '/symfony/var-exporter/Internal/Registry.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Values' => $vendorDir . '/symfony/var-exporter/Internal/Values.php',
|
||||
'Symfony\\Component\\VarExporter\\VarExporter' => $vendorDir . '/symfony/var-exporter/VarExporter.php',
|
||||
'Symfony\\Contracts\\Cache\\CacheInterface' => $vendorDir . '/symfony/cache-contracts/CacheInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\CacheTrait' => $vendorDir . '/symfony/cache-contracts/CacheTrait.php',
|
||||
'Symfony\\Contracts\\Cache\\CallbackInterface' => $vendorDir . '/symfony/cache-contracts/CallbackInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\ItemInterface' => $vendorDir . '/symfony/cache-contracts/ItemInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\TagAwareCacheInterface' => $vendorDir . '/symfony/cache-contracts/TagAwareCacheInterface.php',
|
||||
'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php',
|
||||
'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php',
|
||||
'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php',
|
||||
'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => $vendorDir . '/symfony/service-contracts/Test/ServiceLocatorTest.php',
|
||||
'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php',
|
||||
'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php',
|
||||
'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php',
|
||||
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
|
||||
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'32dcc8afd4335739640db7d200c1971d' => $vendorDir . '/symfony/polyfill-apcu/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php',
|
||||
);
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Pimple' => array($vendorDir . '/pimple/pimple/src'),
|
||||
);
|
||||
|
|
|
@ -2,19 +2,22 @@
|
|||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Symfony\\Polyfill\\Apcu\\' => array($vendorDir . '/symfony/polyfill-apcu'),
|
||||
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
|
||||
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
|
||||
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
|
||||
'Symfony\\Contracts\\Cache\\' => array($vendorDir . '/symfony/cache-contracts'),
|
||||
'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'),
|
||||
'Symfony\\Component\\ExpressionLanguage\\' => array($vendorDir . '/symfony/expression-language'),
|
||||
'Symfony\\Component\\Cache\\' => array($vendorDir . '/symfony/cache'),
|
||||
'Slim\\' => array($vendorDir . '/slim/slim/Slim'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
|
||||
'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
|
||||
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
|
||||
'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'),
|
||||
);
|
||||
|
|
|
@ -13,58 +13,38 @@ class ComposerAutoloaderInitAdvancedContentFilterAddon
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitAdvancedContentFilterAddon', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitAdvancedContentFilterAddon', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitAdvancedContentFilterAddon::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitAdvancedContentFilterAddon::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitAdvancedContentFilterAddon::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireAdvancedContentFilterAddon($fileIdentifier, $file);
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitAdvancedContentFilterAddon::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequireAdvancedContentFilterAddon($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,30 +7,32 @@ namespace Composer\Autoload;
|
|||
class ComposerStaticInitAdvancedContentFilterAddon
|
||||
{
|
||||
public static $files = array (
|
||||
'32dcc8afd4335739640db7d200c1971d' => __DIR__ . '/..' . '/symfony/polyfill-apcu/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Apcu\\' => 22,
|
||||
'Symfony\\Polyfill\\Php80\\' => 23,
|
||||
'Symfony\\Polyfill\\Php73\\' => 23,
|
||||
'Symfony\\Contracts\\Service\\' => 26,
|
||||
'Symfony\\Contracts\\Cache\\' => 24,
|
||||
'Symfony\\Component\\VarExporter\\' => 30,
|
||||
'Symfony\\Component\\ExpressionLanguage\\' => 37,
|
||||
'Symfony\\Component\\Cache\\' => 24,
|
||||
'Slim\\' => 5,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Http\\Server\\' => 16,
|
||||
'Psr\\Http\\Message\\' => 17,
|
||||
'Psr\\Container\\' => 14,
|
||||
'Psr\\Cache\\' => 10,
|
||||
),
|
||||
'I' =>
|
||||
array (
|
||||
'Interop\\Container\\' => 18,
|
||||
),
|
||||
'F' =>
|
||||
array (
|
||||
'FastRoute\\' => 10,
|
||||
|
@ -38,9 +40,25 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Symfony\\Polyfill\\Apcu\\' =>
|
||||
'Symfony\\Polyfill\\Php80\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-apcu',
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php73\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
|
||||
),
|
||||
'Symfony\\Contracts\\Service\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/service-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/cache-contracts',
|
||||
),
|
||||
'Symfony\\Component\\VarExporter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-exporter',
|
||||
),
|
||||
'Symfony\\Component\\ExpressionLanguage\\' =>
|
||||
array (
|
||||
|
@ -54,17 +72,19 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/slim/slim/Slim',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Http\\Server\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-server-handler/src',
|
||||
1 => __DIR__ . '/..' . '/psr/http-server-middleware/src',
|
||||
),
|
||||
'Psr\\Http\\Message\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-message/src',
|
||||
1 => __DIR__ . '/..' . '/psr/http-factory/src',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
|
@ -74,27 +94,15 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/cache/src',
|
||||
),
|
||||
'Interop\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
|
||||
),
|
||||
'FastRoute\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/nikic/fast-route/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'P' =>
|
||||
array (
|
||||
'Pimple' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/pimple/pimple/src',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'FastRoute\\BadRouteException' => __DIR__ . '/..' . '/nikic/fast-route/src/BadRouteException.php',
|
||||
'FastRoute\\DataGenerator' => __DIR__ . '/..' . '/nikic/fast-route/src/DataGenerator.php',
|
||||
'FastRoute\\DataGenerator\\CharCountBased' => __DIR__ . '/..' . '/nikic/fast-route/src/DataGenerator/CharCountBased.php',
|
||||
|
@ -112,27 +120,8 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'FastRoute\\RouteCollector' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteCollector.php',
|
||||
'FastRoute\\RouteParser' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteParser.php',
|
||||
'FastRoute\\RouteParser\\Std' => __DIR__ . '/..' . '/nikic/fast-route/src/RouteParser/Std.php',
|
||||
'Interop\\Container\\ContainerInterface' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
|
||||
'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
||||
'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
||||
'Pimple\\Container' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Container.php',
|
||||
'Pimple\\Exception\\ExpectedInvokableException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
|
||||
'Pimple\\Exception\\FrozenServiceException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php',
|
||||
'Pimple\\Exception\\InvalidServiceIdentifierException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php',
|
||||
'Pimple\\Exception\\UnknownIdentifierException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php',
|
||||
'Pimple\\Psr11\\Container' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Psr11/Container.php',
|
||||
'Pimple\\Psr11\\ServiceLocator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
|
||||
'Pimple\\ServiceIterator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceIterator.php',
|
||||
'Pimple\\ServiceProviderInterface' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
|
||||
'Pimple\\Tests\\Fixtures\\Invokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
|
||||
'Pimple\\Tests\\Fixtures\\NonInvokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
|
||||
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
|
||||
'Pimple\\Tests\\Fixtures\\Service' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
|
||||
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
|
||||
'Pimple\\Tests\\PimpleTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
|
||||
'Pimple\\Tests\\Psr11\\ContainerTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
|
||||
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
|
||||
'Pimple\\Tests\\ServiceIteratorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
|
||||
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
|
||||
'Psr\\Cache\\CacheException' => __DIR__ . '/..' . '/psr/cache/src/CacheException.php',
|
||||
'Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php',
|
||||
'Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php',
|
||||
|
@ -141,12 +130,20 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
|
||||
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
|
||||
'Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php',
|
||||
'Psr\\Http\\Message\\RequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/RequestFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php',
|
||||
'Psr\\Http\\Message\\ResponseFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ResponseFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php',
|
||||
'Psr\\Http\\Message\\ServerRequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ServerRequestFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php',
|
||||
'Psr\\Http\\Message\\StreamFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/StreamFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php',
|
||||
'Psr\\Http\\Message\\UploadedFileFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UploadedFileFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php',
|
||||
'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php',
|
||||
'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php',
|
||||
'Psr\\Http\\Server\\MiddlewareInterface' => __DIR__ . '/..' . '/psr/http-server-middleware/src/MiddlewareInterface.php',
|
||||
'Psr\\Http\\Server\\RequestHandlerInterface' => __DIR__ . '/..' . '/psr/http-server-handler/src/RequestHandlerInterface.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
|
||||
|
@ -155,83 +152,122 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php',
|
||||
'Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php',
|
||||
'Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php',
|
||||
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
||||
'Slim\\App' => __DIR__ . '/..' . '/slim/slim/Slim/App.php',
|
||||
'Slim\\CallableResolver' => __DIR__ . '/..' . '/slim/slim/Slim/CallableResolver.php',
|
||||
'Slim\\CallableResolverAwareTrait' => __DIR__ . '/..' . '/slim/slim/Slim/CallableResolverAwareTrait.php',
|
||||
'Slim\\Collection' => __DIR__ . '/..' . '/slim/slim/Slim/Collection.php',
|
||||
'Slim\\Container' => __DIR__ . '/..' . '/slim/slim/Slim/Container.php',
|
||||
'Slim\\DefaultServicesProvider' => __DIR__ . '/..' . '/slim/slim/Slim/DefaultServicesProvider.php',
|
||||
'Slim\\DeferredCallable' => __DIR__ . '/..' . '/slim/slim/Slim/DeferredCallable.php',
|
||||
'Slim\\Exception\\ContainerException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/ContainerException.php',
|
||||
'Slim\\Exception\\ContainerValueNotFoundException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/ContainerValueNotFoundException.php',
|
||||
'Slim\\Exception\\InvalidMethodException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/InvalidMethodException.php',
|
||||
'Slim\\Exception\\MethodNotAllowedException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/MethodNotAllowedException.php',
|
||||
'Slim\\Exception\\NotFoundException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/NotFoundException.php',
|
||||
'Slim\\Exception\\SlimException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/SlimException.php',
|
||||
'Slim\\Handlers\\AbstractError' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/AbstractError.php',
|
||||
'Slim\\Handlers\\AbstractHandler' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/AbstractHandler.php',
|
||||
'Slim\\Handlers\\Error' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/Error.php',
|
||||
'Slim\\Handlers\\NotAllowed' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/NotAllowed.php',
|
||||
'Slim\\Handlers\\NotFound' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/NotFound.php',
|
||||
'Slim\\Handlers\\PhpError' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/PhpError.php',
|
||||
'Slim\\Error\\AbstractErrorRenderer' => __DIR__ . '/..' . '/slim/slim/Slim/Error/AbstractErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\HtmlErrorRenderer' => __DIR__ . '/..' . '/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\JsonErrorRenderer' => __DIR__ . '/..' . '/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\PlainTextErrorRenderer' => __DIR__ . '/..' . '/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php',
|
||||
'Slim\\Error\\Renderers\\XmlErrorRenderer' => __DIR__ . '/..' . '/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php',
|
||||
'Slim\\Exception\\HttpBadRequestException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpBadRequestException.php',
|
||||
'Slim\\Exception\\HttpException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpException.php',
|
||||
'Slim\\Exception\\HttpForbiddenException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpForbiddenException.php',
|
||||
'Slim\\Exception\\HttpGoneException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpGoneException.php',
|
||||
'Slim\\Exception\\HttpInternalServerErrorException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpInternalServerErrorException.php',
|
||||
'Slim\\Exception\\HttpMethodNotAllowedException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php',
|
||||
'Slim\\Exception\\HttpNotFoundException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpNotFoundException.php',
|
||||
'Slim\\Exception\\HttpNotImplementedException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpNotImplementedException.php',
|
||||
'Slim\\Exception\\HttpSpecializedException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpSpecializedException.php',
|
||||
'Slim\\Exception\\HttpTooManyRequestsException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpTooManyRequestsException.php',
|
||||
'Slim\\Exception\\HttpUnauthorizedException' => __DIR__ . '/..' . '/slim/slim/Slim/Exception/HttpUnauthorizedException.php',
|
||||
'Slim\\Factory\\AppFactory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/AppFactory.php',
|
||||
'Slim\\Factory\\Psr17\\GuzzlePsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\HttpSoftPsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/HttpSoftPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\LaminasDiactorosPsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\NyholmPsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\Psr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/Psr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\Psr17FactoryProvider' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php',
|
||||
'Slim\\Factory\\Psr17\\ServerRequestCreator' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php',
|
||||
'Slim\\Factory\\Psr17\\SlimHttpPsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php',
|
||||
'Slim\\Factory\\Psr17\\SlimHttpServerRequestCreator' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php',
|
||||
'Slim\\Factory\\Psr17\\SlimPsr17Factory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php',
|
||||
'Slim\\Factory\\ServerRequestCreatorFactory' => __DIR__ . '/..' . '/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php',
|
||||
'Slim\\Handlers\\ErrorHandler' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/ErrorHandler.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestHandler' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/Strategies/RequestHandler.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponse' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/Strategies/RequestResponse.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponseArgs' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php',
|
||||
'Slim\\Http\\Body' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Body.php',
|
||||
'Slim\\Http\\Cookies' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Cookies.php',
|
||||
'Slim\\Http\\Environment' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Environment.php',
|
||||
'Slim\\Http\\Headers' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Headers.php',
|
||||
'Slim\\Http\\Message' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Message.php',
|
||||
'Slim\\Http\\Request' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Request.php',
|
||||
'Slim\\Http\\RequestBody' => __DIR__ . '/..' . '/slim/slim/Slim/Http/RequestBody.php',
|
||||
'Slim\\Http\\Response' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Response.php',
|
||||
'Slim\\Http\\Stream' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Stream.php',
|
||||
'Slim\\Http\\UploadedFile' => __DIR__ . '/..' . '/slim/slim/Slim/Http/UploadedFile.php',
|
||||
'Slim\\Http\\Uri' => __DIR__ . '/..' . '/slim/slim/Slim/Http/Uri.php',
|
||||
'Slim\\Handlers\\Strategies\\RequestResponseNamedArgs' => __DIR__ . '/..' . '/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php',
|
||||
'Slim\\Interfaces\\AdvancedCallableResolverInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php',
|
||||
'Slim\\Interfaces\\CallableResolverInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/CallableResolverInterface.php',
|
||||
'Slim\\Interfaces\\CollectionInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/CollectionInterface.php',
|
||||
'Slim\\Interfaces\\Http\\CookiesInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/Http/CookiesInterface.php',
|
||||
'Slim\\Interfaces\\Http\\EnvironmentInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/Http/EnvironmentInterface.php',
|
||||
'Slim\\Interfaces\\Http\\HeadersInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/Http/HeadersInterface.php',
|
||||
'Slim\\Interfaces\\DispatcherInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/DispatcherInterface.php',
|
||||
'Slim\\Interfaces\\ErrorHandlerInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php',
|
||||
'Slim\\Interfaces\\ErrorRendererInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/ErrorRendererInterface.php',
|
||||
'Slim\\Interfaces\\InvocationStrategyInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php',
|
||||
'Slim\\Interfaces\\MiddlewareDispatcherInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php',
|
||||
'Slim\\Interfaces\\Psr17FactoryInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php',
|
||||
'Slim\\Interfaces\\Psr17FactoryProviderInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php',
|
||||
'Slim\\Interfaces\\RequestHandlerInvocationStrategyInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RequestHandlerInvocationStrategyInterface.php',
|
||||
'Slim\\Interfaces\\RouteCollectorInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteCollectorInterface.php',
|
||||
'Slim\\Interfaces\\RouteCollectorProxyInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php',
|
||||
'Slim\\Interfaces\\RouteGroupInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteGroupInterface.php',
|
||||
'Slim\\Interfaces\\RouteInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteInterface.php',
|
||||
'Slim\\Interfaces\\RouterInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouterInterface.php',
|
||||
'Slim\\MiddlewareAwareTrait' => __DIR__ . '/..' . '/slim/slim/Slim/MiddlewareAwareTrait.php',
|
||||
'Slim\\Routable' => __DIR__ . '/..' . '/slim/slim/Slim/Routable.php',
|
||||
'Slim\\Route' => __DIR__ . '/..' . '/slim/slim/Slim/Route.php',
|
||||
'Slim\\RouteGroup' => __DIR__ . '/..' . '/slim/slim/Slim/RouteGroup.php',
|
||||
'Slim\\Router' => __DIR__ . '/..' . '/slim/slim/Slim/Router.php',
|
||||
'Slim\\Interfaces\\RouteParserInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteParserInterface.php',
|
||||
'Slim\\Interfaces\\RouteResolverInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/RouteResolverInterface.php',
|
||||
'Slim\\Interfaces\\ServerRequestCreatorInterface' => __DIR__ . '/..' . '/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php',
|
||||
'Slim\\Logger' => __DIR__ . '/..' . '/slim/slim/Slim/Logger.php',
|
||||
'Slim\\MiddlewareDispatcher' => __DIR__ . '/..' . '/slim/slim/Slim/MiddlewareDispatcher.php',
|
||||
'Slim\\Middleware\\BodyParsingMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/BodyParsingMiddleware.php',
|
||||
'Slim\\Middleware\\ContentLengthMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/ContentLengthMiddleware.php',
|
||||
'Slim\\Middleware\\ErrorMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/ErrorMiddleware.php',
|
||||
'Slim\\Middleware\\MethodOverrideMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php',
|
||||
'Slim\\Middleware\\OutputBufferingMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php',
|
||||
'Slim\\Middleware\\RoutingMiddleware' => __DIR__ . '/..' . '/slim/slim/Slim/Middleware/RoutingMiddleware.php',
|
||||
'Slim\\ResponseEmitter' => __DIR__ . '/..' . '/slim/slim/Slim/ResponseEmitter.php',
|
||||
'Slim\\Routing\\Dispatcher' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/Dispatcher.php',
|
||||
'Slim\\Routing\\FastRouteDispatcher' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/FastRouteDispatcher.php',
|
||||
'Slim\\Routing\\Route' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/Route.php',
|
||||
'Slim\\Routing\\RouteCollector' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteCollector.php',
|
||||
'Slim\\Routing\\RouteCollectorProxy' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteCollectorProxy.php',
|
||||
'Slim\\Routing\\RouteContext' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteContext.php',
|
||||
'Slim\\Routing\\RouteGroup' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteGroup.php',
|
||||
'Slim\\Routing\\RouteParser' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteParser.php',
|
||||
'Slim\\Routing\\RouteResolver' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteResolver.php',
|
||||
'Slim\\Routing\\RouteRunner' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RouteRunner.php',
|
||||
'Slim\\Routing\\RoutingResults' => __DIR__ . '/..' . '/slim/slim/Slim/Routing/RoutingResults.php',
|
||||
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AbstractAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/AbstractAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AbstractTagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/AbstractTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\AdapterInterface' => __DIR__ . '/..' . '/symfony/cache/Adapter/AdapterInterface.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ApcuAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/ApcuAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ArrayAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/ArrayAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ChainAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/ChainAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\DoctrineAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/DoctrineAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/FilesystemAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\FilesystemTagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/FilesystemTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\MemcachedAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/MemcachedAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\NullAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/NullAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PdoAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/PdoAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/PhpArrayAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/PhpFilesAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\ProxyAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/ProxyAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\Psr16Adapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/Psr16Adapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\RedisAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/RedisAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\RedisTagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/RedisTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\SimpleCacheAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/SimpleCacheAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/TagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TagAwareAdapterInterface' => __DIR__ . '/..' . '/symfony/cache/Adapter/TagAwareAdapterInterface.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/TraceableAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableAdapterEvent' => __DIR__ . '/..' . '/symfony/cache/Adapter/TraceableAdapter.php',
|
||||
'Symfony\\Component\\Cache\\Adapter\\TraceableTagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/TraceableTagAwareAdapter.php',
|
||||
'Symfony\\Component\\Cache\\CacheItem' => __DIR__ . '/..' . '/symfony/cache/CacheItem.php',
|
||||
'Symfony\\Component\\Cache\\DataCollector\\CacheDataCollector' => __DIR__ . '/..' . '/symfony/cache/DataCollector/CacheDataCollector.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CacheCollectorPass' => __DIR__ . '/..' . '/symfony/cache/DependencyInjection/CacheCollectorPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolClearerPass' => __DIR__ . '/..' . '/symfony/cache/DependencyInjection/CachePoolClearerPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolPass' => __DIR__ . '/..' . '/symfony/cache/DependencyInjection/CachePoolPass.php',
|
||||
'Symfony\\Component\\Cache\\DependencyInjection\\CachePoolPrunerPass' => __DIR__ . '/..' . '/symfony/cache/DependencyInjection/CachePoolPrunerPass.php',
|
||||
'Symfony\\Component\\Cache\\DoctrineProvider' => __DIR__ . '/..' . '/symfony/cache/DoctrineProvider.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\CacheException' => __DIR__ . '/..' . '/symfony/cache/Exception/CacheException.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/cache/Exception/InvalidArgumentException.php',
|
||||
'Symfony\\Component\\Cache\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/cache/Exception/LogicException.php',
|
||||
'Symfony\\Component\\Cache\\LockRegistry' => __DIR__ . '/..' . '/symfony/cache/LockRegistry.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\DefaultMarshaller' => __DIR__ . '/..' . '/symfony/cache/Marshaller/DefaultMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\DeflateMarshaller' => __DIR__ . '/..' . '/symfony/cache/Marshaller/DeflateMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\MarshallerInterface' => __DIR__ . '/..' . '/symfony/cache/Marshaller/MarshallerInterface.php',
|
||||
'Symfony\\Component\\Cache\\Marshaller\\TagAwareMarshaller' => __DIR__ . '/..' . '/symfony/cache/Marshaller/TagAwareMarshaller.php',
|
||||
'Symfony\\Component\\Cache\\PruneableInterface' => __DIR__ . '/..' . '/symfony/cache/PruneableInterface.php',
|
||||
'Symfony\\Component\\Cache\\Psr16Cache' => __DIR__ . '/..' . '/symfony/cache/Psr16Cache.php',
|
||||
'Symfony\\Component\\Cache\\ResettableInterface' => __DIR__ . '/..' . '/symfony/cache/ResettableInterface.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\AbstractCache' => __DIR__ . '/..' . '/symfony/cache/Simple/AbstractCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\ApcuCache' => __DIR__ . '/..' . '/symfony/cache/Simple/ApcuCache.php',
|
||||
|
@ -247,10 +283,11 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'Symfony\\Component\\Cache\\Simple\\Psr6Cache' => __DIR__ . '/..' . '/symfony/cache/Simple/Psr6Cache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\RedisCache' => __DIR__ . '/..' . '/symfony/cache/Simple/RedisCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\TraceableCache' => __DIR__ . '/..' . '/symfony/cache/Simple/TraceableCache.php',
|
||||
'Symfony\\Component\\Cache\\Simple\\TraceableCacheEvent' => __DIR__ . '/..' . '/symfony/cache/Simple/TraceableCache.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\AbstractAdapterTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/AbstractAdapterTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\AbstractTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/AbstractTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ApcuTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/ApcuTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ArrayTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/ArrayTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ContractsTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/ContractsTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\DoctrineTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/DoctrineTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\FilesystemCommonTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/FilesystemCommonTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\FilesystemTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/FilesystemTrait.php',
|
||||
|
@ -259,6 +296,8 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'Symfony\\Component\\Cache\\Traits\\PhpArrayTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/PhpArrayTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\PhpFilesTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/PhpFilesTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\ProxyTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/ProxyTrait.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisClusterNodeProxy' => __DIR__ . '/..' . '/symfony/cache/Traits/RedisClusterNodeProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisClusterProxy' => __DIR__ . '/..' . '/symfony/cache/Traits/RedisClusterProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisProxy' => __DIR__ . '/..' . '/symfony/cache/Traits/RedisProxy.php',
|
||||
'Symfony\\Component\\Cache\\Traits\\RedisTrait' => __DIR__ . '/..' . '/symfony/cache/Traits/RedisTrait.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\Compiler' => __DIR__ . '/..' . '/symfony/expression-language/Compiler.php',
|
||||
|
@ -286,7 +325,34 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
'Symfony\\Component\\ExpressionLanguage\\SyntaxError' => __DIR__ . '/..' . '/symfony/expression-language/SyntaxError.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\Token' => __DIR__ . '/..' . '/symfony/expression-language/Token.php',
|
||||
'Symfony\\Component\\ExpressionLanguage\\TokenStream' => __DIR__ . '/..' . '/symfony/expression-language/TokenStream.php',
|
||||
'Symfony\\Polyfill\\Apcu\\Apcu' => __DIR__ . '/..' . '/symfony/polyfill-apcu/Apcu.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\ClassNotFoundException' => __DIR__ . '/..' . '/symfony/var-exporter/Exception/ClassNotFoundException.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/var-exporter/Exception/ExceptionInterface.php',
|
||||
'Symfony\\Component\\VarExporter\\Exception\\NotInstantiableTypeException' => __DIR__ . '/..' . '/symfony/var-exporter/Exception/NotInstantiableTypeException.php',
|
||||
'Symfony\\Component\\VarExporter\\Instantiator' => __DIR__ . '/..' . '/symfony/var-exporter/Instantiator.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Exporter' => __DIR__ . '/..' . '/symfony/var-exporter/Internal/Exporter.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Hydrator' => __DIR__ . '/..' . '/symfony/var-exporter/Internal/Hydrator.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Reference' => __DIR__ . '/..' . '/symfony/var-exporter/Internal/Reference.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Registry' => __DIR__ . '/..' . '/symfony/var-exporter/Internal/Registry.php',
|
||||
'Symfony\\Component\\VarExporter\\Internal\\Values' => __DIR__ . '/..' . '/symfony/var-exporter/Internal/Values.php',
|
||||
'Symfony\\Component\\VarExporter\\VarExporter' => __DIR__ . '/..' . '/symfony/var-exporter/VarExporter.php',
|
||||
'Symfony\\Contracts\\Cache\\CacheInterface' => __DIR__ . '/..' . '/symfony/cache-contracts/CacheInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\CacheTrait' => __DIR__ . '/..' . '/symfony/cache-contracts/CacheTrait.php',
|
||||
'Symfony\\Contracts\\Cache\\CallbackInterface' => __DIR__ . '/..' . '/symfony/cache-contracts/CallbackInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\ItemInterface' => __DIR__ . '/..' . '/symfony/cache-contracts/ItemInterface.php',
|
||||
'Symfony\\Contracts\\Cache\\TagAwareCacheInterface' => __DIR__ . '/..' . '/symfony/cache-contracts/TagAwareCacheInterface.php',
|
||||
'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php',
|
||||
'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php',
|
||||
'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php',
|
||||
'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php',
|
||||
'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => __DIR__ . '/..' . '/symfony/service-contracts/Test/ServiceLocatorTest.php',
|
||||
'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php',
|
||||
'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php',
|
||||
'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php',
|
||||
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
|
||||
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
|
@ -294,7 +360,6 @@ class ComposerStaticInitAdvancedContentFilterAddon
|
|||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitAdvancedContentFilterAddon::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitAdvancedContentFilterAddon::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInitAdvancedContentFilterAddon::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInitAdvancedContentFilterAddon::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
|
|
1830
advancedcontentfilter/vendor/composer/installed.json
vendored
1830
advancedcontentfilter/vendor/composer/installed.json
vendored
File diff suppressed because it is too large
Load diff
203
advancedcontentfilter/vendor/composer/installed.php
vendored
Normal file
203
advancedcontentfilter/vendor/composer/installed.php
vendored
Normal file
|
@ -0,0 +1,203 @@
|
|||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'friendica-addons/advancedcontentfilter',
|
||||
'pretty_version' => 'dev-develop',
|
||||
'version' => 'dev-develop',
|
||||
'reference' => 'feb7722f723b21e76fdf20a7ce4b42fa5ffcdcb9',
|
||||
'type' => 'friendica-addon',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => false,
|
||||
),
|
||||
'versions' => array(
|
||||
'friendica-addons/advancedcontentfilter' => array(
|
||||
'pretty_version' => 'dev-develop',
|
||||
'version' => 'dev-develop',
|
||||
'reference' => 'feb7722f723b21e76fdf20a7ce4b42fa5ffcdcb9',
|
||||
'type' => 'friendica-addon',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'nikic/fast-route' => array(
|
||||
'pretty_version' => 'v1.3.0',
|
||||
'version' => '1.3.0.0',
|
||||
'reference' => '181d480e08d9476e61381e04a71b34dc0432e812',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../nikic/fast-route',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/cache' => array(
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/cache-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0|2.0',
|
||||
),
|
||||
),
|
||||
'psr/container' => array(
|
||||
'pretty_version' => '1.1.2',
|
||||
'version' => '1.1.2.0',
|
||||
'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/container',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-factory' => array(
|
||||
'pretty_version' => '1.0.2',
|
||||
'version' => '1.0.2.0',
|
||||
'reference' => 'e616d01114759c4c489f93b099585439f795fe35',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-factory',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-message' => array(
|
||||
'pretty_version' => '2.0',
|
||||
'version' => '2.0.0.0',
|
||||
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-message',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-server-handler' => array(
|
||||
'pretty_version' => '1.0.2',
|
||||
'version' => '1.0.2.0',
|
||||
'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-server-handler',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-server-middleware' => array(
|
||||
'pretty_version' => '1.0.2',
|
||||
'version' => '1.0.2.0',
|
||||
'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-server-middleware',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/log' => array(
|
||||
'pretty_version' => '1.1.4',
|
||||
'version' => '1.1.4.0',
|
||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/log',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/simple-cache-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0|2.0',
|
||||
),
|
||||
),
|
||||
'slim/slim' => array(
|
||||
'pretty_version' => '4.13.0',
|
||||
'version' => '4.13.0.0',
|
||||
'reference' => '038fd5713d5a41636fdff0e8dcceedecdd17fc17',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../slim/slim',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/cache' => array(
|
||||
'pretty_version' => 'v4.4.48',
|
||||
'version' => '4.4.48.0',
|
||||
'reference' => '3b98ed664887ad197b8ede3da2432787212eb915',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/cache-contracts' => array(
|
||||
'pretty_version' => 'v2.5.2',
|
||||
'version' => '2.5.2.0',
|
||||
'reference' => '64be4a7acb83b6f2bf6de9a02cee6dad41277ebc',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/cache-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/cache-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0|2.0',
|
||||
),
|
||||
),
|
||||
'symfony/deprecation-contracts' => array(
|
||||
'pretty_version' => 'v2.5.2',
|
||||
'version' => '2.5.2.0',
|
||||
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/expression-language' => array(
|
||||
'pretty_version' => 'v3.4.47',
|
||||
'version' => '3.4.47.0',
|
||||
'reference' => 'de38e66398fca1fcb9c48e80279910e6889cb28f',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/expression-language',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php70' => array(
|
||||
'pretty_version' => 'v1.20.0',
|
||||
'version' => '1.20.0.0',
|
||||
'reference' => '5f03a781d984aae42cebd18e7912fa80f02ee644',
|
||||
'type' => 'metapackage',
|
||||
'install_path' => null,
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php73' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => '21bd091060673a1177ae842c0ef8fe30893114d2',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php80' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/service-contracts' => array(
|
||||
'pretty_version' => 'v2.5.2',
|
||||
'version' => '2.5.2.0',
|
||||
'reference' => '4b426aac47d6427cc1a1d0f7e2ac724627f5966c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/service-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/var-exporter' => array(
|
||||
'pretty_version' => 'v5.4.35',
|
||||
'version' => '5.4.35.0',
|
||||
'reference' => 'abb0a151b62d6b07e816487e20040464af96cae7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/var-exporter',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
26
advancedcontentfilter/vendor/composer/platform_check.php
vendored
Normal file
26
advancedcontentfilter/vendor/composer/platform_check.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 70400)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
composer.lock
|
||||
composer.phar
|
||||
/vendor/
|
|
@ -1,20 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 container-interop
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,148 +0,0 @@
|
|||
# Container Interoperability
|
||||
|
||||
[![Latest Stable Version](https://poser.pugx.org/container-interop/container-interop/v/stable.png)](https://packagist.org/packages/container-interop/container-interop)
|
||||
[![Total Downloads](https://poser.pugx.org/container-interop/container-interop/downloads.svg)](https://packagist.org/packages/container-interop/container-interop)
|
||||
|
||||
## Deprecation warning!
|
||||
|
||||
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).
|
||||
Container-interop has been the test-bed of PSR-11. From v1.2, container-interop directly extends PSR-11 interfaces.
|
||||
Therefore, all containers implementing container-interop are now *de-facto* compatible with PSR-11.
|
||||
|
||||
- Projects implementing container-interop interfaces are encouraged to directly implement PSR-11 interfaces instead.
|
||||
- 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.
|
||||
|
||||
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.
|
||||
|
||||
## About
|
||||
|
||||
*container-interop* tries to identify and standardize features in *container* objects (service locators,
|
||||
dependency injection containers, etc.) to achieve interoperability.
|
||||
|
||||
Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.
|
||||
|
||||
If PHP projects that provide container implementations begin to adopt these common standards, then PHP
|
||||
applications and projects that use containers can depend on the common interfaces instead of specific
|
||||
implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume
|
||||
*any* container implementation that can be adapted to these interfaces.
|
||||
|
||||
The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being
|
||||
worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope
|
||||
this project will pave the way for one or more future PSRs.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
You can install this package through Composer:
|
||||
|
||||
```json
|
||||
composer require container-interop/container-interop
|
||||
```
|
||||
|
||||
The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility
|
||||
between minor versions.
|
||||
|
||||
## Standards
|
||||
|
||||
### Available
|
||||
|
||||
- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php).
|
||||
[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md).
|
||||
Describes the interface of a container that exposes methods to read its entries.
|
||||
- [*Delegate lookup feature*](docs/Delegate-lookup.md).
|
||||
[Meta Document](docs/Delegate-lookup-meta.md).
|
||||
Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This
|
||||
feature lets several containers work together in a single application.
|
||||
|
||||
### Proposed
|
||||
|
||||
View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC)
|
||||
|
||||
## Compatible projects
|
||||
|
||||
### Projects implementing `ContainerInterface`
|
||||
|
||||
- [Acclimate](https://github.com/jeremeamia/acclimate-container): Adapters for
|
||||
Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2
|
||||
Dependency injection and any container using `ArrayAccess`
|
||||
- [Aura.Di](https://github.com/auraphp/Aura.Di)
|
||||
- [auryn-container-interop](https://github.com/elazar/auryn-container-interop)
|
||||
- [Burlap](https://github.com/codeeverything/burlap)
|
||||
- [Chernozem](https://github.com/pyrsmk/Chernozem)
|
||||
- [Data Manager](https://github.com/chrismichaels84/data-manager)
|
||||
- [Disco](https://github.com/bitexpert/disco)
|
||||
- [InDI](https://github.com/idealogica/indi)
|
||||
- [League/Container](http://container.thephpleague.com/)
|
||||
- [Mouf](http://mouf-php.com)
|
||||
- [Njasm Container](https://github.com/njasm/container)
|
||||
- [PHP-DI](http://php-di.org)
|
||||
- [Picotainer](https://github.com/thecodingmachine/picotainer)
|
||||
- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
|
||||
- [Pimple3-ContainerInterop](https://github.com/Sam-Burns/pimple3-containerinterop) (using Pimple v3)
|
||||
- [SitePoint Container](https://github.com/sitepoint/Container)
|
||||
- [Thruster Container](https://github.com/ThrusterIO/container) (PHP7 only)
|
||||
- [Ultra-Lite Container](https://github.com/ultra-lite/container)
|
||||
- [Unbox](https://github.com/mindplay-dk/unbox)
|
||||
- [XStatic](https://github.com/jeremeamia/xstatic)
|
||||
- [Zend\ServiceManager](https://github.com/zendframework/zend-servicemanager)
|
||||
- [Zit](https://github.com/inxilpro/Zit)
|
||||
|
||||
### Projects implementing the *delegate lookup* feature
|
||||
|
||||
- [Aura.Di](https://github.com/auraphp/Aura.Di)
|
||||
- [Burlap](https://github.com/codeeverything/burlap)
|
||||
- [Chernozem](https://github.com/pyrsmk/Chernozem)
|
||||
- [InDI](https://github.com/idealogica/indi)
|
||||
- [League/Container](http://container.thephpleague.com/)
|
||||
- [Mouf](http://mouf-php.com)
|
||||
- [Picotainer](https://github.com/thecodingmachine/picotainer)
|
||||
- [PHP-DI](http://php-di.org)
|
||||
- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
|
||||
- [Ultra-Lite Container](https://github.com/ultra-lite/container)
|
||||
|
||||
### Middlewares implementing `ContainerInterface`
|
||||
|
||||
- [Alias-Container](https://github.com/thecodingmachine/alias-container): add
|
||||
aliases support to any container
|
||||
- [Prefixer-Container](https://github.com/thecodingmachine/prefixer-container):
|
||||
dynamically prefix identifiers
|
||||
- [Lazy-Container](https://github.com/snapshotpl/lazy-container): lazy services
|
||||
|
||||
### Projects using `ContainerInterface`
|
||||
|
||||
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).
|
||||
|
||||
| | Downloads |
|
||||
| --- | --- |
|
||||
| [Adroit](https://github.com/bitexpert/adroit) | ![](https://img.shields.io/packagist/dt/bitexpert/adroit.svg) |
|
||||
| [Behat](https://github.com/Behat/Behat/pull/974) | ![](https://img.shields.io/packagist/dt/behat/behat.svg) |
|
||||
| [blast-facades](https://github.com/phpthinktank/blast-facades): Minimize complexity and represent dependencies as facades. | ![](https://img.shields.io/packagist/dt/blast/facades.svg) |
|
||||
| [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) |
|
||||
| [mindplay/walkway](https://github.com/mindplay-dk/walkway): a modular request router | ![](https://img.shields.io/packagist/dt/mindplay/walkway.svg) |
|
||||
| [mindplay/middleman](https://github.com/mindplay-dk/middleman): minimalist PSR-7 middleware dispatcher | ![](https://img.shields.io/packagist/dt/mindplay/middleman.svg) |
|
||||
| [PHP-DI/Invoker](https://github.com/PHP-DI/Invoker): extensible and configurable invoker/dispatcher | ![](https://img.shields.io/packagist/dt/php-di/invoker.svg) |
|
||||
| [Prophiler](https://github.com/fabfuel/prophiler) | ![](https://img.shields.io/packagist/dt/fabfuel/prophiler.svg) |
|
||||
| [Silly](https://github.com/mnapoli/silly): CLI micro-framework | ![](https://img.shields.io/packagist/dt/mnapoli/silly.svg) |
|
||||
| [Slim v3](https://github.com/slimphp/Slim) | ![](https://img.shields.io/packagist/dt/slim/slim.svg) |
|
||||
| [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) |
|
||||
| [Woohoo Labs. Harmony](https://github.com/woohoolabs/harmony): a flexible micro-framework | ![](https://img.shields.io/packagist/dt/woohoolabs/harmony.svg) |
|
||||
| [zend-expressive](https://github.com/zendframework/zend-expressive) | ![](https://img.shields.io/packagist/dt/zendframework/zend-expressive.svg) |
|
||||
|
||||
|
||||
## Workflow
|
||||
|
||||
Everyone is welcome to join and contribute.
|
||||
|
||||
The general workflow looks like this:
|
||||
|
||||
1. Someone opens a discussion (GitHub issue) to suggest an interface
|
||||
1. Feedback is gathered
|
||||
1. The interface is added to a development branch
|
||||
1. We release alpha versions so that the interface can be experimented with
|
||||
1. Discussions and edits ensue until the interface is deemed stable by a general consensus
|
||||
1. A new minor version of the package is released
|
||||
|
||||
We try to not break BC by creating new interfaces instead of editing existing ones.
|
||||
|
||||
While we currently work on interfaces, we are open to anything that might help towards interoperability, may that
|
||||
be code, best practices, etc.
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"name": "container-interop/container-interop",
|
||||
"type": "library",
|
||||
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
||||
"homepage": "https://github.com/container-interop/container-interop",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Interop\\Container\\": "src/Interop/Container/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"psr/container": "^1.0"
|
||||
}
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
# ContainerInterface Meta Document
|
||||
|
||||
## Introduction
|
||||
|
||||
This document describes the process and discussions that lead to the `ContainerInterface`.
|
||||
Its goal is to explain the reasons behind each decision.
|
||||
|
||||
## Goal
|
||||
|
||||
The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
|
||||
container to obtain objects and parameters.
|
||||
|
||||
By standardizing such a behavior, frameworks and libraries using the `ContainerInterface`
|
||||
could work with any compatible container.
|
||||
That would allow end users to choose their own container based on their own preferences.
|
||||
|
||||
It is important to distinguish the two usages of a container:
|
||||
|
||||
- configuring entries
|
||||
- fetching entries
|
||||
|
||||
Most of the time, those two sides are not used by the same party.
|
||||
While it is often end users who tend to configure entries, it is generally the framework that fetch
|
||||
entries to build the application.
|
||||
|
||||
This is why this interface focuses only on how entries can be fetched from a container.
|
||||
|
||||
## Interface name
|
||||
|
||||
The interface name has been thoroughly discussed and was decided by a vote.
|
||||
|
||||
The list of options considered with their respective votes are:
|
||||
|
||||
- `ContainerInterface`: +8
|
||||
- `ProviderInterface`: +2
|
||||
- `LocatorInterface`: 0
|
||||
- `ReadableContainerInterface`: -5
|
||||
- `ServiceLocatorInterface`: -6
|
||||
- `ObjectFactory`: -6
|
||||
- `ObjectStore`: -8
|
||||
- `ConsumerInterface`: -9
|
||||
|
||||
[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
|
||||
|
||||
The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1).
|
||||
|
||||
## Interface methods
|
||||
|
||||
The choice of which methods the interface would contain was made after a statistical analysis of existing containers.
|
||||
The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681).
|
||||
|
||||
The summary of the analysis showed that:
|
||||
|
||||
- all containers offer a method to get an entry by its id
|
||||
- a large majority name such method `get()`
|
||||
- for all containers, the `get()` method has 1 mandatory parameter of type string
|
||||
- some containers have an optional additional argument for `get()`, but it doesn't have the same purpose between containers
|
||||
- a large majority of the containers offer a method to test if it can return an entry by its id
|
||||
- a majority name such method `has()`
|
||||
- for all containers offering `has()`, the method has exactly 1 parameter of type string
|
||||
- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()`
|
||||
- a large majority of the containers don't implement `ArrayAccess`
|
||||
|
||||
The question of whether to include methods to define entries has been discussed in
|
||||
[issue #1](https://github.com/container-interop/container-interop/issues/1).
|
||||
It has been judged that such methods do not belong in the interface described here because it is out of its scope
|
||||
(see the "Goal" section).
|
||||
|
||||
As a result, the `ContainerInterface` contains two methods:
|
||||
|
||||
- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found.
|
||||
- `has()`, returning a boolean, with one mandatory string parameter.
|
||||
|
||||
### Number of parameters in `get()` method
|
||||
|
||||
While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with
|
||||
existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters
|
||||
as long as they are optional, because the implementation *does* satisfy the interface.
|
||||
|
||||
This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6).
|
||||
|
||||
### Type of the `$id` parameter
|
||||
|
||||
The type of the `$id` parameter in `get()` and `has()` has been discussed in
|
||||
[issue #6](https://github.com/container-interop/container-interop/issues/6).
|
||||
While `string` is used in all the containers that were analyzed, it was suggested that allowing
|
||||
anything (such as objects) could allow containers to offer a more advanced query API.
|
||||
|
||||
An example given was to use the container as an object builder. The `$id` parameter would then be an
|
||||
object that would describe how to create an instance.
|
||||
|
||||
The conclusion of the discussion was that this was beyond the scope of getting entries from a container without
|
||||
knowing how the container provided them, and it was more fit for a factory.
|
||||
|
||||
## Contributors
|
||||
|
||||
Are listed here all people that contributed in the discussions or votes, by alphabetical order:
|
||||
|
||||
- [Amy Stephen](https://github.com/AmyStephen)
|
||||
- [David Négrier](https://github.com/moufmouf)
|
||||
- [Don Gilbert](https://github.com/dongilbert)
|
||||
- [Jason Judge](https://github.com/judgej)
|
||||
- [Jeremy Lindblom](https://github.com/jeremeamia)
|
||||
- [Marco Pivetta](https://github.com/Ocramius)
|
||||
- [Matthieu Napoli](https://github.com/mnapoli)
|
||||
- [Paul M. Jones](https://github.com/pmjones)
|
||||
- [Stephan Hochdörfer](https://github.com/shochdoerfer)
|
||||
- [Taylor Otwell](https://github.com/taylorotwell)
|
||||
|
||||
## Relevant links
|
||||
|
||||
- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php)
|
||||
- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed)
|
||||
- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote)
|
|
@ -1,158 +0,0 @@
|
|||
Container interface
|
||||
===================
|
||||
|
||||
This document describes a common interface for dependency injection containers.
|
||||
|
||||
The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a
|
||||
container to obtain objects and parameters (called *entries* in the rest of this document).
|
||||
|
||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||
interpreted as described in [RFC 2119][].
|
||||
|
||||
The word `implementor` in this document is to be interpreted as someone
|
||||
implementing the `ContainerInterface` in a dependency injection-related library or framework.
|
||||
Users of dependency injections containers (DIC) are referred to as `user`.
|
||||
|
||||
[RFC 2119]: http://tools.ietf.org/html/rfc2119
|
||||
|
||||
1. Specification
|
||||
-----------------
|
||||
|
||||
### 1.1 Basics
|
||||
|
||||
- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`.
|
||||
|
||||
- `get` takes one mandatory parameter: an entry identifier. It MUST be a string.
|
||||
A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier
|
||||
is not known to the container. Two successive calls to `get` with the same
|
||||
identifier SHOULD return the same value. However, depending on the `implementor`
|
||||
design and/or `user` configuration, different values might be returned, so
|
||||
`user` SHOULD NOT rely on getting the same value on 2 successive calls.
|
||||
While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations
|
||||
MAY accept additional optional parameters.
|
||||
|
||||
- `has` takes one unique parameter: an entry identifier. It MUST return `true`
|
||||
if an entry identifier is known to the container and `false` if it is not.
|
||||
`has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
||||
It does however mean that `get($id)` will not throw a `NotFoundException`.
|
||||
|
||||
### 1.2 Exceptions
|
||||
|
||||
Exceptions directly thrown by the container MUST implement the
|
||||
[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php).
|
||||
|
||||
A call to the `get` method with a non-existing id SHOULD throw a
|
||||
[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php).
|
||||
|
||||
### 1.3 Additional features
|
||||
|
||||
This section describes additional features that MAY be added to a container. Containers are not
|
||||
required to implement these features to respect the ContainerInterface.
|
||||
|
||||
#### 1.3.1 Delegate lookup feature
|
||||
|
||||
The goal of the *delegate lookup* feature is to allow several containers to share entries.
|
||||
Containers implementing this feature can perform dependency lookups in other containers.
|
||||
|
||||
Containers implementing this feature will offer a greater lever of interoperability
|
||||
with other containers. Implementation of this feature is therefore RECOMMENDED.
|
||||
|
||||
A container implementing this feature:
|
||||
|
||||
- MUST implement the `ContainerInterface`
|
||||
- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
|
||||
or any possible way). The delegate container MUST implement the `ContainerInterface`.
|
||||
|
||||
When a container is configured to use a delegate container for dependencies:
|
||||
|
||||
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
||||
If the entry is not part of the container, an exception should be thrown
|
||||
(as requested by the `ContainerInterface`).
|
||||
- Calls to the `has` method should only return `true` if the entry is part of the container.
|
||||
If the entry is not part of the container, `false` should be returned.
|
||||
- If the fetched entry has dependencies, **instead** of performing
|
||||
the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
||||
|
||||
Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
|
||||
|
||||
It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
||||
into the same container (or another container) instead of the delegate container.
|
||||
|
||||
2. Package
|
||||
----------
|
||||
|
||||
The interfaces and classes described as well as relevant exception are provided as part of the
|
||||
[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package.
|
||||
|
||||
3. `Interop\Container\ContainerInterface`
|
||||
-----------------------------------------
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace Interop\Container;
|
||||
|
||||
use Interop\Container\Exception\ContainerException;
|
||||
use Interop\Container\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Describes the interface of a container that exposes methods to read its entries.
|
||||
*/
|
||||
interface ContainerInterface
|
||||
{
|
||||
/**
|
||||
* Finds an entry of the container by its identifier and returns it.
|
||||
*
|
||||
* @param string $id Identifier of the entry to look for.
|
||||
*
|
||||
* @throws NotFoundException No entry was found for this identifier.
|
||||
* @throws ContainerException Error while retrieving the entry.
|
||||
*
|
||||
* @return mixed Entry.
|
||||
*/
|
||||
public function get($id);
|
||||
|
||||
/**
|
||||
* Returns true if the container can return an entry for the given identifier.
|
||||
* Returns false otherwise.
|
||||
*
|
||||
* `has($id)` returning true does not mean that `get($id)` will not throw an exception.
|
||||
* It does however mean that `get($id)` will not throw a `NotFoundException`.
|
||||
*
|
||||
* @param string $id Identifier of the entry to look for.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function has($id);
|
||||
}
|
||||
```
|
||||
|
||||
4. `Interop\Container\Exception\ContainerException`
|
||||
---------------------------------------------------
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace Interop\Container\Exception;
|
||||
|
||||
/**
|
||||
* Base interface representing a generic exception in a container.
|
||||
*/
|
||||
interface ContainerException
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
5. `Interop\Container\Exception\NotFoundException`
|
||||
---------------------------------------------------
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace Interop\Container\Exception;
|
||||
|
||||
/**
|
||||
* No entry was found in the container.
|
||||
*/
|
||||
interface NotFoundException extends ContainerException
|
||||
{
|
||||
}
|
||||
```
|
|
@ -1,259 +0,0 @@
|
|||
Delegate lookup feature Meta Document
|
||||
=====================================
|
||||
|
||||
1. Summary
|
||||
----------
|
||||
|
||||
This document describes the *delegate lookup feature*.
|
||||
Containers are not required to implement this feature to respect the `ContainerInterface`.
|
||||
However, containers implementing this feature will offer a greater lever of interoperability
|
||||
with other containers, allowing multiple containers to share entries in the same application.
|
||||
Implementation of this feature is therefore recommanded.
|
||||
|
||||
2. Why Bother?
|
||||
--------------
|
||||
|
||||
The [`ContainerInterface`](../src/Interop/Container/ContainerInterface.php) ([meta doc](ContainerInterface.md))
|
||||
standardizes how frameworks and libraries make use of a container to obtain objects and parameters.
|
||||
|
||||
By standardizing such a behavior, frameworks and libraries relying on the `ContainerInterface`
|
||||
could work with any compatible container.
|
||||
That would allow end users to choose their own container based on their own preferences.
|
||||
|
||||
The `ContainerInterface` is also enough if we want to have several containers side-by-side in the same
|
||||
application. For instance, this is what the [CompositeContainer](https://github.com/jeremeamia/acclimate-container/blob/master/src/CompositeContainer.php)
|
||||
class of [Acclimate](https://github.com/jeremeamia/acclimate-container) is designed for:
|
||||
|
||||
![Side by side containers](images/side_by_side_containers.png)
|
||||
|
||||
However, an instance in container 1 cannot reference an instance in container 2.
|
||||
|
||||
It would be better if an instance of container 1 could reference an instance in container 2,
|
||||
and the opposite should be true.
|
||||
|
||||
![Interoperating containers](images/interoperating_containers.png)
|
||||
|
||||
In the sample above, entry 1 in container 1 is referencing entry 3 in container 2.
|
||||
|
||||
3. Scope
|
||||
--------
|
||||
|
||||
### 3.1 Goals
|
||||
|
||||
The goal of the *delegate lookup* feature is to allow several containers to share entries.
|
||||
|
||||
4. Approaches
|
||||
-------------
|
||||
|
||||
### 4.1 Chosen Approach
|
||||
|
||||
Containers implementing this feature can perform dependency lookups in other containers.
|
||||
|
||||
A container implementing this feature:
|
||||
|
||||
- must implement the `ContainerInterface`
|
||||
- must provide a way to register a *delegate container* (using a constructor parameter, or a setter, or any
|
||||
possible way). The *delegate container* must implement the `ContainerInterface`.
|
||||
|
||||
When a *delegate container* is configured on a container:
|
||||
|
||||
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
||||
If the entry is not part of the container, an exception should be thrown (as required in the `ContainerInterface`).
|
||||
- Calls to the `has` method should only return *true* if the entry is part of the container.
|
||||
If the entry is not part of the container, *false* should be returned.
|
||||
- Finally, the important part: if the entry we are fetching has dependencies,
|
||||
**instead** of perfoming the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
||||
|
||||
Important! By default, the lookup should be performed on the delegate container **only**, not on the container itself.
|
||||
|
||||
It is however allowed for containers to provide exception cases for special entries, and a way to lookup into
|
||||
the same container (or another container) instead of the delegate container.
|
||||
|
||||
### 4.2 Typical usage
|
||||
|
||||
The *delegate container* will usually be a composite container. A composite container is a container that
|
||||
contains several other containers. When performing a lookup on a composite container, the inner containers are
|
||||
queried until one container returns an entry.
|
||||
An inner container implementing the *delegate lookup feature* will return entries it contains, but if these
|
||||
entries have dependencies, the dependencies lookup calls will be performed on the composite container, giving
|
||||
a chance to all containers to answer.
|
||||
|
||||
Interestingly enough, the order in which containers are added in the composite container matters. Indeed,
|
||||
the first containers to be added in the composite container can "override" the entries of containers with
|
||||
lower priority.
|
||||
|
||||
![Containers priority](images/priority.png)
|
||||
|
||||
In the example above, "container 2" contains a controller "myController" and the controller is referencing an
|
||||
"entityManager" entry. "Container 1" contains also an entry named "entityManager".
|
||||
Without the *delegate lookup* feature, when requesting the "myController" instance to container 2, it would take
|
||||
in charge the instanciation of both entries.
|
||||
|
||||
However, using the *delegate lookup* feature, here is what happens when we ask the composite container for the
|
||||
"myController" instance:
|
||||
|
||||
- The composite container asks container 1 if if contains the "myController" instance. The answer is no.
|
||||
- The composite container asks container 2 if if contains the "myController" instance. The answer is yes.
|
||||
- The composite container performs a `get` call on container 2 for the "myController" instance.
|
||||
- Container 2 sees that "myController" has a dependency on "entityManager".
|
||||
- Container 2 delegates the lookup of "entityManager" to the composite container.
|
||||
- The composite container asks container 1 if if contains the "entityManager" instance. The answer is yes.
|
||||
- The composite container performs a `get` call on container 1 for the "entityManager" instance.
|
||||
|
||||
In the end, we get a controller instanciated by container 2 that references an entityManager instanciated
|
||||
by container 1.
|
||||
|
||||
### 4.3 Alternative: the fallback strategy
|
||||
|
||||
The first proposed approach we tried was to perform all the lookups in the "local" container,
|
||||
and if a lookup fails in the container, to use the delegate container. In this scenario, the
|
||||
delegate container is used in "fallback" mode.
|
||||
|
||||
This strategy has been described in @moufmouf blog post: http://mouf-php.com/container-interop-whats-next (solution 1).
|
||||
It was also discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-33570697) and
|
||||
[here](https://github.com/container-interop/container-interop/pull/20#issuecomment-56599631).
|
||||
|
||||
Problems with this strategy:
|
||||
|
||||
- Heavy problem regarding infinite loops
|
||||
- Unable to overload a container entry with the delegate container entry
|
||||
|
||||
### 4.4 Alternative: force implementing an interface
|
||||
|
||||
The first proposed approach was to develop a `ParentAwareContainerInterface` interface.
|
||||
It was proposed here: https://github.com/container-interop/container-interop/pull/8
|
||||
|
||||
The interface would have had the behaviour of the delegate lookup feature but would have forced the addition of
|
||||
a `setParentContainter` method:
|
||||
|
||||
```php
|
||||
interface ParentAwareContainerInterface extends ReadableContainerInterface {
|
||||
/**
|
||||
* Sets the parent container associated to that container. This container will call
|
||||
* the parent container to fetch dependencies.
|
||||
*
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
public function setParentContainer(ContainerInterface $container);
|
||||
}
|
||||
```
|
||||
|
||||
The interface idea was first questioned by @Ocramius [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777).
|
||||
@Ocramius expressed the idea that an interface should not contain setters, otherwise, it is forcing implementation
|
||||
details on the class implementing the interface.
|
||||
Then @mnapoli made a proposal for a "convention" [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51841079),
|
||||
this idea was further discussed until all participants in the discussion agreed to remove the interface idea
|
||||
and replace it with a "standard" feature.
|
||||
|
||||
**Pros:**
|
||||
|
||||
If we had had an interface, we could have delegated the registration of the delegate/composite container to the
|
||||
the delegate/composite container itself.
|
||||
For instance:
|
||||
|
||||
```php
|
||||
$containerA = new ContainerA();
|
||||
$containerB = new ContainerB();
|
||||
|
||||
$compositeContainer = new CompositeContainer([$containerA, $containerB]);
|
||||
|
||||
// The call to 'setParentContainer' is delegated to the CompositeContainer
|
||||
// It is not the responsibility of the user anymore.
|
||||
class CompositeContainer {
|
||||
...
|
||||
|
||||
public function __construct($containers) {
|
||||
foreach ($containers as $container) {
|
||||
if ($container instanceof ParentAwareContainerInterface) {
|
||||
$container->setParentContainer($this);
|
||||
}
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
**Cons:**
|
||||
|
||||
Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777).
|
||||
Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments,
|
||||
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.
|
||||
|
||||
### 4.4 Alternative: no exception case for delegate lookups
|
||||
|
||||
Originally, the proposed wording for delegate lookup calls was:
|
||||
|
||||
> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself.
|
||||
|
||||
This was later replaced by:
|
||||
|
||||
> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself.
|
||||
>
|
||||
> It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
||||
> into the same container (or another container) instead of the delegate container.
|
||||
|
||||
Exception cases have been allowed to avoid breaking dependencies with some services that must be provided
|
||||
by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235
|
||||
|
||||
### 4.5 Alternative: having one of the containers act as the composite container
|
||||
|
||||
In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to
|
||||
add another DI container to this container. Most of the time, the "big" framework will be responsible for
|
||||
creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted,
|
||||
the "big" framework will not be aware of the existence of a composite container that it should use instead
|
||||
of its own container.
|
||||
|
||||
For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container
|
||||
to make it act as a composite container.
|
||||
|
||||
This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194)
|
||||
and [here](http://mouf-php.com/container-interop-whats-next#solution4).
|
||||
|
||||
This was implemented in Symfony 2 using:
|
||||
|
||||
- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0)
|
||||
- [framework interop](https://github.com/mnapoli/framework-interop/)
|
||||
|
||||
This was implemented in Silex using:
|
||||
|
||||
- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di)
|
||||
|
||||
Having a container act as the composite container is not part of the delegate lookup standard because it is
|
||||
simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop
|
||||
play nice with other DI containers.
|
||||
|
||||
|
||||
5. Implementations
|
||||
------------------
|
||||
|
||||
The following projects already implement the delegate lookup feature:
|
||||
|
||||
- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120)
|
||||
- [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)
|
||||
- [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)
|
||||
|
||||
6. People
|
||||
---------
|
||||
|
||||
Are listed here all people that contributed in the discussions, by alphabetical order:
|
||||
|
||||
- [Alexandru Pătrănescu](https://github.com/drealecs)
|
||||
- [Ben Peachey](https://github.com/potherca)
|
||||
- [David Négrier](https://github.com/moufmouf)
|
||||
- [Jeremy Lindblom](https://github.com/jeremeamia)
|
||||
- [Marco Pivetta](https://github.com/Ocramius)
|
||||
- [Matthieu Napoli](https://github.com/mnapoli)
|
||||
- [Nelson J Morais](https://github.com/njasm)
|
||||
- [Phil Sturgeon](https://github.com/philsturgeon)
|
||||
- [Stephan Hochdörfer](https://github.com/shochdoerfer)
|
||||
|
||||
7. Relevant Links
|
||||
-----------------
|
||||
|
||||
_**Note:** Order descending chronologically._
|
||||
|
||||
- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20)
|
||||
- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8)
|
||||
- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next)
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
Delegate lookup feature
|
||||
=======================
|
||||
|
||||
This document describes a standard for dependency injection containers.
|
||||
|
||||
The goal set by the *delegate lookup* feature is to allow several containers to share entries.
|
||||
Containers implementing this feature can perform dependency lookups in other containers.
|
||||
|
||||
Containers implementing this feature will offer a greater lever of interoperability
|
||||
with other containers. Implementation of this feature is therefore RECOMMENDED.
|
||||
|
||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||
interpreted as described in [RFC 2119][].
|
||||
|
||||
The word `implementor` in this document is to be interpreted as someone
|
||||
implementing the delegate lookup feature in a dependency injection-related library or framework.
|
||||
Users of dependency injections containers (DIC) are referred to as `user`.
|
||||
|
||||
[RFC 2119]: http://tools.ietf.org/html/rfc2119
|
||||
|
||||
1. Vocabulary
|
||||
-------------
|
||||
|
||||
In a dependency injection container, the container is used to fetch entries.
|
||||
Entries can have dependencies on other entries. Usually, these other entries are fetched by the container.
|
||||
|
||||
The *delegate lookup* feature is the ability for a container to fetch dependencies in
|
||||
another container. In the rest of the document, the word "container" will reference the container
|
||||
implemented by the implementor. The word "delegate container" will reference the container we are
|
||||
fetching the dependencies from.
|
||||
|
||||
2. Specification
|
||||
----------------
|
||||
|
||||
A container implementing the *delegate lookup* feature:
|
||||
|
||||
- MUST implement the [`ContainerInterface`](ContainerInterface.md)
|
||||
- MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
|
||||
or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md).
|
||||
|
||||
When a container is configured to use a delegate container for dependencies:
|
||||
|
||||
- Calls to the `get` method should only return an entry if the entry is part of the container.
|
||||
If the entry is not part of the container, an exception should be thrown
|
||||
(as requested by the [`ContainerInterface`](ContainerInterface.md)).
|
||||
- Calls to the `has` method should only return `true` if the entry is part of the container.
|
||||
If the entry is not part of the container, `false` should be returned.
|
||||
- If the fetched entry has dependencies, **instead** of performing
|
||||
the dependency lookup in the container, the lookup is performed on the *delegate container*.
|
||||
|
||||
Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself.
|
||||
|
||||
It is however allowed for containers to provide exception cases for special entries, and a way to lookup
|
||||
into the same container (or another container) instead of the delegate container.
|
||||
|
||||
3. Package / Interface
|
||||
----------------------
|
||||
|
||||
This feature is not tied to any code, interface or package.
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Interop\Container;
|
||||
|
||||
use Psr\Container\ContainerInterface as PsrContainerInterface;
|
||||
|
||||
/**
|
||||
* Describes the interface of a container that exposes methods to read its entries.
|
||||
*/
|
||||
interface ContainerInterface extends PsrContainerInterface
|
||||
{
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Interop\Container\Exception;
|
||||
|
||||
use Psr\Container\ContainerExceptionInterface as PsrContainerException;
|
||||
|
||||
/**
|
||||
* Base interface representing a generic exception in a container.
|
||||
*/
|
||||
interface ContainerException extends PsrContainerException
|
||||
{
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Interop\Container\Exception;
|
||||
|
||||
use Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
|
||||
|
||||
/**
|
||||
* No entry was found in the container.
|
||||
*/
|
||||
interface NotFoundException extends ContainerException, PsrNotFoundException
|
||||
{
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
language: php
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- PIMPLE_EXT=no
|
||||
- PIMPLE_EXT=yes
|
||||
global:
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
before_script:
|
||||
- composer self-update
|
||||
- COMPOSER_ROOT_VERSION=dev-master composer install
|
||||
- if [ "$PIMPLE_EXT" == "yes" ]; then sh -c "cd ext/pimple && phpize && ./configure && make && sudo make install"; fi
|
||||
- if [ "$PIMPLE_EXT" == "yes" ]; then echo "extension=pimple.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
|
||||
|
||||
script:
|
||||
- cd ext/pimple
|
||||
- if [ "$PIMPLE_EXT" == "yes" ]; then yes n | make test | tee output ; grep -E 'Tests failed +. +0' output; fi
|
||||
- if [ "$PIMPLE_EXT" == "yes" ]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi
|
||||
- cd ../..
|
||||
- ./vendor/bin/simple-phpunit
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: hhvm
|
||||
dist: trusty
|
||||
env: PIMPLE_EXT=no
|
||||
exclude:
|
||||
- php: 7.0
|
||||
env: PIMPLE_EXT=yes
|
||||
- php: 7.1
|
||||
env: PIMPLE_EXT=yes
|
|
@ -1,59 +0,0 @@
|
|||
* 3.2.3 (2017-XX-XX)
|
||||
|
||||
* n/a
|
||||
|
||||
* 3.2.2 (2017-07-23)
|
||||
|
||||
* reverted extending a protected closure throws an exception (deprecated it instead)
|
||||
|
||||
* 3.2.1 (2017-07-17)
|
||||
|
||||
* fixed PHP error
|
||||
|
||||
* 3.2.0 (2017-07-17)
|
||||
|
||||
* added a PSR-11 service locator
|
||||
* added a PSR-11 wrapper
|
||||
* added ServiceIterator
|
||||
* fixed extending a protected closure (now throws InvalidServiceIdentifierException)
|
||||
|
||||
* 3.1.0 (2017-07-03)
|
||||
|
||||
* deprecated the C extension
|
||||
* added support for PSR-11 exceptions
|
||||
|
||||
* 3.0.2 (2015-09-11)
|
||||
|
||||
* refactored the C extension
|
||||
* minor non-significant changes
|
||||
|
||||
* 3.0.1 (2015-07-30)
|
||||
|
||||
* simplified some code
|
||||
* fixed a segfault in the C extension
|
||||
|
||||
* 3.0.0 (2014-07-24)
|
||||
|
||||
* removed the Pimple class alias (use Pimple\Container instead)
|
||||
|
||||
* 2.1.1 (2014-07-24)
|
||||
|
||||
* fixed compiler warnings for the C extension
|
||||
* fixed code when dealing with circular references
|
||||
|
||||
* 2.1.0 (2014-06-24)
|
||||
|
||||
* moved the Pimple to Pimple\Container (with a BC layer -- Pimple is now a
|
||||
deprecated alias which will be removed in Pimple 3.0)
|
||||
* added Pimple\ServiceProviderInterface (and Pimple::register())
|
||||
|
||||
* 2.0.0 (2014-02-10)
|
||||
|
||||
* changed extend to automatically re-assign the extended service and keep it as shared or factory
|
||||
(to keep BC, extend still returns the extended service)
|
||||
* changed services to be shared by default (use factory() for factory
|
||||
services)
|
||||
|
||||
* 1.0.0
|
||||
|
||||
* initial version
|
|
@ -1,326 +0,0 @@
|
|||
Pimple
|
||||
======
|
||||
|
||||
.. caution::
|
||||
|
||||
This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read
|
||||
the `Pimple 1.x documentation`_. Reading the Pimple 1.x code is also a good
|
||||
way to learn more about how to create a simple Dependency Injection
|
||||
Container (recent versions of Pimple are more focused on performance).
|
||||
|
||||
Pimple is a small Dependency Injection Container for PHP.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Before using Pimple in your project, add it to your ``composer.json`` file:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./composer.phar require pimple/pimple "^3.0"
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Creating a container is a matter of creating a ``Container`` instance:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Pimple\Container;
|
||||
|
||||
$container = new Container();
|
||||
|
||||
As many other dependency injection containers, Pimple manages two different
|
||||
kind of data: **services** and **parameters**.
|
||||
|
||||
Defining Services
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
A service is an object that does something as part of a larger system. Examples
|
||||
of services: a database connection, a templating engine, or a mailer. Almost
|
||||
any **global** object can be a service.
|
||||
|
||||
Services are defined by **anonymous functions** that return an instance of an
|
||||
object:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// define some services
|
||||
$container['session_storage'] = function ($c) {
|
||||
return new SessionStorage('SESSION_ID');
|
||||
};
|
||||
|
||||
$container['session'] = function ($c) {
|
||||
return new Session($c['session_storage']);
|
||||
};
|
||||
|
||||
Notice that the anonymous function has access to the current container
|
||||
instance, allowing references to other services or parameters.
|
||||
|
||||
As objects are only created when you get them, the order of the definitions
|
||||
does not matter.
|
||||
|
||||
Using the defined services is also very easy:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// get the session object
|
||||
$session = $container['session'];
|
||||
|
||||
// the above call is roughly equivalent to the following code:
|
||||
// $storage = new SessionStorage('SESSION_ID');
|
||||
// $session = new Session($storage);
|
||||
|
||||
Defining Factory Services
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
By default, each time you get a service, Pimple returns the **same instance**
|
||||
of it. If you want a different instance to be returned for all calls, wrap your
|
||||
anonymous function with the ``factory()`` method
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$container['session'] = $container->factory(function ($c) {
|
||||
return new Session($c['session_storage']);
|
||||
});
|
||||
|
||||
Now, each call to ``$container['session']`` returns a new instance of the
|
||||
session.
|
||||
|
||||
Defining Parameters
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Defining a parameter allows to ease the configuration of your container from
|
||||
the outside and to store global values:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// define some parameters
|
||||
$container['cookie_name'] = 'SESSION_ID';
|
||||
$container['session_storage_class'] = 'SessionStorage';
|
||||
|
||||
If you change the ``session_storage`` service definition like below:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$container['session_storage'] = function ($c) {
|
||||
return new $c['session_storage_class']($c['cookie_name']);
|
||||
};
|
||||
|
||||
You can now easily change the cookie name by overriding the
|
||||
``cookie_name`` parameter instead of redefining the service
|
||||
definition.
|
||||
|
||||
Protecting Parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Because Pimple sees anonymous functions as service definitions, you need to
|
||||
wrap anonymous functions with the ``protect()`` method to store them as
|
||||
parameters:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$container['random_func'] = $container->protect(function () {
|
||||
return rand();
|
||||
});
|
||||
|
||||
Modifying Services after Definition
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In some cases you may want to modify a service definition after it has been
|
||||
defined. You can use the ``extend()`` method to define additional code to be
|
||||
run on your service just after it is created:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$container['session_storage'] = function ($c) {
|
||||
return new $c['session_storage_class']($c['cookie_name']);
|
||||
};
|
||||
|
||||
$container->extend('session_storage', function ($storage, $c) {
|
||||
$storage->...();
|
||||
|
||||
return $storage;
|
||||
});
|
||||
|
||||
The first argument is the name of the service to extend, the second a function
|
||||
that gets access to the object instance and the container.
|
||||
|
||||
Extending a Container
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you use the same libraries over and over, you might want to reuse some
|
||||
services from one project to the next one; package your services into a
|
||||
**provider** by implementing ``Pimple\ServiceProviderInterface``:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Pimple\Container;
|
||||
|
||||
class FooProvider implements Pimple\ServiceProviderInterface
|
||||
{
|
||||
public function register(Container $pimple)
|
||||
{
|
||||
// register some services and parameters
|
||||
// on $pimple
|
||||
}
|
||||
}
|
||||
|
||||
Then, register the provider on a Container:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$pimple->register(new FooProvider());
|
||||
|
||||
Fetching the Service Creation Function
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When you access an object, Pimple automatically calls the anonymous function
|
||||
that you defined, which creates the service object for you. If you want to get
|
||||
raw access to this function, you can use the ``raw()`` method:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$container['session'] = function ($c) {
|
||||
return new Session($c['session_storage']);
|
||||
};
|
||||
|
||||
$sessionFunction = $container->raw('session');
|
||||
|
||||
PSR-11 compatibility
|
||||
--------------------
|
||||
|
||||
For historical reasons, the ``Container`` class does not implement the PSR-11
|
||||
``ContainerInterface``. However, Pimple provides a helper class that will let
|
||||
you decouple your code from the Pimple container class.
|
||||
|
||||
The PSR-11 container class
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``Pimple\Psr11\Container`` class lets you access the content of an
|
||||
underlying Pimple container using ``Psr\Container\ContainerInterface``
|
||||
methods:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Pimple\Container;
|
||||
use Pimple\Psr11\Container as PsrContainer;
|
||||
|
||||
$container = new Container();
|
||||
$container['service'] = function ($c) {
|
||||
return new Service();
|
||||
};
|
||||
$psr11 = new PsrContainer($container);
|
||||
|
||||
$controller = function (PsrContainer $container) {
|
||||
$service = $container->get('service');
|
||||
};
|
||||
$controller($psr11);
|
||||
|
||||
Using the PSR-11 ServiceLocator
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sometimes, a service needs access to several other services without being sure
|
||||
that all of them will actually be used. In those cases, you may want the
|
||||
instantiation of the services to be lazy.
|
||||
|
||||
The traditional solution is to inject the entire service container to get only
|
||||
the services really needed. However, this is not recommended because it gives
|
||||
services a too broad access to the rest of the application and it hides their
|
||||
actual dependencies.
|
||||
|
||||
The ``ServiceLocator`` is intended to solve this problem by giving access to a
|
||||
set of predefined services while instantiating them only when actually needed.
|
||||
|
||||
It also allows you to make your services available under a different name than
|
||||
the one used to register them. For instance, you may want to use an object
|
||||
that expects an instance of ``EventDispatcherInterface`` to be available under
|
||||
the name ``event_dispatcher`` while your event dispatcher has been
|
||||
registered under the name ``dispatcher``:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Monolog\Logger;
|
||||
use Pimple\Psr11\ServiceLocator;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
|
||||
class MyService
|
||||
{
|
||||
/**
|
||||
* "logger" must be an instance of Psr\Log\LoggerInterface
|
||||
* "event_dispatcher" must be an instance of Symfony\Component\EventDispatcher\EventDispatcherInterface
|
||||
*/
|
||||
private $services;
|
||||
|
||||
public function __construct(ContainerInterface $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
}
|
||||
|
||||
$container['logger'] = function ($c) {
|
||||
return new Monolog\Logger();
|
||||
};
|
||||
$container['dispatcher'] = function () {
|
||||
return new EventDispatcher();
|
||||
};
|
||||
|
||||
$container['service'] = function ($c) {
|
||||
$locator = new ServiceLocator($c, array('logger', 'event_dispatcher' => 'dispatcher'));
|
||||
|
||||
return new MyService($locator);
|
||||
};
|
||||
|
||||
Referencing a Collection of Services Lazily
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Passing a collection of services instances in an array may prove inefficient
|
||||
if the class that consumes the collection only needs to iterate over it at a
|
||||
later stage, when one of its method is called. It can also lead to problems
|
||||
if there is a circular dependency between one of the services stored in the
|
||||
collection and the class that consumes it.
|
||||
|
||||
The ``ServiceIterator`` class helps you solve these issues. It receives a
|
||||
list of service names during instantiation and will retrieve the services
|
||||
when iterated over:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Pimple\Container;
|
||||
use Pimple\ServiceIterator;
|
||||
|
||||
class AuthorizationService
|
||||
{
|
||||
private $voters;
|
||||
|
||||
public function __construct($voters)
|
||||
{
|
||||
$this->voters = $voters;
|
||||
}
|
||||
|
||||
public function canAccess($resource)
|
||||
{
|
||||
foreach ($this->voters as $voter) {
|
||||
if (true === $voter->canAccess($resource) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$container = new Container();
|
||||
|
||||
$container['voter1'] = function ($c) {
|
||||
return new SomeVoter();
|
||||
}
|
||||
$container['voter2'] = function ($c) {
|
||||
return new SomeOtherVoter($c['auth']);
|
||||
}
|
||||
$container['auth'] = function ($c) {
|
||||
return new AuthorizationService(new ServiceIterator($c, array('voter1', 'voter2'));
|
||||
}
|
||||
|
||||
.. _Pimple 1.x documentation: https://github.com/silexphp/Pimple/tree/1.1
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"name": "pimple/pimple",
|
||||
"type": "library",
|
||||
"description": "Pimple, a simple Dependency Injection Container",
|
||||
"keywords": ["dependency injection", "container"],
|
||||
"homepage": "http://pimple.sensiolabs.org",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^3.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Pimple": "src/" }
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
*.sw*
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.fragments
|
||||
Makefile.global
|
||||
Makefile.objects
|
||||
acinclude.m4
|
||||
aclocal.m4
|
||||
build/
|
||||
config.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.nice
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
configure.in
|
||||
install-sh
|
||||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
run-tests.php
|
||||
*.loT
|
||||
.libs/
|
||||
modules/
|
||||
*.la
|
||||
*.lo
|
|
@ -1,12 +0,0 @@
|
|||
This is Pimple 2 implemented in C
|
||||
|
||||
* PHP >= 5.3
|
||||
* Not tested under Windows, might work
|
||||
|
||||
Install
|
||||
=======
|
||||
|
||||
> phpize
|
||||
> ./configure
|
||||
> make
|
||||
> make install
|
|
@ -1,63 +0,0 @@
|
|||
dnl $Id$
|
||||
dnl config.m4 for extension pimple
|
||||
|
||||
dnl Comments in this file start with the string 'dnl'.
|
||||
dnl Remove where necessary. This file will not work
|
||||
dnl without editing.
|
||||
|
||||
dnl If your extension references something external, use with:
|
||||
|
||||
dnl PHP_ARG_WITH(pimple, for pimple support,
|
||||
dnl Make sure that the comment is aligned:
|
||||
dnl [ --with-pimple Include pimple support])
|
||||
|
||||
dnl Otherwise use enable:
|
||||
|
||||
PHP_ARG_ENABLE(pimple, whether to enable pimple support,
|
||||
dnl Make sure that the comment is aligned:
|
||||
[ --enable-pimple Enable pimple support])
|
||||
|
||||
if test "$PHP_PIMPLE" != "no"; then
|
||||
dnl Write more examples of tests here...
|
||||
|
||||
dnl # --with-pimple -> check with-path
|
||||
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
|
||||
dnl SEARCH_FOR="/include/pimple.h" # you most likely want to change this
|
||||
dnl if test -r $PHP_PIMPLE/$SEARCH_FOR; then # path given as parameter
|
||||
dnl PIMPLE_DIR=$PHP_PIMPLE
|
||||
dnl else # search default path list
|
||||
dnl AC_MSG_CHECKING([for pimple files in default path])
|
||||
dnl for i in $SEARCH_PATH ; do
|
||||
dnl if test -r $i/$SEARCH_FOR; then
|
||||
dnl PIMPLE_DIR=$i
|
||||
dnl AC_MSG_RESULT(found in $i)
|
||||
dnl fi
|
||||
dnl done
|
||||
dnl fi
|
||||
dnl
|
||||
dnl if test -z "$PIMPLE_DIR"; then
|
||||
dnl AC_MSG_RESULT([not found])
|
||||
dnl AC_MSG_ERROR([Please reinstall the pimple distribution])
|
||||
dnl fi
|
||||
|
||||
dnl # --with-pimple -> add include path
|
||||
dnl PHP_ADD_INCLUDE($PIMPLE_DIR/include)
|
||||
|
||||
dnl # --with-pimple -> check for lib and symbol presence
|
||||
dnl LIBNAME=pimple # you may want to change this
|
||||
dnl LIBSYMBOL=pimple # you most likely want to change this
|
||||
|
||||
dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
|
||||
dnl [
|
||||
dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PIMPLE_DIR/lib, PIMPLE_SHARED_LIBADD)
|
||||
dnl AC_DEFINE(HAVE_PIMPLELIB,1,[ ])
|
||||
dnl ],[
|
||||
dnl AC_MSG_ERROR([wrong pimple lib version or lib not found])
|
||||
dnl ],[
|
||||
dnl -L$PIMPLE_DIR/lib -lm
|
||||
dnl ])
|
||||
dnl
|
||||
dnl PHP_SUBST(PIMPLE_SHARED_LIBADD)
|
||||
|
||||
PHP_NEW_EXTENSION(pimple, pimple.c, $ext_shared)
|
||||
fi
|
|
@ -1,13 +0,0 @@
|
|||
// $Id$
|
||||
// vim:ft=javascript
|
||||
|
||||
// If your extension references something external, use ARG_WITH
|
||||
// ARG_WITH("pimple", "for pimple support", "no");
|
||||
|
||||
// Otherwise, use ARG_ENABLE
|
||||
// ARG_ENABLE("pimple", "enable pimple support", "no");
|
||||
|
||||
if (PHP_PIMPLE != "no") {
|
||||
EXTENSION("pimple", "pimple.c");
|
||||
}
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2014 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PHP_PIMPLE_H
|
||||
#define PHP_PIMPLE_H
|
||||
|
||||
extern zend_module_entry pimple_module_entry;
|
||||
#define phpext_pimple_ptr &pimple_module_entry
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# define PHP_PIMPLE_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_PIMPLE_API __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_PIMPLE_API
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
||||
#define PIMPLE_VERSION "3.2.3-DEV"
|
||||
|
||||
#define PIMPLE_NS "Pimple"
|
||||
#define PSR_CONTAINER_NS "Psr\\Container"
|
||||
#define PIMPLE_EXCEPTION_NS "Pimple\\Exception"
|
||||
|
||||
#define PIMPLE_DEFAULT_ZVAL_CACHE_NUM 5
|
||||
#define PIMPLE_DEFAULT_ZVAL_VALUES_NUM 10
|
||||
|
||||
#define PIMPLE_DEPRECATE do { \
|
||||
int er = EG(error_reporting); \
|
||||
EG(error_reporting) = 0;\
|
||||
php_error(E_DEPRECATED, "The Pimple C extension is deprecated since version 3.1 and will be removed in 4.0."); \
|
||||
EG(error_reporting) = er; \
|
||||
} while (0);
|
||||
|
||||
zend_module_entry *get_module(void);
|
||||
|
||||
PHP_MINIT_FUNCTION(pimple);
|
||||
PHP_MINFO_FUNCTION(pimple);
|
||||
|
||||
PHP_METHOD(FrozenServiceException, __construct);
|
||||
PHP_METHOD(InvalidServiceIdentifierException, __construct);
|
||||
PHP_METHOD(UnknownIdentifierException, __construct);
|
||||
|
||||
PHP_METHOD(Pimple, __construct);
|
||||
PHP_METHOD(Pimple, factory);
|
||||
PHP_METHOD(Pimple, protect);
|
||||
PHP_METHOD(Pimple, raw);
|
||||
PHP_METHOD(Pimple, extend);
|
||||
PHP_METHOD(Pimple, keys);
|
||||
PHP_METHOD(Pimple, register);
|
||||
PHP_METHOD(Pimple, offsetSet);
|
||||
PHP_METHOD(Pimple, offsetUnset);
|
||||
PHP_METHOD(Pimple, offsetGet);
|
||||
PHP_METHOD(Pimple, offsetExists);
|
||||
|
||||
PHP_METHOD(PimpleClosure, invoker);
|
||||
|
||||
typedef struct _pimple_bucket_value {
|
||||
zval *value; /* Must be the first element */
|
||||
zval *raw;
|
||||
zend_object_handle handle_num;
|
||||
enum {
|
||||
PIMPLE_IS_PARAM = 0,
|
||||
PIMPLE_IS_SERVICE = 2
|
||||
} type;
|
||||
zend_bool initialized;
|
||||
zend_fcall_info_cache fcc;
|
||||
} pimple_bucket_value;
|
||||
|
||||
typedef struct _pimple_object {
|
||||
zend_object zobj;
|
||||
HashTable values;
|
||||
HashTable factories;
|
||||
HashTable protected;
|
||||
} pimple_object;
|
||||
|
||||
typedef struct _pimple_closure_object {
|
||||
zend_object zobj;
|
||||
zval *callable;
|
||||
zval *factory;
|
||||
} pimple_closure_object;
|
||||
|
||||
static const char sensiolabs_logo[] = "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAUCAMAAABvRTlyAAAAz1BMVEUAAAAAAAAAAAAsThWB5j4AAACD6T8AAACC6D+C6D6C6D+C6D4AAAAAAACC6D4AAAAAAACC6D8AAAAAAAAAAAAAAAAAAAAAAACC6D4AAAAAAAAAAACC6D4AAAAAAAAAAAAAAAAAAAAAAACC6D8AAACC6D4AAAAAAAAAAAAAAAAAAACC6D8AAACC6D6C6D+B6D+C6D+C6D+C6D8AAACC6D6C6D4AAACC6D/K/2KC6D+B6D6C6D6C6D+C6D8sTxUyWRhEeiEAAACC6D+C5z6B6D7drnEVAAAAQXRSTlMAE3oCNSUuDHFHzxaF9UFsu+irX+zlKzYimaJXktyOSFD6BolxqT7QGMMdarMIpuO28r9EolXKgR16OphfXYd4V14GtB4AAAMpSURBVEjHvVSJctowEF1jjME2RziMwUCoMfd9heZqG4n//6buLpJjkmYm03byZmxJa2nf6u2uQcG2bfhqRN4LoTKBzyGDm68M7mAwcOEdjo4zhA/Rf9Go/CVtTgiRhXfIC3EDH8F/eUX1/9KexRo+QgOdtHDsEe/sM7QT32/+K61Z1LFXcXJxN4pTbu1aTQUzuy2PIA0rDo0/0Aa5XFaJvKaVTrubywXvaa1Wq4Vu/Snr3Y7Aojh4VccwykW2N2oQ8wmjyut6+Q1t5ywIG5Npj1sh5E0B7YOzFDjfuRfaOh3O+MbbVNfTWS9COZk3Obd2su5d0a6IU9KLREbw8gEehWSr1r2sPWciXLG38r5NdW0xu9eioU87omjC9yNaMi5GNf6WppVSOqXCFkmCvMB3p9SROLoYQn5pDgQOujA1xjYvqH+plUdkwnmII8VxR/PKYkrfLLomhVlE3b/LhNbNr7hp0H2JaOc4v8dFB58HSsFTSafaqtY1sT3GO8wsy5rhokYPlRJdjPMajyYqTt1EHF/2uqSWQWmAjCUSmQ1MS3g8Btf1XOsy7YIC0CB1b5Xw1Vhba0zbxiCAQLH9TNPmHJXQUtJAN0KcDsoqLxsNvJrJExa7mKIdp2lRE2WexiS4pqWk/0jROlw6K6bV9YOBDGAuqMJ0bnuUKGB0L27bxgRhGEbzihbhxxXaQC88Vkwq8ldCi86RApWUb0Q+4VDosBCc+1s81lUdnBavH4Zp2mm3O44USwOfvSo9oBiwpFg71lMS1VKJLKljS3j9p+fOTvXXlsSNuEv6YPaZda9uRope0VJfKdo7fPiYfSmvFjXQbkhY0d9hCbBWIktRgEDieDhf1N3wbbkmNNgRy8hyl620yGQat/grV3HMpc2HDKTVmOPFz6ylPCKt/nXcAyV260jaAowwIW0YuBzrOgb/KrddZS9OmJaLgpWK4JX2DDuklcLZSDGcn8Vmx9YDNvT6UsjyBApRyFQVX7Vxm9TGxE16nmfRd8/zQoDmggQOTRh5Hv8pMt9Q/L2JmSwkMCE7dA4BuDjHJwfu0Om4QAhOjrN5XkIatglfiN/bUPdCQFjTYgAAAABJRU5ErkJggg==\">";
|
||||
|
||||
static void pimple_exception_call_parent_constructor(zval *this_ptr, const char *format, const char *arg1 TSRMLS_DC);
|
||||
|
||||
static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC);
|
||||
static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC);
|
||||
|
||||
static void pimple_bucket_dtor(pimple_bucket_value *bucket);
|
||||
static void pimple_free_bucket(pimple_bucket_value *bucket);
|
||||
|
||||
static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
|
||||
static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC);
|
||||
static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC);
|
||||
static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC);
|
||||
static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC);
|
||||
static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC);
|
||||
|
||||
static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC);
|
||||
static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC);
|
||||
static zend_function *pimple_closure_get_constructor(zval * TSRMLS_DC);
|
||||
static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
|
||||
|
||||
#ifdef ZTS
|
||||
#define PIMPLE_G(v) TSRMG(pimple_globals_id, zend_pimple_globals *, v)
|
||||
#else
|
||||
#define PIMPLE_G(v) (pimple_globals.v)
|
||||
#endif
|
||||
|
||||
#endif /* PHP_PIMPLE_H */
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,81 +0,0 @@
|
|||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2014 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PIMPLE_COMPAT_H_
|
||||
#define PIMPLE_COMPAT_H_
|
||||
|
||||
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
|
||||
|
||||
#define PHP_5_0_X_API_NO 220040412
|
||||
#define PHP_5_1_X_API_NO 220051025
|
||||
#define PHP_5_2_X_API_NO 220060519
|
||||
#define PHP_5_3_X_API_NO 220090626
|
||||
#define PHP_5_4_X_API_NO 220100525
|
||||
#define PHP_5_5_X_API_NO 220121212
|
||||
#define PHP_5_6_X_API_NO 220131226
|
||||
|
||||
#define IS_PHP_56 ZEND_EXTENSION_API_NO == PHP_5_6_X_API_NO
|
||||
#define IS_AT_LEAST_PHP_56 ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO
|
||||
|
||||
#define IS_PHP_55 ZEND_EXTENSION_API_NO == PHP_5_5_X_API_NO
|
||||
#define IS_AT_LEAST_PHP_55 ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO
|
||||
|
||||
#define IS_PHP_54 ZEND_EXTENSION_API_NO == PHP_5_4_X_API_NO
|
||||
#define IS_AT_LEAST_PHP_54 ZEND_EXTENSION_API_NO >= PHP_5_4_X_API_NO
|
||||
|
||||
#define IS_PHP_53 ZEND_EXTENSION_API_NO == PHP_5_3_X_API_NO
|
||||
#define IS_AT_LEAST_PHP_53 ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
|
||||
|
||||
#if IS_PHP_53
|
||||
#define object_properties_init(obj, ce) do { \
|
||||
zend_hash_copy(obj->properties, &ce->default_properties, zval_copy_property_ctor(ce), NULL, sizeof(zval *)); \
|
||||
} while (0);
|
||||
#endif
|
||||
|
||||
#define ZEND_OBJ_INIT(obj, ce) do { \
|
||||
zend_object_std_init(obj, ce TSRMLS_CC); \
|
||||
object_properties_init((obj), (ce)); \
|
||||
} while(0);
|
||||
|
||||
#if IS_PHP_53 || IS_PHP_54
|
||||
static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) {
|
||||
Bucket *p;
|
||||
|
||||
p = pos ? (*pos) : ht->pInternalPointer;
|
||||
|
||||
if (!p) {
|
||||
Z_TYPE_P(key) = IS_NULL;
|
||||
} else if (p->nKeyLength) {
|
||||
Z_TYPE_P(key) = IS_STRING;
|
||||
Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1);
|
||||
Z_STRLEN_P(key) = p->nKeyLength - 1;
|
||||
} else {
|
||||
Z_TYPE_P(key) = IS_LONG;
|
||||
Z_LVAL_P(key) = p->h;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PIMPLE_COMPAT_H_ */
|
|
@ -1,45 +0,0 @@
|
|||
--TEST--
|
||||
Test for read_dim/write_dim handlers
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p[42] = 'foo';
|
||||
$p['foo'] = 42;
|
||||
|
||||
echo $p[42];
|
||||
echo "\n";
|
||||
echo $p['foo'];
|
||||
echo "\n";
|
||||
try {
|
||||
var_dump($p['nonexistant']);
|
||||
echo "Exception excpected";
|
||||
} catch (InvalidArgumentException $e) { }
|
||||
|
||||
$p[54.2] = 'foo2';
|
||||
echo $p[54];
|
||||
echo "\n";
|
||||
$p[242.99] = 'foo99';
|
||||
echo $p[242];
|
||||
|
||||
echo "\n";
|
||||
|
||||
$p[5] = 'bar';
|
||||
$p[5] = 'baz';
|
||||
echo $p[5];
|
||||
|
||||
echo "\n";
|
||||
|
||||
$p['str'] = 'str';
|
||||
$p['str'] = 'strstr';
|
||||
echo $p['str'];
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
foo
|
||||
42
|
||||
foo2
|
||||
foo99
|
||||
baz
|
||||
strstr
|
|
@ -1,15 +0,0 @@
|
|||
--TEST--
|
||||
Test for constructor
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
var_dump($p[42]);
|
||||
|
||||
$p = new Pimple\Container(array(42=>'foo'));
|
||||
var_dump($p[42]);
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
string(3) "foo"
|
|
@ -1,16 +0,0 @@
|
|||
--TEST--
|
||||
Test empty dimensions
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p[] = 42;
|
||||
var_dump($p[0]);
|
||||
$p[41] = 'foo';
|
||||
$p[] = 'bar';
|
||||
var_dump($p[42]);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
string(3) "bar"
|
|
@ -1,30 +0,0 @@
|
|||
--TEST--
|
||||
Test has/unset dim handlers
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p[] = 42;
|
||||
var_dump($p[0]);
|
||||
unset($p[0]);
|
||||
var_dump($p[0]);
|
||||
$p['foo'] = 'bar';
|
||||
var_dump(isset($p['foo']));
|
||||
unset($p['foo']);
|
||||
try {
|
||||
var_dump($p['foo']);
|
||||
echo "Excpected exception";
|
||||
} catch (InvalidArgumentException $e) { }
|
||||
var_dump(isset($p['bar']));
|
||||
$p['bar'] = NULL;
|
||||
var_dump(isset($p['bar']));
|
||||
var_dump(empty($p['bar']));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
NULL
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
|
@ -1,27 +0,0 @@
|
|||
--TEST--
|
||||
Test simple class inheritance
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyPimple extends Pimple\Container
|
||||
{
|
||||
public $someAttr = 'fooAttr';
|
||||
|
||||
public function offsetget($o)
|
||||
{
|
||||
var_dump("hit");
|
||||
return parent::offsetget($o);
|
||||
}
|
||||
}
|
||||
|
||||
$p = new MyPimple;
|
||||
$p[42] = 'foo';
|
||||
echo $p[42];
|
||||
echo "\n";
|
||||
echo $p->someAttr;
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "hit"
|
||||
foo
|
||||
fooAttr
|
|
@ -1,51 +0,0 @@
|
|||
--TEST--
|
||||
Test complex class inheritance
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyPimple extends Pimple\Container
|
||||
{
|
||||
public function offsetget($o)
|
||||
{
|
||||
var_dump("hit offsetget in " . __CLASS__);
|
||||
return parent::offsetget($o);
|
||||
}
|
||||
}
|
||||
|
||||
class TestPimple extends MyPimple
|
||||
{
|
||||
public function __construct($values)
|
||||
{
|
||||
array_shift($values);
|
||||
parent::__construct($values);
|
||||
}
|
||||
|
||||
public function offsetget($o)
|
||||
{
|
||||
var_dump('hit offsetget in ' . __CLASS__);
|
||||
return parent::offsetget($o);
|
||||
}
|
||||
|
||||
public function offsetset($o, $v)
|
||||
{
|
||||
var_dump('hit offsetset');
|
||||
return parent::offsetset($o, $v);
|
||||
}
|
||||
}
|
||||
|
||||
$defaultValues = array('foo' => 'bar', 88 => 'baz');
|
||||
|
||||
$p = new TestPimple($defaultValues);
|
||||
$p[42] = 'foo';
|
||||
var_dump($p[42]);
|
||||
var_dump($p[0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(13) "hit offsetset"
|
||||
string(27) "hit offsetget in TestPimple"
|
||||
string(25) "hit offsetget in MyPimple"
|
||||
string(3) "foo"
|
||||
string(27) "hit offsetget in TestPimple"
|
||||
string(25) "hit offsetget in MyPimple"
|
||||
string(3) "baz"
|
|
@ -1,22 +0,0 @@
|
|||
--TEST--
|
||||
Test for read_dim/write_dim handlers
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p[42] = 'foo';
|
||||
$p['foo'] = 42;
|
||||
|
||||
echo $p[42];
|
||||
echo "\n";
|
||||
echo $p['foo'];
|
||||
echo "\n";
|
||||
try {
|
||||
var_dump($p['nonexistant']);
|
||||
echo "Exception excpected";
|
||||
} catch (InvalidArgumentException $e) { }
|
||||
?>
|
||||
--EXPECTF--
|
||||
foo
|
||||
42
|
|
@ -1,29 +0,0 @@
|
|||
--TEST--
|
||||
Test frozen services
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p[42] = 'foo';
|
||||
$p[42] = 'bar';
|
||||
|
||||
$p['foo'] = function () { };
|
||||
$p['foo'] = function () { };
|
||||
|
||||
$a = $p['foo'];
|
||||
|
||||
try {
|
||||
$p['foo'] = function () { };
|
||||
echo "Exception excpected";
|
||||
} catch (RuntimeException $e) { }
|
||||
|
||||
$p[42] = function() { };
|
||||
$a = $p[42];
|
||||
|
||||
try {
|
||||
$p[42] = function () { };
|
||||
echo "Exception excpected";
|
||||
} catch (RuntimeException $e) { }
|
||||
?>
|
||||
--EXPECTF--
|
|
@ -1,13 +0,0 @@
|
|||
--TEST--
|
||||
Test service is called as callback, and only once
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p = new Pimple\Container();
|
||||
$p['foo'] = function($arg) use ($p) { var_dump($p === $arg); };
|
||||
$a = $p['foo'];
|
||||
$b = $p['foo']; /* should return not calling the callback */
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
|
@ -1,45 +0,0 @@
|
|||
--TEST--
|
||||
Test service is called as callback for every callback type
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function callme()
|
||||
{
|
||||
return 'called';
|
||||
}
|
||||
|
||||
$a = function() { return 'called'; };
|
||||
|
||||
class Foo
|
||||
{
|
||||
public static function bar()
|
||||
{
|
||||
return 'called';
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p['foo'] = 'callme';
|
||||
echo $p['foo'] . "\n";
|
||||
|
||||
$p['bar'] = $a;
|
||||
echo $p['bar'] . "\n";
|
||||
|
||||
$p['baz'] = "Foo::bar";
|
||||
echo $p['baz'] . "\n";
|
||||
|
||||
$p['foobar'] = array('Foo', 'bar');
|
||||
var_dump($p['foobar']);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
callme
|
||||
called
|
||||
Foo::bar
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(3) "Foo"
|
||||
[1]=>
|
||||
string(3) "bar"
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
--TEST--
|
||||
Test service callback throwing an exception
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class CallBackException extends RuntimeException { }
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p['foo'] = function () { throw new CallBackException; };
|
||||
try {
|
||||
echo $p['foo'] . "\n";
|
||||
echo "should not come here";
|
||||
} catch (CallBackException $e) {
|
||||
echo "all right!";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
all right!
|
|
@ -1,28 +0,0 @@
|
|||
--TEST--
|
||||
Test service factory
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
|
||||
$p->factory($f = function() { var_dump('called-1'); return 'ret-1';});
|
||||
|
||||
$p[] = $f;
|
||||
|
||||
$p[] = function () { var_dump('called-2'); return 'ret-2'; };
|
||||
|
||||
var_dump($p[0]);
|
||||
var_dump($p[0]);
|
||||
var_dump($p[1]);
|
||||
var_dump($p[1]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(8) "called-1"
|
||||
string(5) "ret-1"
|
||||
string(8) "called-1"
|
||||
string(5) "ret-1"
|
||||
string(8) "called-2"
|
||||
string(5) "ret-2"
|
||||
string(5) "ret-2"
|
|
@ -1,33 +0,0 @@
|
|||
--TEST--
|
||||
Test keys()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
|
||||
var_dump($p->keys());
|
||||
|
||||
$p['foo'] = 'bar';
|
||||
$p[] = 'foo';
|
||||
|
||||
var_dump($p->keys());
|
||||
|
||||
unset($p['foo']);
|
||||
|
||||
var_dump($p->keys());
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(3) "foo"
|
||||
[1]=>
|
||||
int(0)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
--TEST--
|
||||
Test raw()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$f = function () { var_dump('called-2'); return 'ret-2'; };
|
||||
|
||||
$p['foo'] = $f;
|
||||
$p[42] = $f;
|
||||
|
||||
var_dump($p['foo']);
|
||||
var_dump($p->raw('foo'));
|
||||
var_dump($p[42]);
|
||||
|
||||
unset($p['foo']);
|
||||
|
||||
try {
|
||||
$p->raw('foo');
|
||||
echo "expected exception";
|
||||
} catch (InvalidArgumentException $e) { }
|
||||
--EXPECTF--
|
||||
string(8) "called-2"
|
||||
string(5) "ret-2"
|
||||
object(Closure)#%i (0) {
|
||||
}
|
||||
string(8) "called-2"
|
||||
string(5) "ret-2"
|
|
@ -1,17 +0,0 @@
|
|||
--TEST--
|
||||
Test protect()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$f = function () { return 'foo'; };
|
||||
$p['foo'] = $f;
|
||||
|
||||
$p->protect($f);
|
||||
|
||||
var_dump($p['foo']);
|
||||
--EXPECTF--
|
||||
object(Closure)#%i (0) {
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
--TEST--
|
||||
Test extend()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
This is part of Pimple::extend() code :
|
||||
|
||||
$extended = function ($c) use ($callable, $factory) {
|
||||
return $callable($factory($c), $c);
|
||||
};
|
||||
*/
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p[12] = function ($v) { var_dump($v); return 'foo';}; /* $factory in code above */
|
||||
|
||||
$c = $p->extend(12, function ($w) { var_dump($w); return 'bar'; }); /* $callable in code above */
|
||||
|
||||
var_dump($c('param'));
|
||||
--EXPECTF--
|
||||
string(5) "param"
|
||||
string(3) "foo"
|
||||
string(3) "bar"
|
|
@ -1,17 +0,0 @@
|
|||
--TEST--
|
||||
Test extend() with exception in service extension
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p[12] = function ($v) { return 'foo';};
|
||||
|
||||
$c = $p->extend(12, function ($w) { throw new BadMethodCallException; });
|
||||
|
||||
try {
|
||||
$p[12];
|
||||
echo "Exception expected";
|
||||
} catch (BadMethodCallException $e) { }
|
||||
--EXPECTF--
|
|
@ -1,17 +0,0 @@
|
|||
--TEST--
|
||||
Test extend() with exception in service factory
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p[12] = function ($v) { throw new BadMethodCallException; };
|
||||
|
||||
$c = $p->extend(12, function ($w) { return 'foobar'; });
|
||||
|
||||
try {
|
||||
$p[12];
|
||||
echo "Exception expected";
|
||||
} catch (BadMethodCallException $e) { }
|
||||
--EXPECTF--
|
|
@ -1,23 +0,0 @@
|
|||
--TEST--
|
||||
Test register()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo implements Pimple\ServiceProviderInterface
|
||||
{
|
||||
public function register(Pimple\Container $p)
|
||||
{
|
||||
var_dump($p);
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Pimple\Container();
|
||||
$p->register(new Foo, array(42 => 'bar'));
|
||||
|
||||
var_dump($p[42]);
|
||||
--EXPECTF--
|
||||
object(Pimple\Container)#1 (0) {
|
||||
}
|
||||
string(3) "bar"
|
|
@ -1,18 +0,0 @@
|
|||
--TEST--
|
||||
Test register() returns static and is a fluent interface
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("pimple")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo implements Pimple\ServiceProviderInterface
|
||||
{
|
||||
public function register(Pimple\Container $p)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Pimple\Container();
|
||||
var_dump($p === $p->register(new Foo));
|
||||
--EXPECTF--
|
||||
bool(true)
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('Pimple\Container')) {
|
||||
require_once __DIR__ . '/../../../src/Pimple/Container.php';
|
||||
} else {
|
||||
echo "pimple-c extension detected, using...\n\n";
|
||||
}
|
||||
|
||||
$time = microtime(true);
|
||||
|
||||
function foo() { }
|
||||
$factory = function () { };
|
||||
|
||||
for ($i=0; $i<10000; $i++) {
|
||||
|
||||
$p = new Pimple\Container;
|
||||
|
||||
$p['foo'] = 'bar';
|
||||
|
||||
if (!isset($p[3])) {
|
||||
$p[3] = $p['foo'];
|
||||
$p[] = 'bar';
|
||||
}
|
||||
|
||||
$p[2] = 42;
|
||||
|
||||
if (isset($p[2])) {
|
||||
unset($p[2]);
|
||||
}
|
||||
|
||||
$p[42] = $p['foo'];
|
||||
|
||||
$p['cb'] = function($arg) { };
|
||||
|
||||
$p[] = $p['cb'];
|
||||
|
||||
echo $p['cb'];
|
||||
echo $p['cb'];
|
||||
echo $p['cb'];
|
||||
|
||||
//$p->factory($factory);
|
||||
|
||||
$p['factory'] = $factory;
|
||||
|
||||
echo $p['factory'];
|
||||
echo $p['factory'];
|
||||
echo $p['factory'];
|
||||
|
||||
}
|
||||
|
||||
echo microtime(true) - $time;
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('Pimple\Container')) {
|
||||
require_once __DIR__ . '/../../../src/Pimple/Container.php';
|
||||
} else {
|
||||
echo "pimple-c extension detected, using...\n\n";
|
||||
}
|
||||
|
||||
$time = microtime(true);
|
||||
|
||||
|
||||
$service = function ($arg) { return "I'm a service"; };
|
||||
|
||||
for ($i=0; $i<10000; $i++) {
|
||||
|
||||
$p = new Pimple\Container;
|
||||
$p['my_service'] = $service;
|
||||
|
||||
$a = $p['my_service'];
|
||||
$b = $p['my_service'];
|
||||
|
||||
}
|
||||
|
||||
echo microtime(true) - $time;
|
||||
?>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Pimple Test Suite">
|
||||
<directory>./src/Pimple/Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
|
@ -1,298 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple;
|
||||
|
||||
use Pimple\Exception\ExpectedInvokableException;
|
||||
use Pimple\Exception\FrozenServiceException;
|
||||
use Pimple\Exception\InvalidServiceIdentifierException;
|
||||
use Pimple\Exception\UnknownIdentifierException;
|
||||
|
||||
/**
|
||||
* Container main class.
|
||||
*
|
||||
* @author Fabien Potencier
|
||||
*/
|
||||
class Container implements \ArrayAccess
|
||||
{
|
||||
private $values = array();
|
||||
private $factories;
|
||||
private $protected;
|
||||
private $frozen = array();
|
||||
private $raw = array();
|
||||
private $keys = array();
|
||||
|
||||
/**
|
||||
* Instantiates the container.
|
||||
*
|
||||
* Objects and parameters can be passed as argument to the constructor.
|
||||
*
|
||||
* @param array $values The parameters or objects
|
||||
*/
|
||||
public function __construct(array $values = array())
|
||||
{
|
||||
$this->factories = new \SplObjectStorage();
|
||||
$this->protected = new \SplObjectStorage();
|
||||
|
||||
foreach ($values as $key => $value) {
|
||||
$this->offsetSet($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a parameter or an object.
|
||||
*
|
||||
* Objects must be defined as Closures.
|
||||
*
|
||||
* Allowing any PHP callable leads to difficult to debug problems
|
||||
* as function names (strings) are callable (creating a function with
|
||||
* the same name as an existing parameter would break your container).
|
||||
*
|
||||
* @param string $id The unique identifier for the parameter or object
|
||||
* @param mixed $value The value of the parameter or a closure to define an object
|
||||
*
|
||||
* @throws FrozenServiceException Prevent override of a frozen service
|
||||
*/
|
||||
public function offsetSet($id, $value)
|
||||
{
|
||||
if (isset($this->frozen[$id])) {
|
||||
throw new FrozenServiceException($id);
|
||||
}
|
||||
|
||||
$this->values[$id] = $value;
|
||||
$this->keys[$id] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a parameter or an object.
|
||||
*
|
||||
* @param string $id The unique identifier for the parameter or object
|
||||
*
|
||||
* @return mixed The value of the parameter or an object
|
||||
*
|
||||
* @throws UnknownIdentifierException If the identifier is not defined
|
||||
*/
|
||||
public function offsetGet($id)
|
||||
{
|
||||
if (!isset($this->keys[$id])) {
|
||||
throw new UnknownIdentifierException($id);
|
||||
}
|
||||
|
||||
if (
|
||||
isset($this->raw[$id])
|
||||
|| !\is_object($this->values[$id])
|
||||
|| isset($this->protected[$this->values[$id]])
|
||||
|| !\method_exists($this->values[$id], '__invoke')
|
||||
) {
|
||||
return $this->values[$id];
|
||||
}
|
||||
|
||||
if (isset($this->factories[$this->values[$id]])) {
|
||||
return $this->values[$id]($this);
|
||||
}
|
||||
|
||||
$raw = $this->values[$id];
|
||||
$val = $this->values[$id] = $raw($this);
|
||||
$this->raw[$id] = $raw;
|
||||
|
||||
$this->frozen[$id] = true;
|
||||
|
||||
return $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a parameter or an object is set.
|
||||
*
|
||||
* @param string $id The unique identifier for the parameter or object
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($id)
|
||||
{
|
||||
return isset($this->keys[$id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets a parameter or an object.
|
||||
*
|
||||
* @param string $id The unique identifier for the parameter or object
|
||||
*/
|
||||
public function offsetUnset($id)
|
||||
{
|
||||
if (isset($this->keys[$id])) {
|
||||
if (\is_object($this->values[$id])) {
|
||||
unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]);
|
||||
}
|
||||
|
||||
unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks a callable as being a factory service.
|
||||
*
|
||||
* @param callable $callable A service definition to be used as a factory
|
||||
*
|
||||
* @return callable The passed callable
|
||||
*
|
||||
* @throws ExpectedInvokableException Service definition has to be a closure or an invokable object
|
||||
*/
|
||||
public function factory($callable)
|
||||
{
|
||||
if (!\method_exists($callable, '__invoke')) {
|
||||
throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.');
|
||||
}
|
||||
|
||||
$this->factories->attach($callable);
|
||||
|
||||
return $callable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protects a callable from being interpreted as a service.
|
||||
*
|
||||
* This is useful when you want to store a callable as a parameter.
|
||||
*
|
||||
* @param callable $callable A callable to protect from being evaluated
|
||||
*
|
||||
* @return callable The passed callable
|
||||
*
|
||||
* @throws ExpectedInvokableException Service definition has to be a closure or an invokable object
|
||||
*/
|
||||
public function protect($callable)
|
||||
{
|
||||
if (!\method_exists($callable, '__invoke')) {
|
||||
throw new ExpectedInvokableException('Callable is not a Closure or invokable object.');
|
||||
}
|
||||
|
||||
$this->protected->attach($callable);
|
||||
|
||||
return $callable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a parameter or the closure defining an object.
|
||||
*
|
||||
* @param string $id The unique identifier for the parameter or object
|
||||
*
|
||||
* @return mixed The value of the parameter or the closure defining an object
|
||||
*
|
||||
* @throws UnknownIdentifierException If the identifier is not defined
|
||||
*/
|
||||
public function raw($id)
|
||||
{
|
||||
if (!isset($this->keys[$id])) {
|
||||
throw new UnknownIdentifierException($id);
|
||||
}
|
||||
|
||||
if (isset($this->raw[$id])) {
|
||||
return $this->raw[$id];
|
||||
}
|
||||
|
||||
return $this->values[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends an object definition.
|
||||
*
|
||||
* Useful when you want to extend an existing object definition,
|
||||
* without necessarily loading that object.
|
||||
*
|
||||
* @param string $id The unique identifier for the object
|
||||
* @param callable $callable A service definition to extend the original
|
||||
*
|
||||
* @return callable The wrapped callable
|
||||
*
|
||||
* @throws UnknownIdentifierException If the identifier is not defined
|
||||
* @throws FrozenServiceException If the service is frozen
|
||||
* @throws InvalidServiceIdentifierException If the identifier belongs to a parameter
|
||||
* @throws ExpectedInvokableException If the extension callable is not a closure or an invokable object
|
||||
*/
|
||||
public function extend($id, $callable)
|
||||
{
|
||||
if (!isset($this->keys[$id])) {
|
||||
throw new UnknownIdentifierException($id);
|
||||
}
|
||||
|
||||
if (isset($this->frozen[$id])) {
|
||||
throw new FrozenServiceException($id);
|
||||
}
|
||||
|
||||
if (!\is_object($this->values[$id]) || !\method_exists($this->values[$id], '__invoke')) {
|
||||
throw new InvalidServiceIdentifierException($id);
|
||||
}
|
||||
|
||||
if (isset($this->protected[$this->values[$id]])) {
|
||||
@\trigger_error(\sprintf('How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "%s" should be protected?', $id), \E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (!\is_object($callable) || !\method_exists($callable, '__invoke')) {
|
||||
throw new ExpectedInvokableException('Extension service definition is not a Closure or invokable object.');
|
||||
}
|
||||
|
||||
$factory = $this->values[$id];
|
||||
|
||||
$extended = function ($c) use ($callable, $factory) {
|
||||
return $callable($factory($c), $c);
|
||||
};
|
||||
|
||||
if (isset($this->factories[$factory])) {
|
||||
$this->factories->detach($factory);
|
||||
$this->factories->attach($extended);
|
||||
}
|
||||
|
||||
return $this[$id] = $extended;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all defined value names.
|
||||
*
|
||||
* @return array An array of value names
|
||||
*/
|
||||
public function keys()
|
||||
{
|
||||
return \array_keys($this->values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a service provider.
|
||||
*
|
||||
* @param ServiceProviderInterface $provider A ServiceProviderInterface instance
|
||||
* @param array $values An array of values that customizes the provider
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function register(ServiceProviderInterface $provider, array $values = array())
|
||||
{
|
||||
$provider->register($this);
|
||||
|
||||
foreach ($values as $key => $value) {
|
||||
$this[$key] = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Exception;
|
||||
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
|
||||
/**
|
||||
* A closure or invokable object was expected.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface
|
||||
{
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Exception;
|
||||
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
|
||||
/**
|
||||
* An attempt to modify a frozen service was made.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class FrozenServiceException extends \RuntimeException implements ContainerExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $id Identifier of the frozen service
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
parent::__construct(\sprintf('Cannot override frozen service "%s".', $id));
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Exception;
|
||||
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* An attempt to perform an operation that requires a service identifier was made.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class InvalidServiceIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $id The invalid identifier
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
parent::__construct(\sprintf('Identifier "%s" does not contain an object definition.', $id));
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Exception;
|
||||
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* The identifier of a valid service or parameter was expected.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class UnknownIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $id The unknown identifier
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
parent::__construct(\sprintf('Identifier "%s" is not defined.', $id));
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009-2017 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Psr11;
|
||||
|
||||
use Pimple\Container as PimpleContainer;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* PSR-11 compliant wrapper.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
final class Container implements ContainerInterface
|
||||
{
|
||||
private $pimple;
|
||||
|
||||
public function __construct(PimpleContainer $pimple)
|
||||
{
|
||||
$this->pimple = $pimple;
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
return $this->pimple[$id];
|
||||
}
|
||||
|
||||
public function has($id)
|
||||
{
|
||||
return isset($this->pimple[$id]);
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Psr11;
|
||||
|
||||
use Pimple\Container as PimpleContainer;
|
||||
use Pimple\Exception\UnknownIdentifierException;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Pimple PSR-11 service locator.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class ServiceLocator implements ContainerInterface
|
||||
{
|
||||
private $container;
|
||||
private $aliases = array();
|
||||
|
||||
/**
|
||||
* @param PimpleContainer $container The Container instance used to locate services
|
||||
* @param array $ids Array of service ids that can be located. String keys can be used to define aliases
|
||||
*/
|
||||
public function __construct(PimpleContainer $container, array $ids)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
||||
foreach ($ids as $key => $id) {
|
||||
$this->aliases[\is_int($key) ? $id : $key] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
if (!isset($this->aliases[$id])) {
|
||||
throw new UnknownIdentifierException($id);
|
||||
}
|
||||
|
||||
return $this->container[$this->aliases[$id]];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function has($id)
|
||||
{
|
||||
return isset($this->aliases[$id]) && isset($this->container[$this->aliases[$id]]);
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple;
|
||||
|
||||
/**
|
||||
* Lazy service iterator.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
final class ServiceIterator implements \Iterator
|
||||
{
|
||||
private $container;
|
||||
private $ids;
|
||||
|
||||
public function __construct(Container $container, array $ids)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->ids = $ids;
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
\reset($this->ids);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return $this->container[\current($this->ids)];
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return \current($this->ids);
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
\next($this->ids);
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return null !== \key($this->ids);
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple;
|
||||
|
||||
/**
|
||||
* Pimple service provider interface.
|
||||
*
|
||||
* @author Fabien Potencier
|
||||
* @author Dominik Zogg
|
||||
*/
|
||||
interface ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* Registers services on the given container.
|
||||
*
|
||||
* This method should only be used to configure services and parameters.
|
||||
* It should not get services.
|
||||
*
|
||||
* @param Container $pimple A container instance
|
||||
*/
|
||||
public function register(Container $pimple);
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Fixtures;
|
||||
|
||||
class Invokable
|
||||
{
|
||||
public function __invoke($value = null)
|
||||
{
|
||||
$service = new Service();
|
||||
$service->value = $value;
|
||||
|
||||
return $service;
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Fixtures;
|
||||
|
||||
class NonInvokable
|
||||
{
|
||||
public function __call($a, $b)
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Fixtures;
|
||||
|
||||
use Pimple\Container;
|
||||
use Pimple\ServiceProviderInterface;
|
||||
|
||||
class PimpleServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* Registers services on the given container.
|
||||
*
|
||||
* This method should only be used to configure services and parameters.
|
||||
* It should not get services.
|
||||
*
|
||||
* @param Container $pimple An Container instance
|
||||
*/
|
||||
public function register(Container $pimple)
|
||||
{
|
||||
$pimple['param'] = 'value';
|
||||
|
||||
$pimple['service'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
|
||||
$pimple['factory'] = $pimple->factory(function () {
|
||||
return new Service();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* @author Igor Wiedler <igor@wiedler.ch>
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
public $value;
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests;
|
||||
|
||||
use Pimple\Container;
|
||||
|
||||
/**
|
||||
* @author Dominik Zogg <dominik.zogg@gmail.com>
|
||||
*/
|
||||
class PimpleServiceProviderInterfaceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testProvider()
|
||||
{
|
||||
$pimple = new Container();
|
||||
|
||||
$pimpleServiceProvider = new Fixtures\PimpleServiceProvider();
|
||||
$pimpleServiceProvider->register($pimple);
|
||||
|
||||
$this->assertEquals('value', $pimple['param']);
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
|
||||
|
||||
$serviceOne = $pimple['factory'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
|
||||
$serviceTwo = $pimple['factory'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
|
||||
$this->assertNotSame($serviceOne, $serviceTwo);
|
||||
}
|
||||
|
||||
public function testProviderWithRegisterMethod()
|
||||
{
|
||||
$pimple = new Container();
|
||||
|
||||
$pimple->register(new Fixtures\PimpleServiceProvider(), array(
|
||||
'anotherParameter' => 'anotherValue',
|
||||
));
|
||||
|
||||
$this->assertEquals('value', $pimple['param']);
|
||||
$this->assertEquals('anotherValue', $pimple['anotherParameter']);
|
||||
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
|
||||
|
||||
$serviceOne = $pimple['factory'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
|
||||
$serviceTwo = $pimple['factory'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
|
||||
$this->assertNotSame($serviceOne, $serviceTwo);
|
||||
}
|
||||
}
|
|
@ -1,589 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests;
|
||||
|
||||
use Pimple\Container;
|
||||
|
||||
/**
|
||||
* @author Igor Wiedler <igor@wiedler.ch>
|
||||
*/
|
||||
class PimpleTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testWithString()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['param'] = 'value';
|
||||
|
||||
$this->assertEquals('value', $pimple['param']);
|
||||
}
|
||||
|
||||
public function testWithClosure()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
|
||||
}
|
||||
|
||||
public function testServicesShouldBeDifferent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = $pimple->factory(function () {
|
||||
return new Fixtures\Service();
|
||||
});
|
||||
|
||||
$serviceOne = $pimple['service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
|
||||
$serviceTwo = $pimple['service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
|
||||
$this->assertNotSame($serviceOne, $serviceTwo);
|
||||
}
|
||||
|
||||
public function testShouldPassContainerAsParameter()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$pimple['container'] = function ($container) {
|
||||
return $container;
|
||||
};
|
||||
|
||||
$this->assertNotSame($pimple, $pimple['service']);
|
||||
$this->assertSame($pimple, $pimple['container']);
|
||||
}
|
||||
|
||||
public function testIsset()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['param'] = 'value';
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
|
||||
$pimple['null'] = null;
|
||||
|
||||
$this->assertTrue(isset($pimple['param']));
|
||||
$this->assertTrue(isset($pimple['service']));
|
||||
$this->assertTrue(isset($pimple['null']));
|
||||
$this->assertFalse(isset($pimple['non_existent']));
|
||||
}
|
||||
|
||||
public function testConstructorInjection()
|
||||
{
|
||||
$params = array('param' => 'value');
|
||||
$pimple = new Container($params);
|
||||
|
||||
$this->assertSame($params['param'], $pimple['param']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testOffsetGetValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
echo $pimple['foo'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testLegacyOffsetGetValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
echo $pimple['foo'];
|
||||
}
|
||||
|
||||
public function testOffsetGetHonorsNullValues()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = null;
|
||||
$this->assertNull($pimple['foo']);
|
||||
}
|
||||
|
||||
public function testUnset()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['param'] = 'value';
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
|
||||
unset($pimple['param'], $pimple['service']);
|
||||
$this->assertFalse(isset($pimple['param']));
|
||||
$this->assertFalse(isset($pimple['service']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider serviceDefinitionProvider
|
||||
*/
|
||||
public function testShare($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['shared_service'] = $service;
|
||||
|
||||
$serviceOne = $pimple['shared_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
|
||||
$serviceTwo = $pimple['shared_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
|
||||
$this->assertSame($serviceOne, $serviceTwo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider serviceDefinitionProvider
|
||||
*/
|
||||
public function testProtect($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['protected'] = $pimple->protect($service);
|
||||
|
||||
$this->assertSame($service, $pimple['protected']);
|
||||
}
|
||||
|
||||
public function testGlobalFunctionNameAsParameterValue()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['global_function'] = 'strlen';
|
||||
$this->assertSame('strlen', $pimple['global_function']);
|
||||
}
|
||||
|
||||
public function testRaw()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = $definition = $pimple->factory(function () { return 'foo'; });
|
||||
$this->assertSame($definition, $pimple->raw('service'));
|
||||
}
|
||||
|
||||
public function testRawHonorsNullValues()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = null;
|
||||
$this->assertNull($pimple->raw('foo'));
|
||||
}
|
||||
|
||||
public function testFluentRegister()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$this->assertSame($pimple, $pimple->register($this->getMockBuilder('Pimple\ServiceProviderInterface')->getMock()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testRawValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->raw('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testLegacyRawValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->raw('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider serviceDefinitionProvider
|
||||
*/
|
||||
public function testExtend($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['shared_service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$pimple['factory_service'] = $pimple->factory(function () {
|
||||
return new Fixtures\Service();
|
||||
});
|
||||
|
||||
$pimple->extend('shared_service', $service);
|
||||
$serviceOne = $pimple['shared_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
$serviceTwo = $pimple['shared_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
$this->assertSame($serviceOne, $serviceTwo);
|
||||
$this->assertSame($serviceOne->value, $serviceTwo->value);
|
||||
|
||||
$pimple->extend('factory_service', $service);
|
||||
$serviceOne = $pimple['factory_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
|
||||
$serviceTwo = $pimple['factory_service'];
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
|
||||
$this->assertNotSame($serviceOne, $serviceTwo);
|
||||
$this->assertNotSame($serviceOne->value, $serviceTwo->value);
|
||||
}
|
||||
|
||||
public function testExtendDoesNotLeakWithFactories()
|
||||
{
|
||||
if (extension_loaded('pimple')) {
|
||||
$this->markTestSkipped('Pimple extension does not support this test');
|
||||
}
|
||||
$pimple = new Container();
|
||||
|
||||
$pimple['foo'] = $pimple->factory(function () { return; });
|
||||
$pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { return; });
|
||||
unset($pimple['foo']);
|
||||
|
||||
$p = new \ReflectionProperty($pimple, 'values');
|
||||
$p->setAccessible(true);
|
||||
$this->assertEmpty($p->getValue($pimple));
|
||||
|
||||
$p = new \ReflectionProperty($pimple, 'factories');
|
||||
$p->setAccessible(true);
|
||||
$this->assertCount(0, $p->getValue($pimple));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testExtendValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testLegacyExtendValidatesKeyIsPresent()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
public function testKeys()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = 123;
|
||||
$pimple['bar'] = 123;
|
||||
|
||||
$this->assertEquals(array('foo', 'bar'), $pimple->keys());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function settingAnInvokableObjectShouldTreatItAsFactory()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['invokable'] = new Fixtures\Invokable();
|
||||
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['invokable']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function settingNonInvokableObjectShouldTreatItAsParameter()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['non_invokable'] = new Fixtures\NonInvokable();
|
||||
|
||||
$this->assertInstanceOf('Pimple\Tests\Fixtures\NonInvokable', $pimple['non_invokable']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \Pimple\Exception\ExpectedInvokableException
|
||||
* @expectedExceptionMessage Service definition is not a Closure or invokable object.
|
||||
*/
|
||||
public function testFactoryFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->factory($service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Service definition is not a Closure or invokable object.
|
||||
*/
|
||||
public function testLegacyFactoryFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->factory($service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \Pimple\Exception\ExpectedInvokableException
|
||||
* @expectedExceptionMessage Callable is not a Closure or invokable object.
|
||||
*/
|
||||
public function testProtectFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->protect($service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Callable is not a Closure or invokable object.
|
||||
*/
|
||||
public function testLegacyProtectFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple->protect($service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \Pimple\Exception\InvalidServiceIdentifierException
|
||||
* @expectedExceptionMessage Identifier "foo" does not contain an object definition.
|
||||
*/
|
||||
public function testExtendFailsForKeysNotContainingServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = $service;
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Identifier "foo" does not contain an object definition.
|
||||
*/
|
||||
public function testLegacyExtendFailsForKeysNotContainingServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = $service;
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedDeprecation How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "foo" should be protected?
|
||||
*/
|
||||
public function testExtendingProtectedClosureDeprecation()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = $pimple->protect(function () {
|
||||
return 'bar';
|
||||
});
|
||||
|
||||
$pimple->extend('foo', function ($value) {
|
||||
return $value.'-baz';
|
||||
});
|
||||
|
||||
$this->assertSame('bar-baz', $pimple['foo']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \Pimple\Exception\ExpectedInvokableException
|
||||
* @expectedExceptionMessage Extension service definition is not a Closure or invokable object.
|
||||
*/
|
||||
public function testExtendFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {};
|
||||
$pimple->extend('foo', $service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @dataProvider badServiceDefinitionProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Extension service definition is not a Closure or invokable object.
|
||||
*/
|
||||
public function testLegacyExtendFailsForInvalidServiceDefinitions($service)
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {};
|
||||
$pimple->extend('foo', $service);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\FrozenServiceException
|
||||
* @expectedExceptionMessage Cannot override frozen service "foo".
|
||||
*/
|
||||
public function testExtendFailsIfFrozenServiceIsNonInvokable()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return new Fixtures\NonInvokable();
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\FrozenServiceException
|
||||
* @expectedExceptionMessage Cannot override frozen service "foo".
|
||||
*/
|
||||
public function testExtendFailsIfFrozenServiceIsInvokable()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return new Fixtures\Invokable();
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple->extend('foo', function () {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider for invalid service definitions.
|
||||
*/
|
||||
public function badServiceDefinitionProvider()
|
||||
{
|
||||
return array(
|
||||
array(123),
|
||||
array(new Fixtures\NonInvokable()),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider for service definitions.
|
||||
*/
|
||||
public function serviceDefinitionProvider()
|
||||
{
|
||||
return array(
|
||||
array(function ($value) {
|
||||
$service = new Fixtures\Service();
|
||||
$service->value = $value;
|
||||
|
||||
return $service;
|
||||
}),
|
||||
array(new Fixtures\Invokable()),
|
||||
);
|
||||
}
|
||||
|
||||
public function testDefiningNewServiceAfterFreeze()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple['bar'] = function () {
|
||||
return 'bar';
|
||||
};
|
||||
$this->assertSame('bar', $pimple['bar']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\FrozenServiceException
|
||||
* @expectedExceptionMessage Cannot override frozen service "foo".
|
||||
*/
|
||||
public function testOverridingServiceAfterFreeze()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple['foo'] = function () {
|
||||
return 'bar';
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Cannot override frozen service "foo".
|
||||
*/
|
||||
public function testLegacyOverridingServiceAfterFreeze()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple['foo'] = function () {
|
||||
return 'bar';
|
||||
};
|
||||
}
|
||||
|
||||
public function testRemovingServiceAfterFreeze()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
unset($pimple['foo']);
|
||||
$pimple['foo'] = function () {
|
||||
return 'bar';
|
||||
};
|
||||
$this->assertSame('bar', $pimple['foo']);
|
||||
}
|
||||
|
||||
public function testExtendingService()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$pimple['foo'] = $pimple->extend('foo', function ($foo, $app) {
|
||||
return "$foo.bar";
|
||||
});
|
||||
$pimple['foo'] = $pimple->extend('foo', function ($foo, $app) {
|
||||
return "$foo.baz";
|
||||
});
|
||||
$this->assertSame('foo.bar.baz', $pimple['foo']);
|
||||
}
|
||||
|
||||
public function testExtendingServiceAfterOtherServiceFreeze()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['foo'] = function () {
|
||||
return 'foo';
|
||||
};
|
||||
$pimple['bar'] = function () {
|
||||
return 'bar';
|
||||
};
|
||||
$foo = $pimple['foo'];
|
||||
|
||||
$pimple['bar'] = $pimple->extend('bar', function ($bar, $app) {
|
||||
return "$bar.baz";
|
||||
});
|
||||
$this->assertSame('bar.baz', $pimple['bar']);
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009-2017 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Psr11;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Pimple\Container;
|
||||
use Pimple\Psr11\Container as PsrContainer;
|
||||
use Pimple\Tests\Fixtures\Service;
|
||||
|
||||
class ContainerTest extends TestCase
|
||||
{
|
||||
public function testGetReturnsExistingService()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
$psr = new PsrContainer($pimple);
|
||||
|
||||
$this->assertSame($pimple['service'], $psr->get('service'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Psr\Container\NotFoundExceptionInterface
|
||||
* @expectedExceptionMessage Identifier "service" is not defined.
|
||||
*/
|
||||
public function testGetThrowsExceptionIfServiceIsNotFound()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$psr = new PsrContainer($pimple);
|
||||
|
||||
$psr->get('service');
|
||||
}
|
||||
|
||||
public function testHasReturnsTrueIfServiceExists()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
$psr = new PsrContainer($pimple);
|
||||
|
||||
$this->assertTrue($psr->has('service'));
|
||||
}
|
||||
|
||||
public function testHasReturnsFalseIfServiceDoesNotExist()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$psr = new PsrContainer($pimple);
|
||||
|
||||
$this->assertFalse($psr->has('service'));
|
||||
}
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests\Psr11;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Pimple\Container;
|
||||
use Pimple\Psr11\ServiceLocator;
|
||||
use Pimple\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* ServiceLocator test case.
|
||||
*
|
||||
* @author Pascal Luna <skalpa@zetareticuli.org>
|
||||
*/
|
||||
class ServiceLocatorTest extends TestCase
|
||||
{
|
||||
public function testCanAccessServices()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('service'));
|
||||
|
||||
$this->assertSame($pimple['service'], $locator->get('service'));
|
||||
}
|
||||
|
||||
public function testCanAccessAliasedServices()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('alias' => 'service'));
|
||||
|
||||
$this->assertSame($pimple['service'], $locator->get('alias'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "service" is not defined.
|
||||
*/
|
||||
public function testCannotAccessAliasedServiceUsingRealIdentifier()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('alias' => 'service'));
|
||||
|
||||
$service = $locator->get('service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "foo" is not defined.
|
||||
*/
|
||||
public function testGetValidatesServiceCanBeLocated()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('alias' => 'service'));
|
||||
|
||||
$service = $locator->get('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Pimple\Exception\UnknownIdentifierException
|
||||
* @expectedExceptionMessage Identifier "invalid" is not defined.
|
||||
*/
|
||||
public function testGetValidatesTargetServiceExists()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('alias' => 'invalid'));
|
||||
|
||||
$service = $locator->get('alias');
|
||||
}
|
||||
|
||||
public function testHasValidatesServiceCanBeLocated()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service1'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$pimple['service2'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('service1'));
|
||||
|
||||
$this->assertTrue($locator->has('service1'));
|
||||
$this->assertFalse($locator->has('service2'));
|
||||
}
|
||||
|
||||
public function testHasChecksIfTargetServiceExists()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service'] = function () {
|
||||
return new Fixtures\Service();
|
||||
};
|
||||
$locator = new ServiceLocator($pimple, array('foo' => 'service', 'bar' => 'invalid'));
|
||||
|
||||
$this->assertTrue($locator->has('foo'));
|
||||
$this->assertFalse($locator->has('bar'));
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Pimple.
|
||||
*
|
||||
* Copyright (c) 2009 Fabien Potencier
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is furnished
|
||||
* to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Pimple\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Pimple\Container;
|
||||
use Pimple\ServiceIterator;
|
||||
use Pimple\Tests\Fixtures\Service;
|
||||
|
||||
class ServiceIteratorTest extends TestCase
|
||||
{
|
||||
public function testIsIterable()
|
||||
{
|
||||
$pimple = new Container();
|
||||
$pimple['service1'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
$pimple['service2'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
$pimple['service3'] = function () {
|
||||
return new Service();
|
||||
};
|
||||
$iterator = new ServiceIterator($pimple, array('service1', 'service2'));
|
||||
|
||||
$this->assertSame(array('service1' => $pimple['service1'], 'service2' => $pimple['service2']), iterator_to_array($iterator));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,13 @@
|
|||
# PSR Container
|
||||
Container interface
|
||||
==============
|
||||
|
||||
This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md).
|
||||
This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url].
|
||||
|
||||
Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.
|
||||
|
||||
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||
|
||||
[psr-url]: https://www.php-fig.org/psr/psr-11/
|
||||
[package-url]: https://packagist.org/packages/psr/container
|
||||
[implementation-url]: https://packagist.org/providers/psr/container-implementation
|
||||
|
||||
Note that this is not a container implementation of its own. See the specification for more details.
|
||||
|
|
|
@ -8,20 +8,15 @@
|
|||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=7.4.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Container\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Base interface representing a generic exception in a container.
|
||||
*/
|
||||
interface ContainerExceptionInterface
|
||||
interface ContainerExceptionInterface extends Throwable
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
|
@ -20,7 +19,7 @@ interface ContainerInterface
|
|||
*
|
||||
* @return mixed Entry.
|
||||
*/
|
||||
public function get($id);
|
||||
public function get(string $id);
|
||||
|
||||
/**
|
||||
* Returns true if the container can return an entry for the given identifier.
|
||||
|
@ -33,5 +32,5 @@ interface ContainerInterface
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($id);
|
||||
public function has(string $id);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
|
|
21
advancedcontentfilter/vendor/psr/http-factory/LICENSE
vendored
Normal file
21
advancedcontentfilter/vendor/psr/http-factory/LICENSE
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 PHP-FIG
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
12
advancedcontentfilter/vendor/psr/http-factory/README.md
vendored
Normal file
12
advancedcontentfilter/vendor/psr/http-factory/README.md
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
HTTP Factories
|
||||
==============
|
||||
|
||||
This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url].
|
||||
|
||||
Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory.
|
||||
|
||||
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||
|
||||
[psr-url]: https://www.php-fig.org/psr/psr-17/
|
||||
[package-url]: https://packagist.org/packages/psr/http-factory
|
||||
[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue