generated from FriendsOfREDAXO/rex_repo_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
36 lines (30 loc) · 1019 Bytes
/
install.php
File metadata and controls
36 lines (30 loc) · 1019 Bytes
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
/**
* Code Editor AddOn Installation
*/
$addon = rex_addon::get('code');
// Backup-Verzeichnis erstellen
$backupDir = $addon->getDataPath('backups');
if (!is_dir($backupDir)) {
rex_dir::create($backupDir);
}
// Htaccess für Backup-Schutz
$htaccessContent = "Order Deny,Allow\nDeny from all";
rex_file::put($backupDir . '/.htaccess', $htaccessContent);
// Standard-Konfiguration setzen (falls noch nicht vorhanden)
if (!$addon->hasConfig('replace_rex_code')) {
$addon->setConfig('replace_rex_code', '1'); // Standardmäßig aktiviert
}
if (!$addon->hasConfig('enable_file_browser')) {
$addon->setConfig('enable_file_browser', '1');
}
if (!$addon->hasConfig('auto_backup_on_save')) {
$addon->setConfig('auto_backup_on_save', '1');
}
if (!$addon->hasConfig('backup_limit')) {
$addon->setConfig('backup_limit', '10');
}
if (!$addon->hasConfig('trash_limit')) {
$addon->setConfig('trash_limit', '50');
}
#$this->setProperty('installmsg', 'Code Editor wurde erfolgreich installiert!');