wp-optimize
/
vendor
/
team-updraft
/
lib-central
/
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 4.7.0, at vendor/team-updraft/lib-central/central/classes/class-updraftcentral-wp-upgrader.php
| 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 |