Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:35:09
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,396 @@
1
+<?php
2
+
3
+/*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ *     Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+namespace Composer;
14
+
15
+use Composer\Autoload\ClassLoader;
16
+use Composer\Semver\VersionParser;
17
+
18
+/**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require its presence, you can require `composer-runtime-api ^2.0`
24
+ *
25
+ * @final
26
+ */
27
+class InstalledVersions
28
+{
29
+    /**
30
+     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
31
+     * @internal
32
+     */
33
+    private static $selfDir = null;
34
+
35
+    /**
36
+     * @var mixed[]|null
37
+     * @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
38
+     */
39
+    private static $installed;
40
+
41
+    /**
42
+     * @var bool
43
+     */
44
+    private static $installedIsLocalDir;
45
+
46
+    /**
47
+     * @var bool|null
48
+     */
49
+    private static $canGetVendors;
50
+
51
+    /**
52
+     * @var array[]
53
+     * @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[]}>}>
54
+     */
55
+    private static $installedByVendor = array();
56
+
57
+    /**
58
+     * Returns a list of all package names which are present, either by being installed, replaced or provided
59
+     *
60
+     * @return string[]
61
+     * @psalm-return list<string>
62
+     */
63
+    public static function getInstalledPackages()
64
+    {
65
+        $packages = array();
66
+        foreach (self::getInstalled() as $installed) {
67
+            $packages[] = array_keys($installed['versions']);
68
+        }
69
+
70
+        if (1 === \count($packages)) {
71
+            return $packages[0];
72
+        }
73
+
74
+        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
75
+    }
76
+
77
+    /**
78
+     * Returns a list of all package names with a specific type e.g. 'library'
79
+     *
80
+     * @param  string   $type
81
+     * @return string[]
82
+     * @psalm-return list<string>
83
+     */
84
+    public static function getInstalledPackagesByType($type)
85
+    {
86
+        $packagesByType = array();
87
+
88
+        foreach (self::getInstalled() as $installed) {
89
+            foreach ($installed['versions'] as $name => $package) {
90
+                if (isset($package['type']) && $package['type'] === $type) {
91
+                    $packagesByType[] = $name;
92
+                }
93
+            }
94
+        }
95
+
96
+        return $packagesByType;
97
+    }
98
+
99
+    /**
100
+     * Checks whether the given package is installed
101
+     *
102
+     * This also returns true if the package name is provided or replaced by another package
103
+     *
104
+     * @param  string $packageName
105
+     * @param  bool   $includeDevRequirements
106
+     * @return bool
107
+     */
108
+    public static function isInstalled($packageName, $includeDevRequirements = true)
109
+    {
110
+        foreach (self::getInstalled() as $installed) {
111
+            if (isset($installed['versions'][$packageName])) {
112
+                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
113
+            }
114
+        }
115
+
116
+        return false;
117
+    }
118
+
119
+    /**
120
+     * Checks whether the given package satisfies a version constraint
121
+     *
122
+     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
123
+     *
124
+     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
125
+     *
126
+     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
127
+     * @param  string        $packageName
128
+     * @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
129
+     * @return bool
130
+     */
131
+    public static function satisfies(VersionParser $parser, $packageName, $constraint)
132
+    {
133
+        $constraint = $parser->parseConstraints((string) $constraint);
134
+        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
135
+
136
+        return $provided->matches($constraint);
137
+    }
138
+
139
+    /**
140
+     * Returns a version constraint representing all the range(s) which are installed for a given package
141
+     *
142
+     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
143
+     * whether a given version of a package is installed, and not just whether it exists
144
+     *
145
+     * @param  string $packageName
146
+     * @return string Version constraint usable with composer/semver
147
+     */
148
+    public static function getVersionRanges($packageName)
149
+    {
150
+        foreach (self::getInstalled() as $installed) {
151
+            if (!isset($installed['versions'][$packageName])) {
152
+                continue;
153
+            }
154
+
155
+            $ranges = array();
156
+            if (isset($installed['versions'][$packageName]['pretty_version'])) {
157
+                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
158
+            }
159
+            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
160
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
161
+            }
162
+            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
163
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
164
+            }
165
+            if (array_key_exists('provided', $installed['versions'][$packageName])) {
166
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
167
+            }
168
+
169
+            return implode(' || ', $ranges);
170
+        }
171
+
172
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
173
+    }
174
+
175
+    /**
176
+     * @param  string      $packageName
177
+     * @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
178
+     */
179
+    public static function getVersion($packageName)
180
+    {
181
+        foreach (self::getInstalled() as $installed) {
182
+            if (!isset($installed['versions'][$packageName])) {
183
+                continue;
184
+            }
185
+
186
+            if (!isset($installed['versions'][$packageName]['version'])) {
187
+                return null;
188
+            }
189
+
190
+            return $installed['versions'][$packageName]['version'];
191
+        }
192
+
193
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
194
+    }
195
+
196
+    /**
197
+     * @param  string      $packageName
198
+     * @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
199
+     */
200
+    public static function getPrettyVersion($packageName)
201
+    {
202
+        foreach (self::getInstalled() as $installed) {
203
+            if (!isset($installed['versions'][$packageName])) {
204
+                continue;
205
+            }
206
+
207
+            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
208
+                return null;
209
+            }
210
+
211
+            return $installed['versions'][$packageName]['pretty_version'];
212
+        }
213
+
214
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
215
+    }
216
+
217
+    /**
218
+     * @param  string      $packageName
219
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
220
+     */
221
+    public static function getReference($packageName)
222
+    {
223
+        foreach (self::getInstalled() as $installed) {
224
+            if (!isset($installed['versions'][$packageName])) {
225
+                continue;
226
+            }
227
+
228
+            if (!isset($installed['versions'][$packageName]['reference'])) {
229
+                return null;
230
+            }
231
+
232
+            return $installed['versions'][$packageName]['reference'];
233
+        }
234
+
235
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
236
+    }
237
+
238
+    /**
239
+     * @param  string      $packageName
240
+     * @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.
241
+     */
242
+    public static function getInstallPath($packageName)
243
+    {
244
+        foreach (self::getInstalled() as $installed) {
245
+            if (!isset($installed['versions'][$packageName])) {
246
+                continue;
247
+            }
248
+
249
+            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
250
+        }
251
+
252
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
253
+    }
254
+
255
+    /**
256
+     * @return array
257
+     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
258
+     */
259
+    public static function getRootPackage()
260
+    {
261
+        $installed = self::getInstalled();
262
+
263
+        return $installed[0]['root'];
264
+    }
265
+
266
+    /**
267
+     * Returns the raw installed.php data for custom implementations
268
+     *
269
+     * @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.
270
+     * @return array[]
271
+     * @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[]}>}
272
+     */
273
+    public static function getRawData()
274
+    {
275
+        @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);
276
+
277
+        if (null === self::$installed) {
278
+            // only require the installed.php file if this file is loaded from its dumped location,
279
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
280
+            if (substr(__DIR__, -8, 1) !== 'C') {
281
+                self::$installed = include __DIR__ . '/installed.php';
282
+            } else {
283
+                self::$installed = array();
284
+            }
285
+        }
286
+
287
+        return self::$installed;
288
+    }
289
+
290
+    /**
291
+     * Returns the raw data of all installed.php which are currently loaded for custom implementations
292
+     *
293
+     * @return array[]
294
+     * @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[]}>}>
295
+     */
296
+    public static function getAllRawData()
297
+    {
298
+        return self::getInstalled();
299
+    }
300
+
301
+    /**
302
+     * Lets you reload the static array from another file
303
+     *
304
+     * This is only useful for complex integrations in which a project needs to use
305
+     * this class but then also needs to execute another project's autoloader in process,
306
+     * and wants to ensure both projects have access to their version of installed.php.
307
+     *
308
+     * A typical case would be PHPUnit, where it would need to make sure it reads all
309
+     * the data it needs from this class, then call reload() with
310
+     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
311
+     * the project in which it runs can then also use this class safely, without
312
+     * interference between PHPUnit's dependencies and the project's dependencies.
313
+     *
314
+     * @param  array[] $data A vendor/composer/installed.php data set
315
+     * @return void
316
+     *
317
+     * @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
318
+     */
319
+    public static function reload($data)
320
+    {
321
+        self::$installed = $data;
322
+        self::$installedByVendor = array();
323
+
324
+        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
325
+        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
326
+        // so we have to assume it does not, and that may result in duplicate data being returned when listing
327
+        // all installed packages for example
328
+        self::$installedIsLocalDir = false;
329
+    }
330
+
331
+    /**
332
+     * @return string
333
+     */
334
+    private static function getSelfDir()
335
+    {
336
+        if (self::$selfDir === null) {
337
+            self::$selfDir = strtr(__DIR__, '\\', '/');
338
+        }
339
+
340
+        return self::$selfDir;
341
+    }
342
+
343
+    /**
344
+     * @return array[]
345
+     * @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[]}>}>
346
+     */
347
+    private static function getInstalled()
348
+    {
349
+        if (null === self::$canGetVendors) {
350
+            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
351
+        }
352
+
353
+        $installed = array();
354
+        $copiedLocalDir = false;
355
+
356
+        if (self::$canGetVendors) {
357
+            $selfDir = self::getSelfDir();
358
+            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
359
+                $vendorDir = strtr($vendorDir, '\\', '/');
360
+                if (isset(self::$installedByVendor[$vendorDir])) {
361
+                    $installed[] = self::$installedByVendor[$vendorDir];
362
+                } elseif (is_file($vendorDir.'/composer/installed.php')) {
363
+                    /** @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 */
364
+                    $required = require $vendorDir.'/composer/installed.php';
365
+                    self::$installedByVendor[$vendorDir] = $required;
366
+                    $installed[] = $required;
367
+                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
368
+                        self::$installed = $required;
369
+                        self::$installedIsLocalDir = true;
370
+                    }
371
+                }
372
+                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
373
+                    $copiedLocalDir = true;
374
+                }
375
+            }
376
+        }
377
+
378
+        if (null === self::$installed) {
379
+            // only require the installed.php file if this file is loaded from its dumped location,
380
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
381
+            if (substr(__DIR__, -8, 1) !== 'C') {
382
+                /** @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 */
383
+                $required = require __DIR__ . '/installed.php';
384
+                self::$installed = $required;
385
+            } else {
386
+                self::$installed = array();
387
+            }
388
+        }
389
+
390
+        if (self::$installed !== array() && !$copiedLocalDir) {
391
+            $installed[] = self::$installed;
392
+        }
393
+
394
+        return $installed;
395
+    }
396
+}
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:12:22
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,370 +0,0 @@
1
-<?php
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-namespace Composer;
14
-
15
-use Composer\Autoload\ClassLoader;
16
-use Composer\Semver\VersionParser;
17
-
18
-
19
-
20
-
21
-
22
-
23
-class InstalledVersions
24
-{
25
-private static $installed = array (
26
-  'root' => 
27
-  array (
28
-    'pretty_version' => '1.0.0+no-version-set',
29
-    'version' => '1.0.0.0',
30
-    'aliases' => 
31
-    array (
32
-    ),
33
-    'reference' => NULL,
34
-    'name' => '__root__',
35
-  ),
36
-  'versions' => 
37
-  array (
38
-    '__root__' => 
39
-    array (
40
-      'pretty_version' => '1.0.0+no-version-set',
41
-      'version' => '1.0.0.0',
42
-      'aliases' => 
43
-      array (
44
-      ),
45
-      'reference' => NULL,
46
-    ),
47
-    'firebase/php-jwt' => 
48
-    array (
49
-      'pretty_version' => 'v5.2.0',
50
-      'version' => '5.2.0.0',
51
-      'aliases' => 
52
-      array (
53
-      ),
54
-      'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb',
55
-    ),
56
-    'guzzlehttp/guzzle' => 
57
-    array (
58
-      'pretty_version' => '7.2.0',
59
-      'version' => '7.2.0.0',
60
-      'aliases' => 
61
-      array (
62
-      ),
63
-      'reference' => '0aa74dfb41ae110835923ef10a9d803a22d50e79',
64
-    ),
65
-    'guzzlehttp/promises' => 
66
-    array (
67
-      'pretty_version' => '1.4.0',
68
-      'version' => '1.4.0.0',
69
-      'aliases' => 
70
-      array (
71
-      ),
72
-      'reference' => '60d379c243457e073cff02bc323a2a86cb355631',
73
-    ),
74
-    'guzzlehttp/psr7' => 
75
-    array (
76
-      'pretty_version' => '1.7.0',
77
-      'version' => '1.7.0.0',
78
-      'aliases' => 
79
-      array (
80
-      ),
81
-      'reference' => '53330f47520498c0ae1f61f7e2c90f55690c06a3',
82
-    ),
83
-    'plivo/plivo-php' => 
84
-    array (
85
-      'pretty_version' => 'v4.17.0',
86
-      'version' => '4.17.0.0',
87
-      'aliases' => 
88
-      array (
89
-      ),
90
-      'reference' => '25e65763d382dcc50587972387e4df3fd3c18328',
91
-    ),
92
-    'psr/http-client' => 
93
-    array (
94
-      'pretty_version' => '1.0.1',
95
-      'version' => '1.0.1.0',
96
-      'aliases' => 
97
-      array (
98
-      ),
99
-      'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
100
-    ),
101
-    'psr/http-client-implementation' => 
102
-    array (
103
-      'provided' => 
104
-      array (
105
-        0 => '1.0',
106
-      ),
107
-    ),
108
-    'psr/http-message' => 
109
-    array (
110
-      'pretty_version' => '1.0.1',
111
-      'version' => '1.0.1.0',
112
-      'aliases' => 
113
-      array (
114
-      ),
115
-      'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
116
-    ),
117
-    'psr/http-message-implementation' => 
118
-    array (
119
-      'provided' => 
120
-      array (
121
-        0 => '1.0',
122
-      ),
123
-    ),
124
-    'ralouphie/getallheaders' => 
125
-    array (
126
-      'pretty_version' => '3.0.3',
127
-      'version' => '3.0.3.0',
128
-      'aliases' => 
129
-      array (
130
-      ),
131
-      'reference' => '120b605dfeb996808c31b6477290a714d356e822',
132
-    ),
133
-  ),
134
-);
135
-private static $canGetVendors;
136
-private static $installedByVendor = array();
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-public static function getInstalledPackages()
145
-{
146
-$packages = array();
147
-foreach (self::getInstalled() as $installed) {
148
-$packages[] = array_keys($installed['versions']);
149
-}
150
-
151
-
152
-if (1 === \count($packages)) {
153
-return $packages[0];
154
-}
155
-
156
-return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
157
-}
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-public static function isInstalled($packageName)
168
-{
169
-foreach (self::getInstalled() as $installed) {
170
-if (isset($installed['versions'][$packageName])) {
171
-return true;
172
-}
173
-}
174
-
175
-return false;
176
-}
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-public static function satisfies(VersionParser $parser, $packageName, $constraint)
192
-{
193
-$constraint = $parser->parseConstraints($constraint);
194
-$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
195
-
196
-return $provided->matches($constraint);
197
-}
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-public static function getVersionRanges($packageName)
209
-{
210
-foreach (self::getInstalled() as $installed) {
211
-if (!isset($installed['versions'][$packageName])) {
212
-continue;
213
-}
214
-
215
-$ranges = array();
216
-if (isset($installed['versions'][$packageName]['pretty_version'])) {
217
-$ranges[] = $installed['versions'][$packageName]['pretty_version'];
218
-}
219
-if (array_key_exists('aliases', $installed['versions'][$packageName])) {
220
-$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
221
-}
222
-if (array_key_exists('replaced', $installed['versions'][$packageName])) {
223
-$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
224
-}
225
-if (array_key_exists('provided', $installed['versions'][$packageName])) {
226
-$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
227
-}
228
-
229
-return implode(' || ', $ranges);
230
-}
231
-
232
-throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
233
-}
234
-
235
-
236
-
237
-
238
-
239
-public static function getVersion($packageName)
240
-{
241
-foreach (self::getInstalled() as $installed) {
242
-if (!isset($installed['versions'][$packageName])) {
243
-continue;
244
-}
245
-
246
-if (!isset($installed['versions'][$packageName]['version'])) {
247
-return null;
248
-}
249
-
250
-return $installed['versions'][$packageName]['version'];
251
-}
252
-
253
-throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
254
-}
255
-
256
-
257
-
258
-
259
-
260
-public static function getPrettyVersion($packageName)
261
-{
262
-foreach (self::getInstalled() as $installed) {
263
-if (!isset($installed['versions'][$packageName])) {
264
-continue;
265
-}
266
-
267
-if (!isset($installed['versions'][$packageName]['pretty_version'])) {
268
-return null;
269
-}
270
-
271
-return $installed['versions'][$packageName]['pretty_version'];
272
-}
273
-
274
-throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
275
-}
276
-
277
-
278
-
279
-
280
-
281
-public static function getReference($packageName)
282
-{
283
-foreach (self::getInstalled() as $installed) {
284
-if (!isset($installed['versions'][$packageName])) {
285
-continue;
286
-}
287
-
288
-if (!isset($installed['versions'][$packageName]['reference'])) {
289
-return null;
290
-}
291
-
292
-return $installed['versions'][$packageName]['reference'];
293
-}
294
-
295
-throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
296
-}
297
-
298
-
299
-
300
-
301
-
302
-public static function getRootPackage()
303
-{
304
-$installed = self::getInstalled();
305
-
306
-return $installed[0]['root'];
307
-}
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-public static function getRawData()
316
-{
317
-return self::$installed;
318
-}
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
-public static function reload($data)
339
-{
340
-self::$installed = $data;
341
-self::$installedByVendor = array();
342
-}
343
-
344
-
345
-
346
-
347
-private static function getInstalled()
348
-{
349
-if (null === self::$canGetVendors) {
350
-self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
351
-}
352
-
353
-$installed = array();
354
-
355
-if (self::$canGetVendors) {
356
-
357
-foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
358
-if (isset(self::$installedByVendor[$vendorDir])) {
359
-$installed[] = self::$installedByVendor[$vendorDir];
360
-} elseif (is_file($vendorDir.'/composer/installed.php')) {
361
-$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
362
-}
363
-}
364
-}
365
-
366
-$installed[] = self::$installed;
367
-
368
-return $installed;
369
-}
370
-}
Browse code

