-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
executable file
·70 lines (58 loc) · 1.83 KB
/
extension.driver.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
<?php
Class extension_ysboss extends Extension{
public function about(){
return array('name' => 'Yahoo! Search BOSS',
'version' => '1.3',
'release-date' => '2009-06-25',
'author' => array('name' => 'Marcin Konicki',
'website' => 'http://ahwayakchih.neoni.net',
'email' => 'ahwayakchih@neoni.net'),
'description' => 'Use Yahoo! Search BOSS API as data source in Symphony.'
);
}
function install(){
$about = $this->about();
$this->_Parent->Configuration->set('count', '10', 'ysboss');
$this->_Parent->Configuration->set('version', $about['version'], 'ysboss');
return $this->_Parent->saveConfig();
}
function uninstall(){
$this->_Parent->Configuration->remove('ysboss');
return $this->_Parent->saveConfig();
}
function enable(){
if (!$this->_Parent->Configuration->get('count', 'ysboss'))
return $this->install();
return true;
}
function update($previousVersion=false){
$needSave = true;
switch (floatval($previousVersion)) {
case false:
case 0:
case 1.0:
if (!($temp = $this->_Parent->Configuration->get('qname', 'ysboss'))) $temp = 'q';
$this->_Parent->Configuration->set('qname', '$'.$temp.':$url-'.$temp, 'ysboss');
if (!($temp = $this->_Parent->Configuration->get('pname', 'ysboss'))) $temp = 'p';
$this->_Parent->Configuration->set('pname', '$'.$temp.':$url-'.$temp, 'ysboss');
case 1.1:
$this->_Parent->Configuration->remove('version', 'ysboss');
break;
default:
$needSave = false;
break;
}
return ($needSave ? $this->_Parent->saveConfig() : true);
}
public function fetchNavigation() {
return array(
array(
'location' => __('System'),
'name' => 'YSBOSS',
'link' => '/preferences/',
'limit' => 'developer',
)
);
}
}
?>