Download the PHP package brunonatali/install without Composer

On this page you can find all versions of the php package brunonatali/install. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package install

Install

Provide installation capability to a repository.

Table of Contents

Before start

Before you begin, consider reviewing your code and understanding that this is a tool for automating the installation of an application made in PHP to run on the CLI or as a service in a Linux environment.

Observe that if service was instaled this component will update .service file and perform a daemon-reload, and if is active (runing) before install starts, service will be autoatically started after instalation is finished.

Note. Not supported on Windows.

Folder structure

Prepare the folder structure as shown below:

Note. If you are unsure how to create your 'my_program_executable' go to Executable program.

Quickstart example

Individual

A common use is the individual installation of the application, for that, consider having the folder structure as shown in Folder structure.

This will make the contents of the "pbin" folder become executable, as well as create a service on the system with the name "My1stProgram" that will execute the file "my_program_executable".
At the end will call script myScript.sh (under /post-install), to do some adjusts that you need, like call other aplication, change some file attribute or remove. Learn more
An "require" is a array that tell which apps your app depends.
Note that a symlink is created in "/usr/sbin", that way you can run the application by typing in the terminal:

All apps

In this example, it is assumed that the folder structure shown in Folder structure and at least the configuration file "install-instructions.json" is created within all the applications you intend to install.

Within the Factory class there is a static function to make the installation of several applications very easy:

The simplest and most direct way to perform the installation of all applications is to run the following command on the terminal:

Is possible to skip some app installation (partially or entirely).
To do this, you need to pass an array with app name in key, as follows:

Note. The need to run as root, as it will interact with systemd and create / update processes within the system.

Executable program

An executable program considered for this tool basically contains:

Post install script

You can create a bash script to run after installation. For now, this script could do anything.
To help localization, an environment variable 'INSTALL_DIR' has been added.

Use pid file

Could be configured to use a pid file to control service.
For this, place an "control-by-pid" in service config:

An pid file is created in \var\run\MyApp.pid when start and removed when stops.

Select shell to use

To help service load / run using all configs, linux shell is called on execution and "sh" is used for default.
Just one config is allowed, to change this, place an "shell" in service config with "bash":

Restart on failure

Systemd could restart service if service fails.
For this, place an "restart-on-abort" in service config:

Kill child process

Seting "kill-child" to false will make systemd to let all child of the main process alive on stop / restart.
For this, place an "kill-child" in service config:

Remember to manually kill all remaining process to prevent system mem overflow.

Require app

With "require" set in your config.json you could set which app your application depends.
Ex. If you have application called "myCar", you can set "require", like this:

With this, Install whill install "engine" and "wheelsNtires" before install "myCar"
Note 1. This will be handled automatically when called from \BrunoNatali\Install\Factory::installAll().

To handle manually, an 'require-installed' must be passed to install()

Note 2. In the above example, don't matther what is the value of require-installed item (*EXCEPT FOR 'force' that is reserved internally), just need to be registered as a key.

Require service

Configures systemd.unit 'Requires' to defined service

After service

Configures systemd.unit 'After' specific service

Install

The recommended way to install this library is through Composer. New to Composer?

This project follows SemVer. This will install the latest supported version:

This project aims to run on Linux and thus does not require any PHP extensions, but actually not tested in all environments. If you find a bug, please report.

License

MIT, see LICENSE file.


All versions of install with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
brunonatali/tools Version >=0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brunonatali/install contains the following files

Loading the files please wait ....