Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/flexible-shipping-pro   php

Repository URL to install this package:

Version: 1.11.1 

/ wpdesk / wp-wpdesk-tracker / src / data_provider / class-wpdesk-tracker-data-provider-license-emails.php

<?php

namespace FSProVendor;

/**
 * WP Desk Tracker
 *
 * @class        WPDESK_Tracker
 * @version        1.3.2
 * @package        WPDESK/Helper
 * @category    Class
 * @author        WP Desk
 */
if (!\defined('ABSPATH')) {
    exit;
}
if (!\class_exists('FSProVendor\\WPDesk_Tracker_Data_Provider_License_Emails')) {
    /**
     * Class WPDesk_Tracker_Data_Provider_License_Emails
     */
    class WPDesk_Tracker_Data_Provider_License_Emails implements \WPDesk_Tracker_Data_Provider
    {
        /**
         * Info about license emails from api manager.
         *
         * @return array Data provided to tracker.
         */
        public function get_data()
        {
            global $wpdesk_helper_plugins;
            $license_emails_email = array();
            $license_emails = array();
            if (!isset($wpdesk_helper_plugins)) {
                $wpdesk_helper_plugins = array();
            }
            foreach ($wpdesk_helper_plugins as $key => $plugin) {
                if (isset($plugin['api_manager'])) {
                    $api_manager = $plugin['api_manager'];
                    if (isset($api_manager->options[$api_manager->activation_email])) {
                        $license_emails_email[$api_manager->options[$api_manager->activation_email]] = $api_manager->options[$api_manager->activation_email];
                    }
                }
            }
            foreach ($license_emails_email as $email) {
                $license_emails[] = $email;
            }
            $data['license_emails'] = $license_emails;
            return $data;
        }
    }
}