This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace common\ActiveRecordTrait; | |
use yii\db\ActiveQuery; | |
use yii\db\ActiveRecord; | |
trait WithoutTrait | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace common\models; | |
trait MasterTrait | |
{ | |
public static function getDb() | |
{ | |
$connection = clone \Yii::$app->getDb(); | |
$connection->enableSlaves = false; | |
return $connection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
* Usage: | |
* | |
* const gracefulShutdown = require('./app/utils/gracefulShutdown'); | |
* | |
* const server = app.listen(port, callback) | |
* | |
* gracefulShutdown.init(server, logger); |