PluginProbe
CSS & JavaScript Toolbox / 6.0.15
CSS & JavaScript Toolbox v6.0.15
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | models/installer.php +36 -35 126.0.15 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 -*
3 +*
4 4 */
5 5
6 6 // Disallow direct access.
7 7 defined('ABSPATH') or die("Access denied");
@@ -6,52 +6,52 @@
6 6 // Disallow direct access.
7 7 defined('ABSPATH') or die("Access denied");
8 8
9 9 /**
10 -*
10 +*
11 11 */
12 12 class CJTInstallerModel {
13 -
13 +
14 14 /**
15 - *
15 + *
16 16 */
17 17 const OPERATION_STATE_INSTALLED = 'installed';
18 -
18 +
19 19 /**
20 - *
20 + *
21 21 */
22 22 const INSTALLATION_STATE = 'state.CJTInstallerModel.operations';
23 -
23 +
24 24 /**
25 - *
25 + *
26 26 */
27 27 const NOTICED_DISMISSED_OPTION_NAME = 'settings.CJTInstallerModel.noticeDismissed';
28 -
28 +
29 29 /**
30 30 * put your comment there...
31 - *
31 + *
32 32 * @var mixed
33 33 */
34 34 protected $input;
35 -
35 +
36 36 /**
37 37 * put your comment there...
38 - *
38 + *
39 39 * @var mixed
40 40 */
41 41 protected $installedDbVersion;
42 -
42 +
43 43 /**
44 44 * put your comment there...
45 - *
45 + *
46 46 */
47 47 public function __construct() {
48 48 $this->installedDbVersion = get_option(CJTPlugin::DB_VERSION_OPTION_NAME);
49 49 }
50 -
50 +
51 51 /**
52 52 * put your comment there...
53 - *
53 + *
54 54 * @param mixed $dismiss
55 55 */
56 56 public function dismissNotice($dismiss = null) {
57 57 // Read current value!
@@ -61,20 +61,20 @@
61 61 update_user_option(get_current_user_id(), self::NOTICED_DISMISSED_OPTION_NAME, true);
62 62 }
63 63 return $currentValue;
64 64 }
65 -
65 +
66 66 /**
67 67 * put your comment there...
68 - *
68 + *
69 69 */
70 70 public function getInstalledDbVersion() {
71 71 return $this->installedDbVersion;
72 72 }
73 -
73 +
74 74 /**
75 75 * put your comment there...
76 - *
76 + *
77 77 */
78 78 public function getInternalVersionName() {
79 79 return str_replace(array('.', '-'), '', $this->installedDbVersion);
80 80 }
@@ -80,9 +80,9 @@
80 80 }
81 81
82 82 /**
83 83 * Get installer operations for current CJT version!
84 - *
84 + *
85 85 * @return array Operations list metadata.
86 86 */
87 87 public function getOperations() {
88 88 // Read all install/upgrade operations for all versions!
@@ -103,11 +103,11 @@
103 103 throw new Exception("Could not find upgrade/downgrade agent for installer '{$this->installedDbVersion}'! Incompatible version numbers! Upgrader/Downgrwader is no being supported by current versions!!");
104 104 }
105 105 // Import upgrader + reflect its operations!
106 106 cssJSToolbox::import($upgrader['file']);
107 - $operations[CJTPlugin::DB_VERSION]['operations']['upgrade'] = CJTInstallerReflection::getInstance($upgrader['class'], 'CJTUpgradeNonTabledVersions')->getOperations();
107 + $operations[CJTPlugin::DB_VERSION]['operations']['upgrade'] = CJTInstallerReflection::getInstance($upgrader['class'], 'CJTUpgradeNonTabledVersions')->getOperations();
108 108 }
109 - update_option(self::INSTALLATION_STATE, $operations);
109 + update_option(self::INSTALLATION_STATE, $operations);
110 110 }
111 111 return $operations[CJTPlugin::DB_VERSION];
112 112 }
113 113
@@ -112,9 +112,9 @@
112 112 }
113 113
114 114 /**
115 115 * put your comment there...
116 - *
116 + *
117 117 */
118 118 public function getUpgrader() {
119 119 // Upgrader file.
120 120 $upgrader['file'] = "includes:installer:upgrade:{$this->getInstalledDbVersion()}:upgrade.class.php";
@@ -121,14 +121,14 @@
121 121 // Upgrader class name.
122 122 $upgrader['class'] = "CJTV{$this->getInternalVersionName()}Upgrade";
123 123 return $upgrader;
124 124 }
125 -
125 +
126 126 /**
127 127 * Allow executing of a single installation operation!
128 - * Both Install and Upgrade operations can be executed through here
129 - *
130 - *
128 + * Both Install and Upgrade operations can be executed throught here
129 + *
130 + *
131 131 * @return void
132 132 */
133 133 public function install() {
134 134 // Initialize.
@@ -168,14 +168,15 @@
168 168 $result = array('state' => self::OPERATION_STATE_INSTALLED);
169 169 }
170 170 }
171 171 }
172 + // Returns.
172 173 return $result;
173 174 }
174 -
175 +
175 176 /**
176 177 * put your comment there...
177 - *
178 + *
178 179 */
179 180 public function isCommonRelease() {
180 181 // Check weather the current installed version is in the same
181 182 // release with the running version.
@@ -194,19 +195,19 @@
194 195 }
195 196
196 197 /**
197 198 * put your comment there...
198 - *
199 + *
199 200 */
200 201 public function isUpgrade() {
201 202 // If the version is not the same and not equal to current version then its upgrading!
202 - $isUpgrade = (($this->installedDbVersion <= CJTPlugin::DB_VERSION) && ($this->installedDbVersion != ''));
203 + $isUpgrade = (($this->installedDbVersion != CJTPlugin::DB_VERSION) && ($this->installedDbVersion != ''));
203 204 return $isUpgrade;
204 205 }
205 -
206 +
206 207 /**
207 208 * put your comment there...
208 - *
209 + *
209 210 * @param mixed $input
210 211 */
211 212 public function setInput(& $input) {
212 213 $this->input = $input;
@@ -211,6 +212,6 @@
211 212 public function setInput(& $input) {
212 213 $this->input = $input;
213 214 return $this; // Chaining!
214 215 }
215 -
216 +
216 217 } // End class.