-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinstall.inc.php
74 lines (62 loc) · 2.17 KB
/
install.inc.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* RexSEO - URLRewriter Addon
*
* @link https://github.com/gn2netwerk/rexseo
*
* @author dh[at]gn2-netwerk[dot]de Dave Holloway
* @author code[at]rexdev[dot]de jdlx
*
* Based on url_rewrite Addon by
* @author markus.staab[at]redaxo[dot]de Markus Staab
*
* @package redaxo 4.3.x/4.4.x
* @version 1.5.0
*/
// INSTALL SETTINGS
////////////////////////////////////////////////////////////////////////////////
$myself = 'rexseo42';
$myroot = $REX['INCLUDE_PATH'].'/addons/'.$myself;
$minimum_REX = '4.5.0';
$minimum_PHP = 5;
$disable_addons = array('url_rewrite');
$error = array();
// CHECK REDAXO VERSION
////////////////////////////////////////////////////////////////////////////////
if(version_compare($REX['VERSION'].'.'.$REX['SUBVERSION'].'.'.$REX['MINORVERSION'], $minimum_REX, '<'))
{
$error[] = 'Dieses Addon benötigt Redaxo Version '.$minimum_REX.' oder höher.';
}
// CHECK PHP VERSION
////////////////////////////////////////////////////////////////////////////////
if(version_compare(PHP_VERSION, $minimum_PHP, '<'))
{
$error[] = 'Dieses Addon benötigt mind. PHP '.$minimum_PHP.'!';
}
// CHECK ADDONS TO DISABLE
////////////////////////////////////////////////////////////////////////////////
foreach($disable_addons as $a)
{
if (OOAddon::isInstalled($a) || OOAddon::isAvailable($a))
{
$error[] = 'Addon "'.$a.'" muß erst deinstalliert werden. <span style="float:right;">[ <a href="index.php?page=addon&addonname='.$a.'&uninstall=1">'.$a.' de-installieren</a> ]</span>';
}
}
if(count($error)==0)
{
// SETUP DB FIELDS
//////////////////////////////////////////////////////////////////////////////
$sql = new rex_sql();
//$sql->debugsql = true;
$sql->setQuery('ALTER TABLE `' . $REX['TABLE_PREFIX'] . 'article` ADD `seo_title` TEXT, ADD `seo_description` TEXT, ADD `seo_keywords` TEXT, ADD `seo_url` TEXT, ADD `seo_noindex` VARCHAR(1), ADD `seo_ignore_prefix` VARCHAR(1)');
// delete cache
rex_generateAll();
// done!
$REX['ADDON']['install'][$myself] = 1;
}
else
{
$REX['ADDON']['installmsg'][$myself] = '<br />'.implode($error,'<br />');
$REX['ADDON']['install'][$myself] = 0;
}
?>