Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | namespace phpbb\composer; |
| 15 | |
| 16 | use Composer\IO\IOInterface; |
| 17 | use phpbb\composer\exception\runtime_exception; |
| 18 | |
| 19 | /** |
| 20 | * Class to manage packages through composer. |
| 21 | */ |
| 22 | interface manager_interface |
| 23 | { |
| 24 | /** |
| 25 | * Installs (if necessary) a set of packages |
| 26 | * |
| 27 | * @param array $packages Packages to install. |
| 28 | * Each entry may be a name or an array associating a version constraint to a name |
| 29 | * @param IOInterface|null $io IO object used for the output |
| 30 | * |
| 31 | * @throws runtime_exception |
| 32 | */ |
| 33 | public function install(array $packages, IOInterface|null $io = null); |
| 34 | |
| 35 | /** |
| 36 | * Updates or installs a set of packages |
| 37 | * |
| 38 | * @param array $packages Packages to update. |
| 39 | * Each entry may be a name or an array associating a version constraint to a name |
| 40 | * @param IOInterface|null $io IO object used for the output |
| 41 | * |
| 42 | * @throws runtime_exception |
| 43 | */ |
| 44 | public function update(array $packages, IOInterface|null $io = null); |
| 45 | |
| 46 | /** |
| 47 | * Removes a set of packages |
| 48 | * |
| 49 | * @param array $packages Packages to remove. |
| 50 | * Each entry may be a name or an array associating a version constraint to a name |
| 51 | * @param IOInterface|null $io IO object used for the output |
| 52 | * |
| 53 | * @throws runtime_exception |
| 54 | */ |
| 55 | public function remove(array $packages, IOInterface|null $io = null); |
| 56 | |
| 57 | /** |
| 58 | * Tells whether or not a package is managed by Composer. |
| 59 | * |
| 60 | * @param string $package Package name |
| 61 | * |
| 62 | * @return bool |
| 63 | */ |
| 64 | public function is_managed($package); |
| 65 | |
| 66 | /** |
| 67 | * Returns the list of managed packages for the current type |
| 68 | * |
| 69 | * @return array The managed packages associated to their version. |
| 70 | */ |
| 71 | public function get_managed_packages(); |
| 72 | |
| 73 | /** |
| 74 | * Returns the list of managed packages for all phpBB types |
| 75 | * |
| 76 | * @return array The managed packages associated to their version. |
| 77 | */ |
| 78 | public function get_all_managed_packages(); |
| 79 | |
| 80 | /** |
| 81 | * Returns the list of available packages |
| 82 | * |
| 83 | * @return array The name of the available packages, associated to their definition. Ordered by name. |
| 84 | */ |
| 85 | public function get_available_packages(); |
| 86 | |
| 87 | /** |
| 88 | * Reset the cache |
| 89 | */ |
| 90 | public function reset_cache(); |
| 91 | |
| 92 | /** |
| 93 | * Start managing a manually installed package |
| 94 | * |
| 95 | * Remove a package installed manually and reinstall it using composer. |
| 96 | * |
| 97 | * @param string $package Package to manage |
| 98 | * @param IOInterface $io IO object used for the output |
| 99 | * |
| 100 | * @throws runtime_exception |
| 101 | */ |
| 102 | public function start_managing($package, $io); |
| 103 | |
| 104 | /** |
| 105 | * Checks the requirements of the manager and returns true if it can be used. |
| 106 | * |
| 107 | * @return bool |
| 108 | */ |
| 109 | public function check_requirements(); |
| 110 | } |