Download the PHP package cusodede/yii2-history without Composer

On this page you can find all versions of the php package cusodede/yii2-history. 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 yii2-history

yii2-history

The history of all changes in ActiveRecord models

Build Status

Installation

The preferred way to install this extension is through composer.

Run

or add

to the require section of your composer.json file.

Requirements

Yii2, PHP >= 8.0

Usage

At first, run module migrations:

Connect cusodede\history\behaviors\HistoryBehavior::class to all ActiveRecord models, that require to store their history:

If you want to get the user interface and/or change default module configuration, you need to setup the module in the application config:

Module configuration

There are all the module parameters with their default values:

Parameters description:

userIdentityClass: null|string|callable. The module tries to store some user ID with the each history record, so it is required to provide proper user identity object. In most cases, that object is already configured in framework (and can be accessed via Yii::$app->user ), but in some cases (like in console applications) it is not. It also can be overridden in some cases, so it's useful to have option, like that.

viewPath: string. The module has a basic user interface for navigating histories. You may want to get your own custom interface for that, so you can provide path to custom views here.

queue: null|string|array. The proper way to make all history writings asynchronous, is to push them to a queue. The queue parameter allow you to configure own module queue. Just configure it like as in global configuration:

Also, you can use any queues, that already configured in your application. For that case just provide string queue name:

If parameter is skipped or set to null, all writings will be made synchronously, which may affect on the application speed.

storeShortClassNames: bool. Experimental option, that allows to store only short class name instead of fully qualified namespace (example: Users instead of app\models\Users).

Running local tests

Copy /tests/.env.sample to /tests/.env (change variables there, if it required in your environment) and run composer install (once) and php vendor/bin/codecept run (to execute tests).

For Docker environment, you can just execute docker-compose up -d --build command to build app containers, then run docker exec -it yii2_history_php /bin/bash to open bash console inside php container. Next, just do as written above.

Documentation ToDos:

License

GNU GPL v3.0


All versions of yii2-history with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
pozitronik/yii2-traits Version ^1.0.0
pozitronik/yii2-badgewidget Version ^2.0.0
ramsey/uuid Version ^4.0.0
yiisoft/yii2 Version ^2.0.0
yiisoft/yii2-queue Version ^2.0.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 cusodede/yii2-history contains the following files

Loading the files please wait ....