Beispiel #1
0
/**
 * Load the SI application
 * (function called at the bottom of this page)
 *
 * @package EDD_Segment
 * @return void
 */
function edd_segment_load()
{
    if (class_exists('EDD_Segment')) {
        edd_segment_deactivate_plugin();
        return;
        // already loaded, or a name collision
    }
    do_action('edd_segment_preload');
    //////////
    // Load //
    //////////
    // Master class
    require_once EDD_SEGMENT_PATH . '/Segment.php';
    // controllers
    require_once EDD_SEGMENT_PATH . '/controllers/_Controller.php';
    EDD_Segment_Controller::init();
    if (!class_exists('SA_Settings_API')) {
        require_once EDD_SEGMENT_PATH . '/controllers/_Settings.php';
        SA_Settings_API::init();
    }
    require_once EDD_SEGMENT_PATH . '/controllers/Settings.php';
    EDD_Segment_Settings::init();
    require_once EDD_SEGMENT_PATH . '/controllers/Identity.php';
    EDD_Segment_Identity::init();
    require_once EDD_SEGMENT_PATH . '/controllers/integrations/Segment_API.php';
    EDD_Segment_Tracker::init();
    require_once EDD_SEGMENT_PATH . '/controllers/integrations/CustomerIO_API.php';
    EDD_CustomerIO_Tracker::init();
    if (file_exists(EDD_SEGMENT_PATH . '/controllers/add-ons/AJAX_Callbacks.php')) {
        require_once EDD_SEGMENT_PATH . '/controllers/add-ons/AJAX_Callbacks.php';
        EDD_Segment_AJAX_Callbacks::init();
    }
    if (file_exists(EDD_SEGMENT_PATH . '/controllers/add-ons/Freemius_Webhook.php')) {
        require_once EDD_SEGMENT_PATH . '/controllers/add-ons/Freemius_Webhook.php';
        EDD_Segment_Freemius_Webhook::init();
    }
    require_once EDD_SEGMENT_PATH . '/controllers/add-ons/EDD_Hooks.php';
    EDD_Segment_Hooks::init();
    require_once EDD_SEGMENT_PATH . '/controllers/Updates.php';
    EDD_Segment_Updates::init();
    require_once EDD_SEGMENT_PATH . '/template-tags/edd-segment.php';
    do_action('edd_segment_loaded');
}
/**
 * Load the SI application
 * (function called at the bottom of this page)
 *
 * @package Sprout_Invoices
 * @return void
 */
