-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall.php
More file actions
executable file
·36 lines (31 loc) · 1.38 KB
/
install.php
File metadata and controls
executable file
·36 lines (31 loc) · 1.38 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
<?php
/** @var rex_addon $this */
use Cke5\Handler\Cke5ExtensionHandler;
include_once(__DIR__ . '/db.php');
// Setze den Standard-Lizenzschlüssel auf "GPL"
if ($this->getConfig('license_code') === null) {
$this->setConfig('license_code', 'GPL');
}
$this->setConfig('restore_files', true);
// install default demo profiles
try {
$sql = rex_sql::factory();
if (sizeof($sql->getArray("SELECT id FROM " . rex::getTable('cke5_profiles') . " WHERE id=1")) <= 0) {
rex_sql_util::importDump($this->getPath('data.sql'));
}
// 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 (!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'));
}
// final create profiles
Cke5ExtensionHandler::updateOrCreateProfiles();
} catch (rex_sql_exception $e) {
rex_logger::logException($e);
print rex_view::error($e->getMessage());
}