PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.2.8
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.2.8
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / inc / 3rd-party / nextgen-gallery / classes / DB.php

DB.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.2.8, at inc/3rd-party/nextgen-gallery/classes/DB.php

118 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Imagify\ThirdParty\NGG;
3
4 use Imagify\Traits\InstanceGetterTrait;
5
6 /**
7 * Imagify NextGen Gallery DB class.
8 *
9 * @since 1.5
10 * @author Jonathan Buttigieg
11 */
12 class DB extends \Imagify_Abstract_DB {
13 use InstanceGetterTrait;
14
15 /**
16 * Class version.
17 *
18 * @var string
19 */
20 const VERSION = '1.1.1';
21
22 /**
23 * The suffix used in the name of the database table (so, without the wpdb prefix).
24 *
25 * @var string
26 * @since 1.7
27 * @access protected
28 */
29 protected $table = 'ngg_imagify_data';
30
31 /**
32 * The version of our database table.
33 *
34 * @var int
35 * @since 1.5
36 * @since 1.7 Not public anymore, now an integer.
37 * @access protected
38 */
39 protected $table_version = 100;
40
41 /**
42 * Tell if the table is the same for each site of a Multisite.
43 *
44 * @var bool
45 * @since 1.7
46 * @access protected
47 */
48 protected $table_is_global = false;
49
50 /**
51 * The name of the primary column.
52 *
53 * @var string
54 * @since 1.5
55 * @since 1.7 Not public anymore.
56 * @access protected
57 */
58 protected $primary_key = 'pid';
59
60 /**
61 * Whitelist of columns.
62 *
63 * @since 1.5
64 * @access public
65 * @author Jonathan Buttigieg
66 *
67 * @return array
68 */
69 public function get_columns() {
70 return [
71 'data_id' => '%d',
72 'pid' => '%d',
73 'optimization_level' => '%s',
74 'status' => '%s',
75 'data' => '%s',
76 ];
77 }
78
79 /**
80 * Default column values.
81 *
82 * @since 1.5
83 * @access public
84 * @author Jonathan Buttigieg
85 *
86 * @return array
87 */
88 public function get_column_defaults() {
89 return [
90 'data_id' => 0,
91 'pid' => 0,
92 'optimization_level' => '',
93 'status' => '',
94 'data' => [],
95 ];
96 }
97
98 /**
99 * Get the query to create the table fields.
100 *
101 * @since 1.7
102 * @access protected
103 * @author Grégory Viguier
104 *
105 * @return string
106 */
107 protected function get_table_schema() {
108 return "
109 data_id int(11) unsigned NOT NULL AUTO_INCREMENT,
110 pid int(11) unsigned NOT NULL default 0,
111 optimization_level varchar(1) NOT NULL default '',
112 status varchar(30) NOT NULL default '',
113 data longtext NOT NULL default '',
114 PRIMARY KEY (data_id),
115 KEY pid (pid)";
116 }
117 }
118