-
Notifications
You must be signed in to change notification settings - Fork 4
/
update.php
34 lines (30 loc) · 1.11 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* @author mail[at]doerr-softwaredevelopment[dot]com Joachim Doerr
* @package redaxo5
* @license MIT
*/
/** @var rex_addon $this */
include_once (__DIR__ . '/db.php');
try {
if (rex_version::compare($this->getVersion(), '3.3.0', '<')) {
// copy custom data to assets folder
if (!file_exists(rex_path::assets('addons/cke5_custom_data'))) {
mkdir(rex_path::assets('addons/cke5_custom_data'));
}
if (!file_exists(rex_path::assets('addons/cke5_custom_data/custom-style.css'))) {
rex_file::copy($this->getPath('custom_data/custom-styles.css'), rex_path::assets('addons/cke5_custom_data/custom-style.css'));
}
}
if (rex_version::compare($this->getVersion(), '5.2.0', '>')) {
try {
rex_sql::factory()->setQuery('DROP TABLE IF EXISTS ' . rex::getTablePrefix() . 'cke5_mblock_demo');
} catch (rex_sql_exception $e) {
rex_logger::logException($e);
}
}
} catch (rex_functional_exception $e) {
rex_logger::logException($e);
}
$addon = rex_addon::get('cke5');
$addon->setConfig('updated', true);