/var/www/html_de/wp-content/plugins/wp-smtp/src/Mail/Migration/Provider.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

namespace SolidWP\Mail\Migration;

use 
SolidWP\Mail\Contracts\Service_Provider;

if ( ! 
defined'ABSPATH' ) ) {
    exit;
}

/**
 * The provider for all Admin related functionality.
 *
 * @since 1.3.0
 *
 * @package SolidWP\Mail
 */
class Provider extends Service_Provider {

    
/**
     * Database version
     */
    
private const OPTION_VERSION_NAME 'solid_smtp_version';

    
/**
     * {@inheritdoc}
     */
    
public function register(): void {
        
$this->container->getMigrationVer130::class )->register_hooks();
        
add_action'wp_loaded', fn() => $this->migrate() );
    }

    private function 
migrate(): void {
        
$version get_optionself::OPTION_VERSION_NAME'' );

        if ( 
version_compare$versionWPSMTP_VERSION'==' ) ) {
            return;
        }

        
$this->container->getMigrationVer130::class )->migration$version );
        
$this->container->getMigrationVer210::class )->migration$version );
        
$this->container->getMigrationVer221::class )->migration$version );

        
update_optionself::OPTION_VERSION_NAMEWPSMTP_VERSION );
    }
}