-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.php
executable file
·30 lines (27 loc) · 1.02 KB
/
install.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
<?php
/**
* @author mail[at]doerr-softwaredevelopment[dot]com Joachim Doerr
* @package redaxo5
* @license MIT
*/
/** @var rex_addon $this */
include_once(__DIR__ . '/db.php');
// 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'));
}
// final create profiles
\Cke5\Handler\Cke5ExtensionHandler::updateOrCreateProfiles();
} catch (rex_sql_exception $e) {
rex_logger::logException($e);
print rex_view::error($e->getMessage());
}