Download the PHP package muckiware/facility-plugin without Composer

On this page you can find all versions of the php package muckiware/facility-plugin. 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 facility-plugin

MuckiFacilityPlugin

Muckiware Facility Plugin for Shopware 6 Web shops for to maintenance and backup of the database.

Requirements

Installation

General Configuration

Plugin configuration under:
Settings -> Extensions -> My extensions -> MuckiFacilityPlugin -> Configure

Option Desc
Global settings - Active Turn plugin on/off global
Global backup settings -> Active database backup Turn backup database on/off global, for cli command
Global backup settings -> Compress database backup file Turn on/off compressen for db dump, for cli command
Global backup settings -> Use own restic path Turn on/off own restic
Global backup settings -> Own path to binary of restic Enter the absolut path to binary file of restic. Example input:

Respoitory Configuration

First you will need a repository configuration for the backup. The repository configuration is the base for the backup process. The repository configuration contains the backup source and the backup target. The backup source is the path to the folder or file which should be backuped. The backup target is the path to the repository where the backup data should be restored.

Settings -> Extensions -> Backup Repositories -> Add Repository
for to create a new repository configuration.

General Configuration Setup

Option Desc
Active Turn repository on/off
Technical Name Free choose as a technical name, is just for better to organize the backup configurations
Database dump type Choose the typ of database dump backup. As separate dump files for each table, only one dump file for the complete database, or none database dump.
Repository Path Absolute path to the backup repository folder. Note that this path cannot be changed after creation!
Hostname Client hostname for the backup snapshots, default hostname is muwa-facility-client
Repository Password The backup repository will be encryped by a password. Remembering this password is very important! If you lose it, you won’t be able to get access to the data stored in the repository outside of the shop functionality. Note that this password cannot be changed after creation!
Restore Path Enter here the absolute path for the target of the restored data.

Backup Paths

Use the Add backup path-button for to define the files and folders which should be backup. You can choose a complete folder, or a single file.

You can define for each path item a compress option. If the compress option is active, the backup data will be compressed by gzip. For folders which containing mainly compressed image files, additional compression during backup would make less sense.

Delete of snapshots

You can remove old snapshots of a repository with the command.

This setup defines the daily, weekly, month or yearly values for this remove process. More details about the keep-parameters you can find in the restic documentation https://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy

Initial Backup

Finally, click on the Create new Repository-button, for to create a new backup repository. This action creates then a configuration item in the shop database. And it creates the backup repository folder which is defined in the Repository Path field.

like this:

Create Backup

cli

You can create a backup by the command line interface with the following command:

Administration panel

You can also create a backup in the administration panel.

This action does not start the backup process immediately, it will be started as a background process. After a short while, you can see under the checks-tab the status of the backup checks, as well as the snapshots of each database and path item in the Snapshots-tab

Command Line Interface

Command Desc
Checks a backup repository
Creates a new backup by backup repository configuration
Removes snapshots of a backup repository by forget parameters
Gets a list of snapshots in a backup repository id
Restore data by backup repository id and snapshot id
Creates just a database dump by global plugin setups

Cronjob

You can create a cronjob for to create a backup automatically. This should be the usual configuration for creating backups. The cronjob should be executed by the user which is running the shopware instance. The following command is an example for the cronjob configuration:

The first row creates a backup every day at 3:00 am. The second row removes old snapshots every day at 5:30 am.

Database dumps

Backups via command line interface are possible with the following commands:

Option backup type Desc
completeDatabaseSingleFile (default) Backup the complete database as single file. The backup is stored in the directory var/backup/db/ with the filename YYYY-MM-DD_HH-MM-SS_db_backup.sql.gz
completeDatabaseSeparateFiles Backup the complete database as single file for each database table. The backup is stored in the directory var/backup/YYYY-MM-DD with the filename YYYY-MM-DD_HH-MM-SS_tablename.sql.gz

This command execute a backup of the database. The backup is stored in the directory var/backup/db/ with the filename db_backup_YYYY-MM-DD_HH-MM-SS.sql.gz

Restore

As long as the shopware instance is running, you can restore the backup data via cli like this:

Or you can choose the snapshot id from the list of snapshots in the administration panel.

But if the shop instance is not running anymore, you can use the native restic commands for to restore the backup data.

Checkout the description of the restic command for more information. https://restic.readthedocs.io/en/stable/050_restore.html#

Database cleanup

This command offers a more effective option to clean up database tables as the origin Shopware function and free up more memory.

Cart Cleanup

Example

Testing

phpstan

Install

Install phpstan, if required

Execute

Unit test

Execute first time

Execute regular run


All versions of facility-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.1
spatie/db-dumper Version ^3.7
muckiware/restic Version ^1.4
gabrielelana/byte-units Version ^0.5.0
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 muckiware/facility-plugin contains the following files

Loading the files please wait ...