Repository navigation
Expand file tree
/
Copy pathupdate.php
More file actions
40 lines (35 loc) · 1.6 KB
/
Copy pathupdate.php
File metadata and controls
40 lines (35 loc) · 1.6 KB
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
35
36
37
38
39
40
<?php
/** @var rex_addon $this */
include_once (__DIR__ . '/db.php');
// Setze den Standard-Lizenzschlüssel auf "GPL", falls er noch nicht existiert
if ($this->getConfig('license_code') === null || $this->getConfig('license_code') === '') {
$this->setConfig('license_code', 'GPL');
}
$this->setConfig('restore_files', true);
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);
}
}
if (rex_version::compare($this->getVersion(), '6.3.2', '>')) {
if (!file_exists(rex_path::assets('addons/cke5_custom_data/autogenerated-custom-styles.css'))) {
rex_file::copy($this->getPath('custom_data/autogenerated-custom-styles.css'), rex_path::assets('addons/cke5_custom_data/autogenerated-custom-style.css'));
}
}
} catch (rex_functional_exception $e) {
rex_logger::logException($e);
}
$addon = rex_addon::get('cke5');
$addon->setConfig('updated', true);