Download the PHP package mikamatto/reserved-values-bundle without Composer

On this page you can find all versions of the php package mikamatto/reserved-values-bundle. 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 reserved-values-bundle

ReservedValuesBundle

ReservedValuesBundle is a Symfony bundle that allows you to restrict the use of reserved values across different fields by adding custom validation rules. You can specify exact restrictions or use patterns to block specific values, applicable to any field, such as usernames, slugs, or any other user-defined attributes that require validation.

Features

Installation

1. Require the Bundle

You can install the bundle using Composer:

2. Enable the Bundle

If you're using Symfony Flex, the bundle will be enabled automatically. Otherwise, you may need to manually enable it in your config/bundles.php:

3. Configuration

You need to create a configuration file for the bundle at config/packages/reserved_values.yaml.

The format of the configuration file is as follows:

Configuration Options

Make sure to define at least one of the options under each key in your configuration file. If both sections are left empty for a key, no values will be restricted for that field.

4. Applying the Validation to an Entity

To apply the ReservedValues validation to your entity, you can use either annotations or attributes. The constraint accepts:

Here are examples using both methods:

Using Annotations

Using Attributes (Symfony 6.0+)

The validation will be bypassed if the user has either:

This allows for both global and field-specific role-based validation bypass while maintaining backward compatibility with existing code that only uses the key parameter.

Upgrading from 1.x to 2.0

Version 2.0 introduces a new configuration structure and the ability to configure multiple bypass roles. Here's how to upgrade your existing configuration:

Configuration Changes

Before (1.x)

After (2.0)

Breaking Changes

  1. All validation rules must now be placed under the keys section
  2. The role-based validation bypass is now configurable through bypass_roles
  3. The configuration structure has changed to better separate concerns

Migration Steps

  1. Add the new keys root node to your configuration
  2. Move all your existing validation rules under the keys section
  3. If you want to customize which roles can bypass validation, add the bypass_roles configuration
  4. If you don't specify bypass_roles, it defaults to ['ROLE_ADMIN']

All versions of reserved-values-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
symfony/framework-bundle Version ^5.0 || ^6.0 || ^7.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 mikamatto/reserved-values-bundle contains the following files

Loading the files please wait ....