function sprout_invoices_load()
{
    if (class_exists('Sprout_Invoices')) {
        error_log('** Sprout_Invoices Already Loaded **');
        return;
        // already loaded, or a name collision
    }
    do_action('sprout_invoices_preload');
    //////////
    // Load //
    //////////
    // Master class
    require_once SI_PATH . '/Sprout_Invoices.class.php';
    // base classes
    require_once SI_PATH . '/models/_Model.php';
    require_once SI_PATH . '/controllers/_Controller.php';
    do_action('si_require_base_classes');
    // models
    require_once SI_PATH . '/models/Client.php';
    require_once SI_PATH . '/models/Estimate.php';
    require_once SI_PATH . '/models/Invoice.php';
    require_once SI_PATH . '/models/Notification.php';
    require_once SI_PATH . '/models/Payment.php';
    require_once SI_PATH . '/models/Record.php';
    // Premium models
    require_once SI_PATH . '/models/Project.php';
    // i18n
    require_once SI_PATH . '/controllers/i18n/Countries_States.php';
    require_once SI_PATH . '/controllers/i18n/Locales.php';
    do_action('si_require_model_classes');
    /////////////////
    // Controllers //
    /////////////////
    // settings
    require_once SI_PATH . '/controllers/admin/Settings.php';
    if (!class_exists('SA_Settings_API')) {
        require_once SI_PATH . '/controllers/admin/Settings_API.php';
    }
    require_once SI_PATH . '/controllers/admin/Capabilities.php';
    require_once SI_PATH . '/controllers/admin/Help.php';
    // json api
    require_once SI_PATH . '/controllers/api/JSON_API.php';
    // checkouts
    require_once SI_PATH . '/controllers/checkout/Checkouts.php';
    // clients
    require_once SI_PATH . '/controllers/clients/Clients.php';
    // developer logs
    require_once SI_PATH . '/controllers/developer/Logs.php';
    // Estimates
    require_once SI_PATH . '/controllers/estimates/Estimate_Submission.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/estimates/Estimate_Submission_Premium.php')) {
        require_once SI_PATH . '/controllers/estimates/Estimate_Submission_Premium.php';
    }
    require_once SI_PATH . '/controllers/estimates/Estimates.php';
    require_once SI_PATH . '/controllers/estimates/Estimates_Admin.php';
    require_once SI_PATH . '/controllers/estimates/Estimates_Edit.php';
    require_once SI_PATH . '/controllers/estimates/Estimates_Records.php';
    require_once SI_PATH . '/controllers/estimates/Estimates_Template.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/estimates/Estimates_Premium.php')) {
        require_once SI_PATH . '/controllers/estimates/Estimates_Premium.php';
    }
    // invoices
    require_once SI_PATH . '/controllers/invoices/Invoices.php';
    require_once SI_PATH . '/controllers/invoices/Invoices_Admin.php';
    require_once SI_PATH . '/controllers/invoices/Invoices_Edit.php';
    require_once SI_PATH . '/controllers/invoices/Invoices_Records.php';
    require_once SI_PATH . '/controllers/invoices/Invoices_Template.php';
    require_once SI_PATH . '/controllers/invoices/Invoices_Deposit.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/invoices/Invoices_Premium.php')) {
        require_once SI_PATH . '/controllers/invoices/Invoices_Premium.php';
    }
    // Line Items
    require_once SI_PATH . '/controllers/line-items/Line_Items.php';
    // notifications
    require_once SI_PATH . '/controllers/notifications/Notifications_Control.php';
    require_once SI_PATH . '/controllers/notifications/Notifications.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/notifications/Notifications_Premium.php')) {
        require_once SI_PATH . '/controllers/notifications/Notifications_Premium.php';
    }
    require_once SI_PATH . '/controllers/notifications/Notifications_Admin_Table.php';
    // payment processing
    require_once SI_PATH . '/controllers/payment-processing/Payment_Processors.php';
    require_once SI_PATH . '/controllers/payment-processing/Credit_Card_Processors.php';
    require_once SI_PATH . '/controllers/payment-processing/Offsite_Processors.php';
    // payment processors
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_EC.php')) {
        require_once SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_EC.php';
    }
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_Pro.php')) {
        require_once SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_Pro.php';
    }
    require_once SI_PATH . '/controllers/payment-processing/processors/SI_Checks.php';
    require_once SI_PATH . '/controllers/payment-processing/processors/SI_Admin_Payment.php';
    do_action('si_payment_processors_loaded');
    // payments
    require_once SI_PATH . '/controllers/payments/Payments.php';
    require_once SI_PATH . '/controllers/payments/Payments_Admin_Table.php';
    // Projects
    require_once SI_PATH . '/controllers/projects/Projects.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/projects/Projects_Premium.php')) {
        require_once SI_PATH . '/controllers/projects/Projects_Premium.php';
    }
    // internal records
    require_once SI_PATH . '/controllers/records/Internal_Records.php';
    require_once SI_PATH . '/controllers/records/Records_Admin_Table.php';
    // reporting
    require_once SI_PATH . '/controllers/reporting/Dashboard.php';
    require_once SI_PATH . '/controllers/reporting/Reporting.php';
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/reporting/Reporting_Premium.php')) {
        require_once SI_PATH . '/controllers/reporting/Reporting_Premium.php';
    }
    require_once SI_PATH . '/controllers/templating/Templating.php';
    require_once SI_PATH . '/controllers/templating/Customizer.php';
    // updates
    if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/updates/Updates.php')) {
        require_once SI_PATH . '/controllers/updates/Updates.php';
    }
    if (file_exists(SI_PATH . '/controllers/updates/Free_License.php')) {
        require_once SI_PATH . '/controllers/updates/Free_License.php';
    }
    // importers
    require_once SI_PATH . '/importers/Importer.php';
    require_once SI_PATH . '/importers/Freshbooks.php';
    require_once SI_PATH . '/importers/Harvest.php';
    require_once SI_PATH . '/importers/WP-Invoice.php';
    require_once SI_PATH . '/importers/CSV.php';
    do_action('si_importers_loaded');
    // Fix others problems
    require_once SI_PATH . '/controllers/compat/Compatibility.php';
    // all done
    do_action('si_require_controller_classes');
    // Template tags
    require_once SI_PATH . '/template-tags/estimates.php';
    require_once SI_PATH . '/template-tags/clients.php';
    require_once SI_PATH . '/template-tags/forms.php';
    require_once SI_PATH . '/template-tags/invoices.php';
    require_once SI_PATH . '/template-tags/line-items.php';
    require_once SI_PATH . '/template-tags/projects.php';
    require_once SI_PATH . '/template-tags/ui.php';
    require_once SI_PATH . '/template-tags/utility.php';
    require_once SI_PATH . '/template-tags/docs.php';
    // l18n
    require_once SI_PATH . '/languages/SI_l10n.php';
    require_once SI_PATH . '/languages/SI_Strings.php';
    // i18n & l10n
    SI_l10n::init();
    SI_Strings::load_additional_strings();
    SI_Locales::init();
    SI_Countries_States::init();
    ///////////////////
    // init() models //
    ///////////////////
    do_action('si_models_init');
    SI_Post_Type::init();
    // _Model
    SI_Record::init();
    SI_Notification::init();
    SI_Invoice::init();
    SI_Estimate::init();
    SI_Client::init();
    SI_Payment::init();
    SI_Project::init();
    /////////////////////////
    // init() controllers //
    /////////////////////////
    do_action('si_controllers_init');
    SI_Controller::init();
    SA_Settings_API::init();
    SI_Templating_API::init();
    SI_Customizer::init();
    SI_Admin_Capabilities::init();
    // updates
    if (!SI_FREE_TEST && class_exists('SI_Updates')) {
        SI_Updates::init();
    }
    if (class_exists('SI_Free_License')) {
        SI_Free_License::init();
    }
    // api
    SI_JSON_API::init();
    // reports
    SI_Dashboard::init();
    SI_Reporting::init();
    if (!SI_FREE_TEST && class_exists('SI_Reporting_Premium')) {
        SI_Reporting_Premium::init();
    }
    // records and logs
    SI_Internal_Records::init();
    SI_Dev_Logs::init();
    // settings
    SI_Admin_Settings::init();
    // payments and processing
    SI_Payment_Processors::init();
    SI_Payments::init();
    // notifications
    SI_Notifications::init();
    // Hooks come before parent class.
    if (!SI_FREE_TEST && class_exists('SI_Notifications_Premium')) {
        SI_Notifications_Premium::init();
    }
    SI_Notifications_Control::init();
    // clients
    SI_Clients::init();
    // estimates
    SI_Estimates::init();
    if (!SI_FREE_TEST && class_exists('SI_Estimates_Premium')) {
        SI_Estimates_Premium::init();
    }
    if (!SI_FREE_TEST && class_exists('SI_Estimates_Submission_Premium')) {
        SI_Estimates_Submission_Premium::init();
    }
    SI_Estimate_Submissions::init();
    SI_Estimates_Admin::init();
    SI_Estimates_Edit::init();
    SI_Estimates_Template::init();
    SI_Estimates_Records::init();
    // checkouts
    SI_Checkouts::init();
    // invoices
    SI_Invoices::init();
    SI_Invoices_Admin::init();
    SI_Invoices_Edit::init();
    SI_Invoices_Template::init();
    SI_Invoices_Records::init();
    SI_Invoices_Deposit::init();
    if (!SI_FREE_TEST && class_exists('SI_Invoices_Premium')) {
        SI_Invoices_Premium::init();
    }
    // Line items
    SI_Line_Items::init();
    // projects
    SI_Projects::init();
    if (!SI_FREE_TEST && class_exists('SI_Projects_Premium')) {
        SI_Projects_Premium::init();
    }
    // importer
    SI_Importer::init();
    // help
    SI_Help::init();
    // Compat
    SI_Compatibility::init();
    // addons
    require_once SI_PATH . '/add-ons/Addons.php';
    require_once SI_PATH . '/add-ons/updates/edd_plugin_updater.class.php';
    SA_Addons::init();
    do_action('sprout_invoices_loaded');
}
/**
 * Load the SC application
 *
 * @package Sprout_Clients
 * @return void
 */
