<?php namespace MailPoet\Config; if (!defined('ABSPATH')) exit; use MailPoetVendor\Idiorm\ORM; use PDO; class Database { public function init(PDO $pdo) { ORM::setDb($pdo); $this->setupLogging(); $this->defineTables(); } public function setupLogging() { ORM::configure('logging', WP_DEBUG); } public function defineTables() { if (!defined('MP_SETTINGS_TABLE')) { define('MP_SETTINGS_TABLE', Env::$dbPrefix . 'settings'); define('MP_SEGMENTS_TABLE', Env::$dbPrefix . 'segments'); define('MP_FORMS_TABLE', Env::$dbPrefix . 'forms'); define('MP_CUSTOM_FIELDS_TABLE', Env::$dbPrefix . 'custom_fields'); define('MP_SUBSCRIBERS_TABLE', Env::$dbPrefix . 'subscribers'); define('MP_SUBSCRIBER_SEGMENT_TABLE', Env::$dbPrefix . 'subscriber_segment'); define('MP_SUBSCRIBER_CUSTOM_FIELD_TABLE', Env::$dbPrefix . 'subscriber_custom_field'); define('MP_SUBSCRIBER_IPS_TABLE', Env::$dbPrefix . 'subscriber_ips'); define('MP_NEWSLETTER_SEGMENT_TABLE', Env::$dbPrefix . 'newsletter_segment'); define('MP_SCHEDULED_TASKS_TABLE', Env::$dbPrefix . 'scheduled_tasks'); define('MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE', Env::$dbPrefix . 'scheduled_task_subscribers'); define('MP_SENDING_QUEUES_TABLE', Env::$dbPrefix . 'sending_queues'); define('MP_NEWSLETTERS_TABLE', Env::$dbPrefix . 'newsletters'); define('MP_NEWSLETTER_TEMPLATES_TABLE', Env::$dbPrefix . 'newsletter_templates'); define('MP_NEWSLETTER_OPTION_FIELDS_TABLE', Env::$dbPrefix . 'newsletter_option_fields'); define('MP_NEWSLETTER_OPTION_TABLE', Env::$dbPrefix . 'newsletter_option'); define('MP_NEWSLETTER_LINKS_TABLE', Env::$dbPrefix . 'newsletter_links'); define('MP_NEWSLETTER_POSTS_TABLE', Env::$dbPrefix . 'newsletter_posts'); define('MP_STATISTICS_NEWSLETTERS_TABLE', Env::$dbPrefix . 'statistics_newsletters'); define('MP_STATISTICS_CLICKS_TABLE', Env::$dbPrefix . 'statistics_clicks'); define('MP_STATISTICS_OPENS_TABLE', Env::$dbPrefix . 'statistics_opens'); define('MP_STATISTICS_UNSUBSCRIBES_TABLE', Env::$dbPrefix . 'statistics_unsubscribes'); define('MP_STATISTICS_FORMS_TABLE', Env::$dbPrefix . 'statistics_forms'); define('MP_STATISTICS_WOOCOMMERCE_PURCHASES_TABLE', Env::$dbPrefix . 'statistics_woocommerce_purchases'); define('MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE', Env::$dbPrefix . 'mapping_to_external_entities'); define('MP_LOG_TABLE', Env::$dbPrefix . 'log'); define('MP_STATS_NOTIFICATIONS_TABLE', Env::$dbPrefix . 'stats_notifications'); define('MP_USER_FLAGS_TABLE', Env::$dbPrefix . 'user_flags'); define('MP_FEATURE_FLAGS_TABLE', Env::$dbPrefix . 'feature_flags'); define('MP_DYNAMIC_SEGMENTS_FILTERS_TABLE', Env::$dbPrefix . 'dynamic_segment_filters'); } } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
PopulatorData | Folder | 0700 |
|
|
AccessControl.php | File | 3.23 KB | 0644 |
|
Activator.php | File | 2.22 KB | 0644 |
|
AssetsLoader.php | File | 801 B | 0644 |
|
Capabilities.php | File | 2.8 KB | 0644 |
|
Changelog.php | File | 3.9 KB | 0644 |
|
Database.php | File | 2.78 KB | 0644 |
|
DatabaseInitializer.php | File | 601 B | 0644 |
|
DeferredAdminNotices.php | File | 1.07 KB | 0644 |
|
Env.php | File | 3.93 KB | 0644 |
|
Hooks.php | File | 10.32 KB | 0644 |
|
HooksWooCommerce.php | File | 3.97 KB | 0644 |
|
Initializer.php | File | 9.92 KB | 0644 |
|
Installer.php | File | 2.69 KB | 0644 |
|
Localizer.php | File | 1.15 KB | 0644 |
|
MP2Migrator.php | File | 35.34 KB | 0644 |
|
Menu.php | File | 14.04 KB | 0644 |
|
Migrator.php | File | 25.73 KB | 0644 |
|
PersonalDataErasers.php | File | 622 B | 0644 |
|
PersonalDataExporters.php | File | 2.64 KB | 0644 |
|
PluginActivatedHook.php | File | 682 B | 0644 |
|
Populator.php | File | 29.67 KB | 0644 |
|
PrivacyPolicy.php | File | 3.37 KB | 0644 |
|
Renderer.php | File | 3.95 KB | 0644 |
|
RendererFactory.php | File | 474 B | 0644 |
|
RequirementsChecker.php | File | 4.3 KB | 0644 |
|
Router.php | File | 846 B | 0644 |
|
ServicesChecker.php | File | 4.93 KB | 0644 |
|
Shortcodes.php | File | 6.22 KB | 0644 |
|
Updater.php | File | 1.71 KB | 0644 |
|
index.php | File | 0 B | 0644 |
|