-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathupdate.php
36 lines (32 loc) · 1.92 KB
/
update.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
36
<?php
/**
* Search it AddOn.
* @package search_it
* @var rex_addon $addon
*/
$addon = rex_addon::get('search_it');
if ($addon->pluginExists('reindex')) {
rex_dir::delete($addon->getPlugin('reindex')->getPath());
//echo rex_view::warning($addon->i18n('search_it_settings_plugin_deleted'));
}
if ($addon->pluginExists('search_highlighter')) {
rex_dir::delete($addon->getPlugin('search_highlighter')->getPath());
//echo rex_view::warning($addon->i18n('search_it_settings_plugin_deleted'));
}
if (rex_sql_table::get(rex::getTable('search_it_cacheindex_ids'))->exists() && !rex_sql_table::get(rex::getTable(rex::getTempPrefix() . 'search_it_cacheindex_ids'))->exists()) {
rex_sql_table::get(rex::getTable('search_it_cacheindex_ids'))->setName(rex::getTable(rex::getTempPrefix() . 'search_it_cacheindex_ids'))->alter();
}
if (rex_sql_table::get(rex::getTable('search_it_cache'))->exists() && !rex_sql_table::get(rex::getTable(rex::getTempPrefix() . 'search_it_cache'))->exists()) {
rex_sql_table::get(rex::getTable('search_it_cache'))->setName(rex::getTable(rex::getTempPrefix() . 'search_it_cache'))->alter();
}
if (rex_sql_table::get(rex::getTable('search_it_index'))->exists() && !rex_sql_table::get(rex::getTable(rex::getTempPrefix() . 'search_it_index'))->exists()) {
rex_sql_table::get(rex::getTable('search_it_index'))->setName(rex::getTable(rex::getTempPrefix() . 'search_it_index'))->alter();
}
if (rex_sql_table::get(rex::getTable('search_it_keywords'))->exists() && !rex_sql_table::get(rex::getTable(rex::getTempPrefix() . 'search_it_keywords'))->exists()) {
rex_sql_table::get(rex::getTable('search_it_keywords'))->setName(rex::getTable(rex::getTempPrefix() . 'search_it_keywords'))->alter();
}
\rex_sql_table::get(
\rex::getTable(rex::getTempPrefix() . 'search_it_index'))
->ensureColumn(new \rex_sql_column('lastindexed', 'VARCHAR(255)', TRUE))
->alter();
$addon->includeFile(__DIR__ . '/install.php');