@@ -44,6 +44,11 @@ discard block |
||
| 44 | 44 | * Rename backup archive |
| 45 | 45 | * |
| 46 | 46 | */ |
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * @param string $old_name |
|
| 50 | + * @param string $new_name |
|
| 51 | + */ |
|
| 47 | 52 | public function rename_archive($old_name, $new_name) |
| 48 | 53 | { |
| 49 | 54 | $this->logger->info(sprintf("Renaming backup archive %s to %s", $old_name, $new_name)); |
@@ -108,6 +113,10 @@ discard block |
||
| 108 | 113 | * Send notification error by E-Mail |
| 109 | 114 | * |
| 110 | 115 | */ |
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * @param string $error_message |
|
| 119 | + */ |
|
| 111 | 120 | public function send_notification_error($to, $from, $subject, $backup_name, $params, $error_message) |
| 112 | 121 | { |
| 113 | 122 | |
@@ -132,6 +141,11 @@ discard block |
||
| 132 | 141 | * Send backup archive notfication by E-Mail |
| 133 | 142 | * |
| 134 | 143 | */ |
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * @param string $from |
|
| 147 | + * @param string $subject |
|
| 148 | + */ |
|
| 135 | 149 | public function send_notification($to, $from, $subject, $backup_name, $params, $error_message="") |
| 136 | 150 | { |
| 137 | 151 | if(!$from) |
@@ -204,6 +218,10 @@ discard block |
||
| 204 | 218 | * Incremental Backup method |
| 205 | 219 | * |
| 206 | 220 | */ |
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * @param integer $init |
|
| 224 | + */ |
|
| 207 | 225 | public function start_incremental_backup($backup_params, $extra_params, $init) |
| 208 | 226 | { |
| 209 | 227 | if(!isset($extra_params['backup_part'])) |
@@ -416,6 +434,10 @@ discard block |
||
| 416 | 434 | * Write multipart file components |
| 417 | 435 | * |
| 418 | 436 | */ |
| 437 | + |
|
| 438 | + /** |
|
| 439 | + * @param string $path |
|
| 440 | + */ |
|
| 419 | 441 | private function write_multipart_file($path) |
| 420 | 442 | { |
| 421 | 443 | $path = $this->get_archive_name_with_extension(); |
@@ -475,6 +497,10 @@ discard block |
||
| 475 | 497 | * Add file to archive |
| 476 | 498 | * |
| 477 | 499 | */ |
| 500 | + |
|
| 501 | + /** |
|
| 502 | + * @param integer $append |
|
| 503 | + */ |
|
| 478 | 504 | public function add_file_to_archive($file_info, $start_at_byte, $byte_limit = 0, $append, $filesystem) |
| 479 | 505 | { |
| 480 | 506 | |
@@ -469,6 +469,11 @@ |
||
| 469 | 469 | * handler $fd - file handler where to write the records |
| 470 | 470 | * @return |
| 471 | 471 | */ |
| 472 | + |
|
| 473 | + /** |
|
| 474 | + * @param integer $start |
|
| 475 | + * @param integer $limit |
|
| 476 | + */ |
|
| 472 | 477 | public function export_table($databaseName, $tableName, $start, $limit, $dumpfile) |
| 473 | 478 | { |
| 474 | 479 | $this->logger->debug(sprintf(("Exporting table %s.%s data"), $databaseName, $tableName)); |
@@ -186,6 +186,9 @@ discard block |
||
| 186 | 186 | return $total; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | + /** |
|
| 190 | + * @param string $backup_name |
|
| 191 | + */ |
|
| 189 | 192 | public function is_part($backup_name) |
| 190 | 193 | { |
| 191 | 194 | if(stristr($backup_name, "-part")) |
@@ -576,6 +579,9 @@ discard block |
||
| 576 | 579 | |
| 577 | 580 | } |
| 578 | 581 | |
| 582 | + /** |
|
| 583 | + * @param string $tmp_file |
|
| 584 | + */ |
|
| 579 | 585 | public function estimate_reading_time($tmp_file) |
| 580 | 586 | { |
| 581 | 587 | $this->logger->debug(sprintf(("Estimating file system reading time"))); |
@@ -614,6 +620,9 @@ discard block |
||
| 614 | 620 | return $name; |
| 615 | 621 | } |
| 616 | 622 | |
| 623 | + /** |
|
| 624 | + * @param string $field |
|
| 625 | + */ |
|
| 617 | 626 | public function sort_by( &$array, $field, $direction = 'asc') |
| 618 | 627 | { |
| 619 | 628 | $direction = strtolower($direction); |
@@ -87,6 +87,9 @@ |
||
| 87 | 87 | return ftell($fp); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @param string $filename |
|
| 92 | + */ |
|
| 90 | 93 | function curl_file_create($filename, $mimetype = '', $postname = '') { |
| 91 | 94 | if (!function_exists('curl_file_create')) { |
| 92 | 95 | |
@@ -142,6 +142,9 @@ |
||
| 142 | 142 | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $storage_type |
|
| 147 | + */ |
|
| 145 | 148 | public function verify_filesystem($storage_type) |
| 146 | 149 | { |
| 147 | 150 | $method = "get_".$storage_type."_filesystem"; |
@@ -22,6 +22,9 @@ discard block |
||
| 22 | 22 | return $filename; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @return string |
|
| 27 | + */ |
|
| 25 | 28 | public function get_xcloner_start_path() |
| 26 | 29 | { |
| 27 | 30 | if(!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
@@ -39,6 +42,9 @@ discard block |
||
| 39 | 42 | return $path; |
| 40 | 43 | } |
| 41 | 44 | |
| 45 | + /** |
|
| 46 | + * @return string |
|
| 47 | + */ |
|
| 42 | 48 | public function get_xcloner_store_path() |
| 43 | 49 | { |
| 44 | 50 | if(!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
@@ -175,6 +181,9 @@ discard block |
||
| 175 | 181 | return $wpdb->prefix; |
| 176 | 182 | } |
| 177 | 183 | |
| 184 | + /** |
|
| 185 | + * @param string $option |
|
| 186 | + */ |
|
| 178 | 187 | public function get_xcloner_option($option) |
| 179 | 188 | { |
| 180 | 189 | $data = get_option($option); |
@@ -115,6 +115,9 @@ |
||
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $message |
|
| 120 | + */ |
|
| 118 | 121 | public function trigger_message($message, $status = "error", $message_param1 = "", $message_param2 = "", $message_param3 = "") |
| 119 | 122 | { |
| 120 | 123 | $message = sprintf(__($message), $message_param1, $message_param2, $message_param3); |