Download the PHP package codedge/laravel-selfupdater without Composer

On this page you can find all versions of the php package codedge/laravel-selfupdater. 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 laravel-selfupdater

Laravel Application Self-Updater

Latest Stable Version Total Downloads StyleCI Codacy Badge codecov

This package provides some basic methods to implement a self updating functionality for your Laravel application.

Supported update provider:

Usually you need this when distributing a self-hosted Laravel application that needs some updating mechanism without Composer.

Install

To install the latest version from the master using Composer:

Configuration

After installing the package you need to publish the configuration file via

Note: Please enter correct value for vendor and repository name in your config/self-updater.php if you want to use Github as source for your updates.

Setting the currently installed version

Before starting an update, make sure to set the version installed correctly. You're responsible to set the current version installed, either in the config file or better via the env variable SELF_UPDATER_VERSION_INSTALLED.

tag-based updates

Set the installed version to one of the tags set for a release.

branch-based updates

Set the installed version to a datetime of one of the latest commits.
A valid version would be: 2020-04-19T22:35:48Z

Running artisan commands

Artisan commands can be run before or after the update process and can be configured in config/self-updater.php:

Example:

Configure the download path

Sometimes your web host does not allow saving files into the /tmp folder of the server. You can change the folder the application is downloaded to by setting the env var SELF_UPDATER_DOWNLOAD_PATH to something different. Just keep in mind, that the folder is not inside the folder your application lives in as it might be overwritten during the update.

Notifications via email

You need to specify a recipient email address and a recipient name to receive update available notifications. You can specify these values by adding SELF_UPDATER_MAILTO_NAME and SELF_UPDATER_MAILTO_ADDRESS to your .env file.

Config name Description
SELF_UPDATER_MAILTO_NAME Name of email recipient
SELF_UPDATER_MAILTO_ADDRESS Address of email recipient
SELF_UPDATER_MAILTO_UPDATE_AVAILABLE_SUBJECT Subject of update available email
SELF_UPDATER_MAILTO_UPDATE_SUCCEEDED_SUBJECT Subject of update succeeded email

Private repositories

Private repositories can be accessed via (Bearer) tokens. Each repository inside the config file should have a private_access_token field, where you can set the token.

ℹ Do not prefix the token with Bearer. This is done automatically.

Usage

To start an update process, i. e. in a controller, just use:

Currently, the fetching of the source is a synchronous process. It is not run in background.

Using GitHub

The package comes with a GitHub source repository type to fetch releases from GitHub - basically use GitHub to pull the latest version of your software.

Just make sure you set the proper repository in your config/self-updater.php file.

Tag-based updates

This is the default. Updates will be fetched by using a tagged commit, aka release.

Tag-based updates with assets/package file

If you have pre-packaged tag based releases, you can use the 'repository_types.github.package_file_name' key in your config/self-update.php file or update the SELF_UPDATER_PACKAGE_FILE_NAME .env var to specify the asset name to download.

If you prefix the file name with regex: the package will try to find the latest asset matching the given regex. Note however to use only the regex and not the PHP regex / prefix and suffixes. For example, an acceptable value would be regex:.releaseV*\.zip. This will match all assets starting with releaseV and ending with .zip.

An invalid value would be regex:/releaseV*\.zip/. Note the / prefix and suffix.

Branch-based updates

Select the branch that should be used via the use_branch setting inside the configuration.

Using Gitlab

Configure Gitlab either via the config/self-updater.php or use the appropriate environment variables.

ℹ Although the environment variable is named SELF_UPDATER_REPO_URL, only specify your repository id.

For self-hosted Gitlab instances you can set the base_url variable to a domain where the instance is hosted at, f. ex. http://gitlab.acme.local.

Using HTTP archives

The package comes with an HTTP source repository type to fetch releases from an HTTP directory listing containing zip archives.

To run with HTTP archives, use following settings in your .env file:

Config name Value / Description
SELF_UPDATER_SOURCE http
SELF_UPDATER_REPO_URL Archive URL, e.g. http://archive.webapp/
SELF_UPDATER_PKG_FILENAME_FORMAT Zip package filename format
SELF_UPDATER_DOWNLOAD_PATH Download path on the webapp host server

The archive URL should contain nothing more than a simple directory listing with corresponding zip-Archives.

SELF_UPDATER_PKG_FILENAME_FORMAT contains the filename format for all webapp update packages. I.e. when the update packages listed on the archive URL contain names like webapp-v1.2.0.zip, webapp-v1.3.5.zip, ... then the format should be webapp-v_VERSION_. The _VERSION_ part is used as semantic versionioning variable for MAJOR.MINOR.PATCH versioning. The zip-extension is automatically added.

The target archive files must be zip archives and should contain all files on root level, not within an additional folder named like the archive itself.

Using Gitea

With Gitea you can use your own Gitea-Instance with tag-releases.

To use it, use the following settings in your .env file:

Config name Value / Description
SELF_UPDATER_SOURCE gitea
SELF_UPDATER_GITEA_URL URL of Gitea Server
SELF_UPDATER_REPO_VENDOR Repo Vendor Name
SELF_UPDATER_REPO_NAME Repo Name
SELF_UPDATER_GITEA_PRIVATE_ACCESS_TOKEN Access Token from Gitea
SELF_UPDATER_DOWNLOAD_PATH Download path on the webapp host server

Contributing

Please see the contributing guide.

Licence

The MIT License (MIT). Please see Licence file for more information.


All versions of laravel-selfupdater with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
ext-zip Version *
guzzlehttp/guzzle Version ^7.5.0
illuminate/support Version ^10 || ^11.0
league/uri Version ~6.7 || ~6.8 || ^7.4
phpstan/extension-installer Version ^1.2
phpstan/phpstan-phpunit Version ^1.2
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 codedge/laravel-selfupdater contains the following files

Loading the files please wait ....