jmjjg/cakephp3-postgres 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jmjjg/cakephp3-postgres

Composer 安装命令:

composer require jmjjg/cakephp3-postgres

包简介

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

README 文档

README

Description

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

Caching is enabled by default but can be disabled in the configuration or at run-time.

Tested with CakePHP 3.1.0, 3.2.2.

Main classes

AutovalidateBehavior reads various informations from the database table schema... and automatically adds those validation rules to the default ones.

Setup

Assuming the plugin is installed under plugins/Postgres.

Add the following to config/bootstrap.php:

    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.

Note that NULL and boolean TRUE and are equivalent as configuration values.

    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

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PLpgSQL

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2017-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固