| @@ -130,8 +130,10 @@ | ||
| 130 | 130 | * |
| 131 | 131 | * @return void |
| 132 | 132 | */ |
| 133 | 133 | public function install() { |
| 134 | + // Initialize. | |
| 135 | + $result = FALSE; | |
| 134 | 136 | // Read input! |
| 135 | 137 | $rOperation = $this->input['operation']; |
| 136 | 138 | $type = $rOperation['type']; |
| 137 | 139 | // Get allowed operations with their state! |
| @@ -162,14 +164,36 @@ | ||
| 162 | 164 | $operation['state'] = self::OPERATION_STATE_INSTALLED; |
| 163 | 165 | // Update operations cache to reflect the new state! |
| 164 | 166 | update_option(self::INSTALLATION_STATE, $operations); |
| 165 | 167 | // Say OK! |
| 166 | - $this->response = array('state' => self::OPERATION_STATE_INSTALLED); | |
| 168 | + $result = array('state' => self::OPERATION_STATE_INSTALLED); | |
| 167 | 169 | } |
| 168 | 170 | } |
| 169 | 171 | } |
| 172 | + return $result; | |
| 170 | 173 | } |
| 171 | 174 | |
| 175 | + /** | |
| 176 | + * put your comment there... | |
| 177 | + * | |
| 178 | + */ | |
| 179 | + public function isCommonRelease() { | |
| 180 | + // Check weather the current installed version is in the same | |
| 181 | + // release with the running version. | |
| 182 | + // Get instaleled version components. | |
| 183 | + $ivComponent = explode('.', str_replace('-', '.', $this->getInstalledDbVersion())); | |
| 184 | + $nvComponent = explode('.', str_replace('-', '.', CJTPlugin::DB_VERSION)); | |
| 185 | + // Use PE-Edition sign if not sign used! | |
| 186 | + if (!isset($ivComponent[2])) { | |
| 187 | + $ivComponent[2] = 'PE'; | |
| 188 | + } | |
| 189 | + if (!isset($nvComponent[2])) { | |
| 190 | + $nvComponent[2] = 'PE'; | |
| 191 | + } | |
| 192 | + // TRUE if same, FALSE otherwise. | |
| 193 | + return (($ivComponent[0] == $nvComponent[0]) && ($ivComponent[2] == $nvComponent[2])); | |
| 194 | + } | |
| 195 | + | |
| 172 | 196 | /** |
| 173 | 197 | * put your comment there... |
| 174 | 198 | * |
| 175 | 199 | */ |