Download the PHP package nswdpc/silverstripe-pruner without Composer

On this page you can find all versions of the php package nswdpc/silverstripe-pruner. 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 silverstripe-pruner

Pruner

Removes records from the database attached to a Silverstripe project, using a queued job with configurable options.

It can be applied to any SilverStripe\ORM\DataObject record and is useful for records in tables that can continue to grow, like form submissions.

Install

Userforms support

See nswdpc/silverstripe-pruner-userforms module for silverstripe/userforms support.

Requirements

See composer.json

Configuration

Configure a project .yml file like so:

Interface

When adding a SilverStripe\ORM\DataObject to the list of target_models, these DataObjects must:

The module will ignore models passed to it that do not implement this interface.

See the PrunerInterface for documentation.

Pruning records via the queued job

The PruneJob exists to remove the relevant records from the target models.

You can pass in the following constructor arguments:

Returning a list of records to remove

While the most common list to return would be records older than the days_ago age parameter, you are in control of how records are filtered as returned from pruneList.

You can add extra filters to the query or modify/ignore the age parameter entirely. For instance, you could remove records older than a certain date and not authored by members in a specific domain.

Operations pre/post prune

In addition to the usual onBeforeDelete/onAfterDelete Silverstripe methods, the module calls onBeforePrune and onAfterPrune before/after record deletion, respectively.

The order of operation for each record removal is:

  1. onBeforePrune
  2. delete action:
    1. onBeforeDelete
    2. delete
    3. onAfterDelete
  3. onAfterPrune

You must implement these methods, even if you are not carrying out any actions pre/post record pruning.

Reporting task

A task exists to provide quick report showing what would be removed based on the arguments provided:

Report for the targeted models, older than 15 days, limit 50 records removed per model

Multiple targets can be separated by a comma. If not targets are provided, the configured value of NSWDPC\Pruner\Pruner.target_models is used.

Maintainers

License

BSD-3-Clause

Security

If you have found a security issue with this module, please email digital[@]dpc.nsw.gov.au in the first instance, detailing your findings.

Bugtracker

We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.

Please review the code of conduct prior to opening a new issue.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

Please review the code of conduct prior to completing a pull request.


All versions of silverstripe-pruner with dependencies

PHP Build Version
Package Version
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 nswdpc/silverstripe-pruner contains the following files

Loading the files please wait ....