PluginProbe
MailPoet – Newsletters, Email Marketing, and Automation / 3.90.2
MailPoet – Newsletters, Email Marketing, and Automation v3.90.2
5.38.0 5.37.0 5.36.1 5.36.0 5.35.1 5.35.0 5.34.3 5.34.2 5.34.1 5.34.0 5.33.1 5.33.0 5.32.0 5.31.0 5.30.0 5.29.0 5.28.1 5.28.0 5.27.0 5.26.0 5.26.1 5.25.0 5.24.0 4.43.0 4.43.1 All 542 releases
mailpoet / lib / Config / Database.php

Database.php in MailPoet – Newsletters, Email Marketing, and Automation 3.90.2, at lib/Config/Database.php

57 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MailPoet\Config;
4
5 if (!defined('ABSPATH')) exit;
6
7
8 use MailPoetVendor\Idiorm\ORM;
9 use PDO;
10
11 class Database {
12 public function init(PDO $pdo) {
13 ORM::setDb($pdo);
14 $this->setupLogging();
15 $this->defineTables();
16 }
17
18 public function setupLogging() {
19 ORM::configure('logging', WP_DEBUG);
20 }
21
22 public function defineTables() {
23 if (!defined('MP_SETTINGS_TABLE')) {
24 define('MP_SETTINGS_TABLE', Env::$dbPrefix . 'settings');
25 define('MP_SEGMENTS_TABLE', Env::$dbPrefix . 'segments');
26 define('MP_FORMS_TABLE', Env::$dbPrefix . 'forms');
27 define('MP_CUSTOM_FIELDS_TABLE', Env::$dbPrefix . 'custom_fields');
28 define('MP_SUBSCRIBERS_TABLE', Env::$dbPrefix . 'subscribers');
29 define('MP_SUBSCRIBER_SEGMENT_TABLE', Env::$dbPrefix . 'subscriber_segment');
30 define('MP_SUBSCRIBER_CUSTOM_FIELD_TABLE', Env::$dbPrefix . 'subscriber_custom_field');
31 define('MP_SUBSCRIBER_IPS_TABLE', Env::$dbPrefix . 'subscriber_ips');
32 define('MP_NEWSLETTER_SEGMENT_TABLE', Env::$dbPrefix . 'newsletter_segment');
33 define('MP_SCHEDULED_TASKS_TABLE', Env::$dbPrefix . 'scheduled_tasks');
34 define('MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE', Env::$dbPrefix . 'scheduled_task_subscribers');
35 define('MP_SENDING_QUEUES_TABLE', Env::$dbPrefix . 'sending_queues');
36 define('MP_NEWSLETTERS_TABLE', Env::$dbPrefix . 'newsletters');
37 define('MP_NEWSLETTER_TEMPLATES_TABLE', Env::$dbPrefix . 'newsletter_templates');
38 define('MP_NEWSLETTER_OPTION_FIELDS_TABLE', Env::$dbPrefix . 'newsletter_option_fields');
39 define('MP_NEWSLETTER_OPTION_TABLE', Env::$dbPrefix . 'newsletter_option');
40 define('MP_NEWSLETTER_LINKS_TABLE', Env::$dbPrefix . 'newsletter_links');
41 define('MP_NEWSLETTER_POSTS_TABLE', Env::$dbPrefix . 'newsletter_posts');
42 define('MP_STATISTICS_NEWSLETTERS_TABLE', Env::$dbPrefix . 'statistics_newsletters');
43 define('MP_STATISTICS_CLICKS_TABLE', Env::$dbPrefix . 'statistics_clicks');
44 define('MP_STATISTICS_OPENS_TABLE', Env::$dbPrefix . 'statistics_opens');
45 define('MP_STATISTICS_UNSUBSCRIBES_TABLE', Env::$dbPrefix . 'statistics_unsubscribes');
46 define('MP_STATISTICS_FORMS_TABLE', Env::$dbPrefix . 'statistics_forms');
47 define('MP_STATISTICS_WOOCOMMERCE_PURCHASES_TABLE', Env::$dbPrefix . 'statistics_woocommerce_purchases');
48 define('MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE', Env::$dbPrefix . 'mapping_to_external_entities');
49 define('MP_LOG_TABLE', Env::$dbPrefix . 'log');
50 define('MP_STATS_NOTIFICATIONS_TABLE', Env::$dbPrefix . 'stats_notifications');
51 define('MP_USER_FLAGS_TABLE', Env::$dbPrefix . 'user_flags');
52 define('MP_FEATURE_FLAGS_TABLE', Env::$dbPrefix . 'feature_flags');
53 define('MP_DYNAMIC_SEGMENTS_FILTERS_TABLE', Env::$dbPrefix . 'dynamic_segment_filters');
54 }
55 }
56 }
57