PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.20
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.20
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / central / classes / class-updraftcentral-wp-upgrader.php

class-updraftcentral-wp-upgrader.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.20, at central/classes/class-updraftcentral-wp-upgrader.php

50 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH') || !defined('UPDRAFTCENTRAL_CLIENT_DIR')) die('No access.');
4
5 /**
6 * The extended class of Plugin_Upgrader that is mostly used for overriding some of the parent methods to short-circuit their native behaviour or to manipulate some data, parameters and/or method arguments
7 */
8 class UpdraftCentral_Plugin_Upgrader extends Plugin_Upgrader {
9
10 /**
11 * Run an upgrade/installation
12 *
13 * @param Array $options {
14 * Array or string of arguments for upgrading/installing a package.
15 *
16 * @type bool $clear_destination Whether to delete any files already in the destination folder. Default false. (since 2.8.0)
17 * }
18 *
19 * @return Array|False|WP_Error The result from self::install_package() on success, otherwise a WP_Error,
20 * or false if unable to connect to the filesystem.
21 */
22 public function run($options) {
23 $options['clear_destination'] = true; // force overwritting the existing one, in case WP < 5.5.0 is in use where "overwrite_package" parameter doesn't exist
24 return parent::run($options);
25 }
26 }
27
28 /**
29 * The extended class of Plugin_Upgrader that is mostly used for overriding some of the parent methods to short-circuit their native behaviour or to manipulate some data, parameters and/or method arguments
30 */
31 class UpdraftCentral_Theme_Upgrader extends Theme_Upgrader {
32
33 /**
34 * Run an upgrade/installation
35 *
36 * @param Array $options {
37 * Array or string of arguments for upgrading/installing a package.
38 *
39 * @type bool $clear_destination Whether to delete any files already in the destination folder. Default false. (since 2.8.0)
40 * }
41 *
42 * @return Array|False|WP_Error The result from self::install_package() on success, otherwise a WP_Error,
43 * or false if unable to connect to the filesystem.
44 */
45 public function run($options) {
46 $options['clear_destination'] = true; // force overwritting the existing one, in case WP < 5.5.0 is in use where "overwrite_package" parameter doesn't exist
47 return parent::run($options);
48 }
49 }
50