forked from yakamara/yform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.php
35 lines (28 loc) · 891 Bytes
/
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
31
32
33
34
35
<?php
/**
* @var rex_addon $this
* @psalm-scope-this rex_addon
*/
try {
// transaction test.
$testSQL = rex_sql::factory();
$testSQL->transactional(static function () {
rex_sql::factory()->setQuery('SELECT * from rex_user LIMIT 1');
});
} catch (Exception $e) {
throw new rex_exception('db does not support transactions: ' . $e->getMessage(), $e);
}
// old plugin docs still exists ? -> delete
$pluginDocs = __DIR__ . '/plugins/docs';
if (file_exists($pluginDocs)) {
rex_dir::delete($pluginDocs);
}
foreach ($this->getInstalledPlugins() as $plugin) {
// use path relative to __DIR__ to get correct path in update temp dir
$file = __DIR__ . '/plugins/' . $plugin->getName() . '/install.php';
if (file_exists($file)) {
$plugin->includeFile($file);
}
}
rex_dir::delete($this->getDataPath('fonts'));
rex_autoload::removeCache();