|
77 | 77 | }
|
78 | 78 | }
|
79 | 79 |
|
80 |
| - |
| 80 | + |
81 | 81 | if (isset($CONFIG['db']['unix_socket'])) {
|
82 | 82 | $str_db_connexion = "--socket=" . $CONFIG['db']['unix_socket'] . " --user=" . $CONFIG['db']['username'] . " --password='" . $CONFIG['db']['password'] . "' " . $CONFIG['db']['dbname'];
|
83 | 83 | } else {
|
|
90 | 90 | $tables = DB::Prepare("SHOW TABLES", array(), DB::FETCH_TYPE_ALL);
|
91 | 91 | foreach ($tables as $table) {
|
92 | 92 | $table = array_values($table)[0];
|
93 |
| - if($table == 'event'){ |
| 93 | + if ($table == 'event') { |
94 | 94 | continue;
|
95 | 95 | }
|
96 |
| - echo "Checking table ".$table."..."; |
97 |
| - system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables '.$table); |
| 96 | + echo "Checking table " . $table . "..."; |
| 97 | + system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables ' . $table); |
98 | 98 | echo "OK" . "\n";
|
99 | 99 | }
|
100 |
| - |
| 100 | + |
101 | 101 | echo 'Backing up database...';
|
102 | 102 | if (file_exists($jeedom_dir . "/DB_backup.sql")) {
|
103 | 103 | unlink($jeedom_dir . "/DB_backup.sql");
|
|
109 | 109 | throw new Exception('can\'t delete database backup. Check rights');
|
110 | 110 | }
|
111 | 111 | system("mysqldump " . $str_db_connexion . " > " . $jeedom_dir . "/DB_backup.sql", $rc);
|
112 |
| - |
| 112 | + |
113 | 113 | if ($rc != 0) {
|
114 | 114 | throw new Exception('Backing up database failed. Check mysqldump installation. Code: ' . $rc);
|
115 | 115 | }
|
|
130 | 130 |
|
131 | 131 | $excludes = array(
|
132 | 132 | 'tmp',
|
133 |
| - 'log', |
| 133 | + './log', |
134 | 134 | 'docs',
|
135 | 135 | 'doc',
|
136 | 136 | 'tests',
|
|
195 | 195 | if ($value['scope']['backup'] === false) {
|
196 | 196 | continue;
|
197 | 197 | }
|
198 |
| - if (config::byKey($key . '::enable','core',0) == 0) { |
| 198 | + if (config::byKey($key . '::enable', 'core', 0) == 0) { |
199 | 199 | continue;
|
200 | 200 | }
|
201 |
| - if (config::byKey($key . '::cloudUpload','core',0) == 0) { |
| 201 | + if (config::byKey($key . '::cloudUpload', 'core', 0) == 0) { |
202 | 202 | continue;
|
203 | 203 | }
|
204 | 204 | $class = 'repo_' . $key;
|
|
0 commit comments