-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.php
More file actions
76 lines (67 loc) · 2.42 KB
/
Copy pathinstall.php
File metadata and controls
76 lines (67 loc) · 2.42 KB
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
75
76
<?php
/**
* SPSEO - Simple Search Engine Optimization toolkit for Oxwall platform
* Copyright (C) 2015 SONGPHI LLC.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$dbPref = OW_DB_PREFIX.'spseo_';
$tblPage = $dbPref.'page';
$tblPageUrls = $dbPref.'page_urls';
$tblUrl = $dbPref.'url';
$installSQL = "CREATE TABLE IF NOT EXISTS `$tblPage` (
`id` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`hash` VARCHAR( 32 ) NOT NULL,
`uri` VARCHAR( 255 ) NOT NULL,
`meta_description` TEXT NULL,
`meta_keywords` TEXT NULL,
PRIMARY KEY ( `id` )
,
CONSTRAINT `unique_hash` UNIQUE( `hash` ),
CONSTRAINT `unique_id` UNIQUE( `id` ),
CONSTRAINT `unique_uri` UNIQUE( `uri` ) )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `$tblPageUrls` (
`id` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`page_hash` VARCHAR( 32 ) NOT NULL,
`url_hash` VARCHAR( 32 ) NOT NULL,
`updated` INT UNSIGNED NOT NULL,
PRIMARY KEY ( `page_hash`,`url_hash` )
,
CONSTRAINT `unique_id` UNIQUE( `id` ) )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `$tblUrl` (
`id` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`uri` VARCHAR( 255 ) NOT NULL,
`prefix` VARCHAR( 255 ) NULL,
`slug` VARCHAR( 255 ) NULL,
`friendly_uri` TEXT NULL,
`updated` INT UNSIGNED NULL,
`target_id` INT UNSIGNED NULL,
`hash` VARCHAR( 32 ) NOT NULL,
PRIMARY KEY ( `id` )
,
CONSTRAINT `unique_id` UNIQUE( `id` ),
CONSTRAINT `unique_uri` UNIQUE( `uri` ) )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
";
OW::getDbo()->query($installSQL);
try {
OW::getPluginManager()->addPluginSettingsRouteName('spseo', 'spseo.admin');
} catch (Exception $e) { }
try {
BOL_LanguageService::getInstance()->addPrefix('spseo','SimpleSEO');
} catch (Exception $e) { }
$path = dirname(__FILE__) . DS . 'langs.zip';
BOL_LanguageService::getInstance()->importPrefixFromZip($path, 'spseo');