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
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-03-30