定制 mazahaler/project-connection-checker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mazahaler/project-connection-checker

Composer 安装命令:

composer require mazahaler/project-connection-checker

包简介

The extension allows to check connection to db, mail operation and secrets.json for compliance

README 文档

README

The extension allows to check for compliance secrets.json file and secrets in the project. The extension also allows to check db connections and mailing.

Requirements:

  • PHP 7.4. and higher;
  • Yii 2.0. and higher.

Installation:

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mazahaler/project-connection-checker

or add

"mazahaler/project-connection-checker": "*"

to the require section of your composer.json.

Usage:

<?php

use mazahaler\ProjectConnectionChecker\ProjectConnectionChecker;

/**
* Check secrets, db connections and mailing
 * @param 1: Root path of the project
 * @param 2: Path to secrets.json
 * @param 3: \yii\swiftmailer\Mailer class
 * @param 4: Array of db connections in format: ['Your connection title(used for error output)' => [Instance of \yii\db\Connection | \yii\mongodb\Connection]]
 */
ProjectConnectionChecker::checkAll(\Yii::getAlias('@app'), \Yii::getAlias('@app') . '/secrets/secrets.json', \Yii::$app->mailer, ['mysql' => [\Yii::$app->db], 'mongodb' => [\Yii::$app->mongodb]]);

// OR check it separately:

ProjectConnectionChecker::checkSecrets(\Yii::getAlias('@app'), \Yii::getAlias('@app') . '/secrets/secrets.json');

ProjectConnectionChecker::checkMailing(\Yii::$app->mailer);

ProjectConnectionChecker::checkConnections(['mysql' => [\Yii::$app->db], 'mongodb' => [\Yii::$app->mongodb]]);

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-03-30