Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
Constants
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
72
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
72
1<?php
2
3namespace NewfoldLabs\WP\Module\Migration\Data;
4
5use function NewfoldLabs\WP\Context\getContext;
6
7/**
8 * Manages all the constants for the Migration module.
9 */
10class Constants {
11    /**
12     * Constructor for the Constants class.
13     *
14     * @param object $container Plugin container instance.
15     */
16    public function __construct( $container ) {
17        // Basic plugin constants.
18        defined( 'NFD_MIGRATION_PLUGIN_URL' ) || define( 'NFD_MIGRATION_PLUGIN_URL', $container->plugin()->url );
19        defined( 'NFD_MIGRATION_DIR' ) || define( 'NFD_MIGRATION_DIR', __DIR__ );
20
21        // Determine brand-specific values.
22        $plugin_brand = $container->plugin()->id;
23        $proxy_brand  = $plugin_brand;
24
25        if ( 'atomic' === getContext( 'platform' ) ) {
26            $plugin_brand = 'bh-cloud';
27        }
28
29        // Define brand-dependent constants.
30        defined( 'NFD_MIGRATION_PROXY_WORKER' ) || define( 'NFD_MIGRATION_PROXY_WORKER', 'https://migrate.' . $proxy_brand . '.com' );
31        defined( 'BRAND_PLUGIN' ) || define( 'BRAND_PLUGIN', $plugin_brand );
32        defined( 'INSTAWP_MIGRATE_ENDPOINT' ) || define( 'INSTAWP_MIGRATE_ENDPOINT', 'migrate/' . $plugin_brand );
33        defined( 'NFD_MIGRATION_BRAND_WHITELIST' ) || define( 'NFD_MIGRATION_BRAND_WHITELIST', array( 'bluehost', 'hostgator' ) );
34    }
35}