Body_Classes.php
2 weeks ago
Crons.php
2 weeks ago
Debug_Bar.php
2 weeks ago
Dialog.php
2 weeks ago
PUE.php
2 weeks ago
Processes.php
2 weeks ago
Promoter.php
2 weeks ago
Shortcodes.php
2 weeks ago
Tooltip.php
2 weeks ago
Widgets.php
2 weeks ago
PUE.php
51 lines
| 1 | <?php |
| 2 | namespace Tribe\Service_Providers; |
| 3 | |
| 4 | use Tribe\PUE\Update_Prevention; |
| 5 | |
| 6 | /** |
| 7 | * Hooks and manages the implementation and loading of PUE. |
| 8 | * |
| 9 | * We are still moving pieces into this Service Provider, so look around |
| 10 | * the `src/Tribe/PUE/` folder for other items that are not managed here |
| 11 | * just yet. |
| 12 | * |
| 13 | * @since 4.9.12 |
| 14 | */ |
| 15 | class PUE extends \tad_DI52_ServiceProvider { |
| 16 | /** |
| 17 | * Binds and sets up implementations. |
| 18 | * |
| 19 | * @since 4.9.12 |
| 20 | */ |
| 21 | public function register() { |
| 22 | $this->container->singleton( Update_Prevention::class, Update_Prevention::class ); |
| 23 | |
| 24 | // Setup all of WP hooks associated with PUE. |
| 25 | $this->register_hooks(); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Registers the provider handling all the 1st level filters and actions for PUE. |
| 30 | * |
| 31 | * @since 4.9.2 |
| 32 | */ |
| 33 | protected function register_hooks() { |
| 34 | add_filter( 'upgrader_source_selection', [ $this, 'filter_upgrader_source_selection' ], 15, 4 ); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Filters the source file location for the upgrade package for the PUE Update_Prevention engine. |
| 39 | * |
| 40 | * @since 4.9.12 |
| 41 | * |
| 42 | * @param string $source File source location. |
| 43 | * @param string $remote_source Remote file source location. |
| 44 | * @param WP_Upgrader $upgrader WP_Upgrader instance. |
| 45 | * @param array $extra Extra arguments passed to hooked filters. |
| 46 | */ |
| 47 | public function filter_upgrader_source_selection( $source, $remote_source, $upgrader, $extras ) { |
| 48 | return $this->container->make( Update_Prevention::class )->filter_upgrader_source_selection( $source, $remote_source, $upgrader, $extras ); |
| 49 | } |
| 50 | } |
| 51 |