-
Notifications
You must be signed in to change notification settings - Fork 93
/
install.php
43 lines (38 loc) · 1.46 KB
/
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
36
37
38
39
40
41
42
43
<?php
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
$fs = new Filesystem();
if (! function_exists("out")) {
function out($text) {
echo $text."<br />";
}
}
if (! function_exists("outn")) {
function outn($text) {
echo $text;
}
}
// Set execute permissions for AGI script
#@chmod(dirname(__FILE__) . '/agi/superfecta.agi', 0755);
try {
$fs->chmod(__DIR__.'/agi/superfecta.agi', 0755);
} catch (IOExceptionInterface $e) {
out(sprintf("Couldn't set permissions on %s please run fwconsole chown from the command line",__DIR__.'/agi/superfecta.agi'));
}
global $db;
// Remove entries from Caller ID Lookup sources left by legacy Superfecta Installs
$sql = "SELECT * FROM `cidlookup` WHERE `description` = 'Caller ID Superfecta'";
$res = $db->query($sql);
if ( !DB::IsError($res) && $res->numRows() != 0 ) {
echo "Cleaning up remnants of legacy Superfecta installation.</p>";
$sql = "DELETE FROM cidlookup WHERE description = 'Caller ID Superfecta'";
$res = $db->query($sql);
}
// remove spurious superfecta cache entries caused by previous versions of Trunk Provided module:
$sql = "select * from superfectacache where `callerid` like 'CID Superfecta!'";
$res = $db->query($sql);
if ( !DB::IsError($res) && $res->numRows() != 0 ) {
echo "Cleaning up Superfecta Cache pollution from Trunk Provided module.</p>";
$sql = "DELETE FROM superfectacache where `callerid` like 'CID Superfecta!'";
$res = $db->query($sql);
}