bfg/installer

Simplify the installation process for certain packages

0.2.1 2023-04-16 17:15 UTC

This package is auto-updated.

Last update: 2024-04-16 19:27:17 UTC


README

The intent of the functionality is to simplify the installation process for certain packages, it also allows you to bind packages with each other by types for your application or extension.

In a nutshell

All you need is to put this package in dependence and inherit from any of your laravel providers, it can be a package or any provider that you create and inherit from a special abstract provider. You will be able to register your providers, specify their dependencies and sequence, very useful when you need to control the connected parts of the laravel. Also, for comfortable work, there is a mini package manager that is used through the composer to quickly install extensions by filtering them by the specified types, in fact, all dependencies in this installer are based on the types of the composer's package.

Commands

Install

Complete the package installation process.

php artisan install [<package>]
Options:
  -u, --update          Update the package after install
  -r, --reinstall       Reinstall the package after install or update

Packages

Show a list of all existing packages on the system.

php artisan packages
Options:
  -p, --path            Show path provider of extensions
  -c, --child           Show child name of extensions
  -t, --type            Show type of extensions

Reinstall

Reinstall the extension, complete uninstallation and full installation.

php artisan reinstall [<package>]

Uninstall

Remove the extension from the system, for complete removal you need to use the "--force" flag.

php artisan uninstall [<package>]
Options:
  -f, --force           Force uninstall

Update

Update system extension.

php artisan update [<package>]
Options:
    -r, --reinstall       Reinstall the package after update

Make

Create package extension.

php artisan make [<package>]
Options:
      --namespace[=NAMESPACE]      The namespace of extension
      --description[=DESCRIPTION]  The description of extension
      --type[=TYPE]                The type of extension [default: "bfg-app"]
      --ver[=VER]                  The version of extension [default: "0.0.1"]

The next step

Further, you just need to inherit any of the service providers from Bfg\Installer\Providers\InstalledProvider and you have the following functions and provider settings at your disposal:

Properties

Property name Property description Default
version The version of extension. 0.0.1
name The name of extension. [provider-class]
child The child type for sub extensions of extension. null
type The type to determine who owns the extension. bfg-app
description The description of extension. null
logo The logo of extension. null

Methods

Method name Method description
installed Executed when the provider is registered and the extension is installed.
run Executed when the provider run method boot and the extension is installed.
installed_parent Executed when the parent provider is registered and the extension is installed.
run_parent Executed when the parent provider run method boot and the extension is installed.
install Run on install extension.
update Run on update extension.
uninstall Run on uninstall extension.
dump Run on dump extension.

You can use both the standard "boot" and "register", just do not forget to call the parent methods, otherwise the control will not be able to be fully implemented.