-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMySQLContainer.php
More file actions
60 lines (52 loc) · 1.95 KB
/
MySQLContainer.php
File metadata and controls
60 lines (52 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
namespace TinyBlocks\DockerContainer;
/**
* Defines operations for creating and managing MySQL Docker containers.
*/
interface MySQLContainer extends DockerContainer
{
/**
* Sets the timezone for the MySQL container.
*
* @param string $timezone The desired timezone (e.g., 'America/Sao_Paulo').
* @return static The instance of the MySQL container with the timezone environment variable set.
*/
public function withTimezone(string $timezone): static;
/**
* Sets the MySQL username.
*
* @param string $user The MySQL username to configure.
* @return static The instance of the MySQL container with the username set.
*/
public function withUsername(string $user): static;
/**
* Sets the MySQL user password.
*
* @param string $password The password for the MySQL user.
* @return static The instance of the MySQL container with the password set.
*/
public function withPassword(string $password): static;
/**
* Sets the database to be created in the MySQL container.
*
* @param string $database The name of the database to create.
* @return static The instance of the MySQL container with the database set.
*/
public function withDatabase(string $database): static;
/**
* Sets the root password for MySQL.
*
* @param string $rootPassword The root password for MySQL.
* @return static The instance of the MySQL container with the root password set.
*/
public function withRootPassword(string $rootPassword): static;
/**
* Sets the hosts that the MySQL root user will have privileges for.
* The default is `['%', '172.%']`.
*
* @param array $hosts List of hosts to grant privileges to the root user.
* @return static The instance of the MySQL container with the granted hosts set.
*/
public function withGrantedHosts(array $hosts = ['%', '172.%']): static;
}