PackageInstaller final readonly class
Minn\Cli\PackageInstaller · public/minn/src/Minn/Cli/PackageInstaller.php · 142 lines
Puts a theme or a plugin on disk for `wp theme install` and `wp plugin install`: a directory slug, a local zip, or a zip URL, saying along the way what WP-CLI says. The two kinds differ only in their words, in where they live, and in a plugin being allowed to be a single file.
Constants and properties
| private | readonly Minn\Ops\Packages $packages | Promoted from the constructor. |
| private | readonly string $kind | Promoted from the constructor. |
| private | readonly string $invalidSlug | Promoted from the constructor. |
| private | readonly string $notFound | Promoted from the constructor. |
Public
| new | __construct(Minn\Ops\Packages $packages, string $kind, string $invalidSlug, string $notFound)# | |
| static | themes(Minn\Ops\Packages $packages): self# | The installer `wp theme install` uses. |
| static | plugins(Minn\Ops\Packages $packages): self# | The installer `wp plugin install` uses. |
| method | install(string $source, bool $force, string $version): array# | One source onto disk: the folder when it is there afterwards (put there now, or already there), null when it could not be installed, and whether this call put it there. @return array{0: ?string, 1: bool} |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | fromDirectory(string $slug, array $info, bool $force, string $version, bool $existed): array# | A directory release (from the Minn update service) onto disk, replacing an installed copy when forced.
@return array{0: ?string, 1: bool} | |||
| private | archive(string $source, bool $force): array# | A zip from a URL or a local path, unpacked into place. @return array{0: ?string, 1: bool} | |||
| private | present(string $dest): bool# | Whether something of this kind is already at the path (a plugin may be a single file beside it). | |||
| private | refuse(string $source, string $reason): array# | The two warnings WP-CLI gives for a source it could not install. @return array{0: null, 1: false} |
Nothing matches.