1 | <?php |
||
5 | trait SyncTrait |
||
6 | { |
||
7 | abstract public function warn($string, $verbosity = null); |
||
8 | |||
9 | /** |
||
10 | * Switch to `sync` database. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | protected function switchToSyncDb() |
||
22 | |||
23 | /** |
||
24 | * Dump `sync` database into a SQL file and return its path. |
||
25 | * |
||
26 | * @param boolean $isPreview |
||
27 | * @return string |
||
28 | */ |
||
29 | protected function dumpSync(bool $isPreview, string $connector = 'mysql'): string |
||
43 | |||
44 | /** |
||
45 | * Dump SQL database in given file path. |
||
46 | * |
||
47 | * @param string $path |
||
48 | * @param string $connector |
||
49 | * @return void |
||
50 | */ |
||
51 | protected function dumpSql(string $path, string $connector) |
||
66 | |||
67 | protected function getConnector(bool $isPreview, string $connector = 'mysql'): string |
||
77 | |||
78 | |||
79 | /** |
||
80 | * Put previous dump in live-preview database. |
||
81 | * |
||
82 | * @param string $path |
||
83 | * @param boolean $isPreview |
||
84 | * @return void |
||
85 | */ |
||
86 | protected function putSync(string $path, bool $isPreview, string $connector = 'mysql') |
||
97 | |||
98 | /** |
||
99 | * Put SQL file into given database. |
||
100 | * |
||
101 | * @param string $path |
||
102 | * @param string $connector |
||
103 | * @return void |
||
104 | */ |
||
105 | protected function putSql(string $path, string $connector) |
||
120 | } |
||
121 |