class DbConnection
{
private string $userName;
private string $password;
private string $dbname;
public function __construct(string $userName, string $password, string $dbName)
{
$this->userName = $userName;
$this->password = $password;
$this->dbname = $dbName;
}
}
class AuthController
{
private DbConnection $dbConnection;
public function __construct(DbConnection $connection)
{
$this->dbConnection = $connection;
}
}
$dbSettings = include('dbconfig.php');
$connection = new DbConnection($dbSettings['login'], $dbSettings['password'], $dbSettings['dbName'] );
$controller = new AuthController($connection);
return [
'login'=>'myLogin',
'password'=>'myPassword',
'dbName'=>'myDbName'
];
columns=>[
'id',
'name',
'email'
]
'columns' => [
[
'label' => $title,
'attribute' => 'name',
'value' => function ($model) {
return $model['name'] . $model['surname'];
},
],
'age',
]
FROM linuxserver/deluge;
RUN apt update && apt install -y my-lib
xdebug.mode = debug
xdebug.client_host=127.0.0.1
xdebug.start_with_request=trigger
xdebug.client_port = 9000
# (но рекомендую использовать стандартный 9003 порт, т.к. на 9000 вешается fpm в стандартных конфигах часто)
yii init --env api-tests
подсовывать другой конфиг контейнера, нужный для этих тестов. if (isset($_GET['apitests']) && $_GET['apitests'] ==true && $_SERVER['HTTP_CLIENT_IP'] == '{IP ADDR}'){
return $devContainerConfig;
}
return $prodContainerConfig;