PluginProbe
Media Cloud Sync / 1.2.0
Media Cloud Sync v1.2.0
1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 All 34 releases
media-cloud-sync / includes / config / schema.php

schema.php in Media Cloud Sync 1.2.0, at includes/config/schema.php

48 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Dudlewebs\WPMCS;
3
4 defined('ABSPATH') || exit;
5
6 class Schema {
7 private static $constants;
8 private static $service_labels;
9
10 // Static initializer to handle dynamic operations
11 static function init() {
12 self::$constants = [
13 'S3_MULTIPART_MIN_FILE_SIZE' => 5242880,
14 'GCLOUD_MULTIPART_MIN_FILE_SIZE' => 5242880,
15 'DOCEAN_MULTIPART_MIN_FILE_SIZE' => 5242880,
16 'S3COMPATIBLE_MULTIPART_MIN_FILE_SIZE' => 5242880,
17 'CACHE_GROUP' => WPMCS_TOKEN.'_cache_group',
18 'CACHE_EXPIRE' => 24*60*60,
19 'META_KEY' => WPMCS_TOKEN.'_meta_data',
20 'CONTENT_META_KEY' => WPMCS_TOKEN.'_post_meta_data',
21 'GLOBAL_SETTINGS_KEY' => WPMCS_TOKEN.'_global_settings',
22 'COUNTER_KEY' => WPMCS_TOKEN.'_counter_data',
23 'UPLOADS' => WPMCS_TOKEN.'_uploads'
24 ];
25
26 self::$service_labels = [
27 's3' => esc_html__('AWS/S3', 'media-cloud-sync'),
28 'gcloud' => esc_html__('Google Cloud Storage', 'media-cloud-sync'),
29 'docean' => esc_html__('Digital Ocean Spaces', 'media-cloud-sync'),
30 's3compatible' => esc_html__('S3 Compatible', 'media-cloud-sync')
31 ];
32 }
33
34 /**
35 * Get schema constant by key.
36 */
37 public static function getConstant($key, $default = false) {
38 return isset(self::$constants[$key]) ? self::$constants[$key] : $default;
39 }
40
41 /**
42 * Get service label by key.
43 */
44 public static function getServiceLabels($key, $default = false) {
45 return isset(self::$service_labels[$key]) ? self::$service_labels[$key] : $default;
46 }
47 }
48