Added README.md appinfo/info.xml appinfo/signature.json lib/Controller/AuthorApiController.php and the providers directory

DoubleBastionAdmin authored on 20/08/2022 16:33:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,370 @@
1
+<?php
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+namespace Composer;
14
+
15
+use Composer\Autoload\ClassLoader;
16
+use Composer\Semver\VersionParser;
17
+
18
+
19
+
20
+
21
+
22
+
23
+class InstalledVersions
24
+{
25
+private static $installed = array (
26
+  'root' => 
27
+  array (
28
+    'pretty_version' => '1.0.0+no-version-set',
29
+    'version' => '1.0.0.0',
30
+    'aliases' => 
31
+    array (
32
+    ),
33
+    'reference' => NULL,
34
+    'name' => '__root__',
35
+  ),
36
+  'versions' => 
37
+  array (
38
+    '__root__' => 
39
+    array (
40
+      'pretty_version' => '1.0.0+no-version-set',
41
+      'version' => '1.0.0.0',
42
+      'aliases' => 
43
+      array (
44
+      ),
45
+      'reference' => NULL,
46
+    ),
47
+    'firebase/php-jwt' => 
48
+    array (
49
+      'pretty_version' => 'v5.2.0',
50
+      'version' => '5.2.0.0',
51
+      'aliases' => 
52
+      array (
53
+      ),
54
+      'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb',
55
+    ),
56
+    'guzzlehttp/guzzle' => 
57
+    array (
58
+      'pretty_version' => '7.2.0',
59
+      'version' => '7.2.0.0',
60
+      'aliases' => 
61
+      array (
62
+      ),
63
+      'reference' => '0aa74dfb41ae110835923ef10a9d803a22d50e79',
64
+    ),
65
+    'guzzlehttp/promises' => 
66
+    array (
67
+      'pretty_version' => '1.4.0',
68
+      'version' => '1.4.0.0',
69
+      'aliases' => 
70
+      array (
71
+      ),
72
+      'reference' => '60d379c243457e073cff02bc323a2a86cb355631',
73
+    ),
74
+    'guzzlehttp/psr7' => 
75
+    array (
76
+      'pretty_version' => '1.7.0',
77
+      'version' => '1.7.0.0',
78
+      'aliases' => 
79
+      array (
80
+      ),
81
+      'reference' => '53330f47520498c0ae1f61f7e2c90f55690c06a3',
82
+    ),
83
+    'plivo/plivo-php' => 
84
+    array (
85
+      'pretty_version' => 'v4.17.0',
86
+      'version' => '4.17.0.0',
87
+      'aliases' => 
88
+      array (
89
+      ),
90
+      'reference' => '25e65763d382dcc50587972387e4df3fd3c18328',
91
+    ),
92
+    'psr/http-client' => 
93
+    array (
94
+      'pretty_version' => '1.0.1',
95
+      'version' => '1.0.1.0',
96
+      'aliases' => 
97
+      array (
98
+      ),
99
+      'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
100
+    ),
101
+    'psr/http-client-implementation' => 
102
+    array (
103
+      'provided' => 
104
+      array (
105
+        0 => '1.0',
106
+      ),
107
+    ),
108
+    'psr/http-message' => 
109
+    array (
110
+      'pretty_version' => '1.0.1',
111
+      'version' => '1.0.1.0',
112
+      'aliases' => 
113
+      array (
114
+      ),
115
+      'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
116
+    ),
117
+    'psr/http-message-implementation' => 
118
+    array (
119
+      'provided' => 
120
+      array (
121
+        0 => '1.0',
122
+      ),
123
+    ),
124
+    'ralouphie/getallheaders' => 
125
+    array (
126
+      'pretty_version' => '3.0.3',
127
+      'version' => '3.0.3.0',
128
+      'aliases' => 
129
+      array (
130
+      ),
131
+      'reference' => '120b605dfeb996808c31b6477290a714d356e822',
132
+    ),
133
+  ),
134
+);
135
+private static $canGetVendors;
136
+private static $installedByVendor = array();
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+public static function getInstalledPackages()
145
+{
146
+$packages = array();
147
+foreach (self::getInstalled() as $installed) {
148
+$packages[] = array_keys($installed['versions']);
149
+}
150
+
151
+
152
+if (1 === \count($packages)) {
153
+return $packages[0];
154
+}
155
+
156
+return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
157
+}
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+public static function isInstalled($packageName)
168
+{
169
+foreach (self::getInstalled() as $installed) {
170
+if (isset($installed['versions'][$packageName])) {
171
+return true;
172
+}
173
+}
174
+
175
+return false;
176
+}
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+public static function satisfies(VersionParser $parser, $packageName, $constraint)
192
+{
193
+$constraint = $parser->parseConstraints($constraint);
194
+$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
195
+
196
+return $provided->matches($constraint);
197
+}
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+public static function getVersionRanges($packageName)
209
+{
210
+foreach (self::getInstalled() as $installed) {
211
+if (!isset($installed['versions'][$packageName])) {
212
+continue;
213
+}
214
+
215
+$ranges = array();
216
+if (isset($installed['versions'][$packageName]['pretty_version'])) {
217
+$ranges[] = $installed['versions'][$packageName]['pretty_version'];
218
+}
219
+if (array_key_exists('aliases', $installed['versions'][$packageName])) {
220
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
221
+}
222
+if (array_key_exists('replaced', $installed['versions'][$packageName])) {
223
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
224
+}
225
+if (array_key_exists('provided', $installed['versions'][$packageName])) {
226
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
227
+}
228
+
229
+return implode(' || ', $ranges);
230
+}
231
+
232
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
233
+}
234
+
235
+
236
+
237
+
238
+
239
+public static function getVersion($packageName)
240
+{
241
+foreach (self::getInstalled() as $installed) {
242
+if (!isset($installed['versions'][$packageName])) {
243
+continue;
244
+}
245
+
246
+if (!isset($installed['versions'][$packageName]['version'])) {
247
+return null;
248
+}
249
+
250
+return $installed['versions'][$packageName]['version'];
251
+}
252
+
253
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
254
+}
255
+
256
+
257
+
258
+
259
+
260
+public static function getPrettyVersion($packageName)
261
+{
262
+foreach (self::getInstalled() as $installed) {
263
+if (!isset($installed['versions'][$packageName])) {
264
+continue;
265
+}
266
+
267
+if (!isset($installed['versions'][$packageName]['pretty_version'])) {
268
+return null;
269
+}
270
+
271
+return $installed['versions'][$packageName]['pretty_version'];
272
+}
273
+
274
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
275
+}
276
+
277
+
278
+
279
+
280
+
281
+public static function getReference($packageName)
282
+{
283
+foreach (self::getInstalled() as $installed) {
284
+if (!isset($installed['versions'][$packageName])) {
285
+continue;
286
+}
287
+
288
+if (!isset($installed['versions'][$packageName]['reference'])) {
289
+return null;
290
+}
291
+
292
+return $installed['versions'][$packageName]['reference'];
293
+}
294
+
295
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
296
+}
297
+
298
+
299
+
300
+
301
+
302
+public static function getRootPackage()
303
+{
304
+$installed = self::getInstalled();
305
+
306
+return $installed[0]['root'];
307
+}
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+public static function getRawData()
316
+{
317
+return self::$installed;
318
+}
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+public static function reload($data)
339
+{
340
+self::$installed = $data;
341
+self::$installedByVendor = array();
342
+}
343
+
344
+
345
+
346
+
347
+private static function getInstalled()
348
+{
349
+if (null === self::$canGetVendors) {
350
+self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
351
+}
352
+
353
+$installed = array();
354
+
355
+if (self::$canGetVendors) {
356
+
357
+foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
358
+if (isset(self::$installedByVendor[$vendorDir])) {
359
+$installed[] = self::$installedByVendor[$vendorDir];
360
+} elseif (is_file($vendorDir.'/composer/installed.php')) {
361
+$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
362
+}
363
+}
364
+}
365
+
366
+$installed[] = self::$installed;
367
+
368
+return $installed;
369
+}
370
+}