function sprout_clients_load()
{
    if (class_exists('Sprout_Client')) {
        sc_deactivate_plugin();
        return;
        // already loaded, or a name collision
    }
    do_action('sprout_clients_preload');
    //////////
    // Load //
    //////////
    /**
     * Master class
     */
    require_once SC_PATH . '/Sprout_Clients.php';
    // models
    require_once SC_PATH . '/models/_Model.php';
    require_once SC_PATH . '/models/Client.php';
    require_once SC_PATH . '/models/Message.php';
    require_once SC_PATH . '/models/Record.php';
    // controllers
    require_once SC_PATH . '/controllers/_Controller.php';
    require_once SC_PATH . '/languages/Sprout_Clients_l10n.php';
    if (!class_exists('Sprout_Invoices')) {
        require_once SC_PATH . '/controllers/admin/_Settings.php';
    }
    require_once SC_PATH . '/controllers/admin/Settings.php';
    // controllers -- clients
    require_once SC_PATH . '/controllers/clients/Clients.php';
    require_once SC_PATH . '/controllers/clients/Clients_Users.php';
    require_once SC_PATH . '/controllers/clients/Clients_Admin_Meta_Boxes.php';
    require_once SC_PATH . '/controllers/clients/Clients_Admin_Table.php';
    require_once SC_PATH . '/controllers/clients/Clients_AJAX.php';
    // controllers -- history
    require_once SC_PATH . '/controllers/history/Client_History.php';
    require_once SC_PATH . '/controllers/history/SI_History.php';
    // controllers -- messages
    require_once SC_PATH . '/controllers/messages/Messages.php';
    require_once SC_PATH . '/controllers/messages/Message_Triggers.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Meta_Boxes.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Settings.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Table.php';
    require_once SC_PATH . '/controllers/messages/Messages_Route.php';
    require_once SC_PATH . '/controllers/messages/Messages_Shortcodes.php';
    require_once SC_PATH . '/controllers/messages/Messages_Templates.php';
    require_once SC_PATH . '/controllers/records/Internal_Records.php';
    require_once SC_PATH . '/controllers/records/Records_Admin_Table.php';
    require_once SC_PATH . '/controllers/updates/Updates.php';
    // template-tags
    require_once SC_PATH . '/template-tags/sprout-clients.php';
    require_once SC_PATH . '/template-tags/forms.php';
    require_once SC_PATH . '/template-tags/ui.php';
    require_once SC_PATH . '/template-tags/users.php';
    require_once SC_PATH . '/template-tags/utility.php';
    /**
     * Master Model
     */
    SC_Post_Type::init();
    /**
     * Client Model
     */
    Sprout_Client::init();
    /**
     * Messages Model
     */
    SC_Message::init();
    /**
     * Shared Models
     */
    SC_Record::init();
    /**
     * Master Controller
     */
    SC_Controller::init();
    /**
     * Records is shared with Sprout Invoices
     */
    SC_Internal_Records::init();
    /**
     * l10n
     */
    SC_l10n::init();
    /**
     * Settings
     */
    if (!class_exists('Sprout_Invoices')) {
        SA_Settings_API::init();
    }
    SC_Settings::init();
    /**
     * Clients
     */
    SC_Clients::init();
    SC_Users::init();
    SC_Clients_Admin_Meta_Boxes::init();
    SC_Clients_Admin_Table::init();
    SC_Clients_AJAX::init();
    SC_Client_History::init();
    SC_Invoices_History::init();
    /**
     * Messaging
     */
    /*/
    	SC_Messages::init();
    	SC_Messages_Meta::init();
    	SC_Messages_Admin_Settings::init();
    	SC_Messages_Route::init();
    	SC_Message_Shortcodes::init();
    	SC_Templates::init();
    	SC_Message_Triggers::init();
    	/**/
    SC_Updates::init();
    do_action('sprout_clients_loaded');
}