2017 © Pedro Peláez
 

cakephp-plugin cakephp3-postgres

CakePHP 3 plugin that provides classes for adding default validation rules from the database table schema.

image

jmjjg/cakephp3-postgres

CakePHP 3 plugin that provides classes for adding default validation rules from the database table schema.

  • Saturday, January 21, 2017
  • by jmjjg
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PLpgSQL
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

cakephp-postgres

Description

CakePHP 3 plugin that provides classes for adding default validation rules from the database table schema., (*1)

Caching is enabled by default but can be disabled in the configuration or at run-time., (*2)

Tested with CakePHP 3.1.0, 3.2.2., (*3)

Main classes

AutovalidateBehavior reads various informations from the database table schema... and automatically adds those validation rules to the default ones., (*4)

Setup

Assuming the plugin is installed under plugins/Postgres., (*5)

Add the following to config/bootstrap.php:, (*6)

    Plugin::load('Postgres', ['autoload' => true, 'bootstrap' => true]);

[
    // ...
    'Datasources.default.driver' => 'Postgres\Database\Driver\Postgres',
    // ...
    'Datasources.test.driver' => 'Postgres\Database\Driver\Postgres'
    // ...

Usage

The following code should be added to your table classes, inside the initialize() method., (*7)

Note that NULL and boolean TRUE and are equivalent as configuration values., (*8)

    public function initialize(array $config)
    {
        // ...
        $this->addBehavior('PostgresAutovalidate',
            [
                'className' => 'Postgres.Autovalidate',
                // Default values
                // 1°) Accepted validator names, as a string or an array of strings, NULL for any
                'accepted' => null,
                // 2°) Cache validation rules and their error messages ?
                'cache' => null,
                // 3°) Domain to use for error messages
                'domain' => 'postgres'
            ]
        );
        // ...
    }

Code quality

sudo bash -c "( rm -r logs/quality ; find . -type f -regex '^\./\(logs/.*\.log\|tmp/.*\)$' ! -name 'empty' -exec rm {} \; )"
sudo -u apache ant quality -f vendor/jmjjg/cakephp3-postgres/vendor/Jenkins/build.xml

The Versions

21/01 2017

dev-master

9999999-dev https://github.com/jmjjg/cakephp3-postgres

CakePHP 3 plugin that provides classes for adding default validation rules from the database table schema.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

postgresql cakephp validation

21/01 2017

1.0.0-RC1

1.0.0.0-RC1 https://github.com/jmjjg/cakephp3-postgres

CakePHP 3 plugin that provides classes for adding default validation rules from the database table schema.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

postgresql cakephp validation