source: extensions/comments_blacklist/maintain.class.php @ 29034

Last change on this file since 29034 was 28836, checked in by mistic100, 10 years ago

use new maintain class

File size: 883 bytes
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4class comments_blacklist_maintain extends PluginMaintain
5{
6  private $default_conf = array(
7    'action' => 'reject',
8    );
9   
10  private $file;
11 
12  function __construct($plugin_id)
13  {
14    parent::__construct($plugin_id);
15    $this->file = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'comments_blacklist.txt';
16  }
17
18  function install($plugin_version, &$errors=array())
19  {
20    global $conf;
21
22    if (empty($conf['comments_blacklist']))
23    {
24      conf_update_param('comments_blacklist', $this->default_conf, true);
25    }
26   
27    if (!file_exists($this->file)) 
28    {
29      touch($this->file);
30    }
31  }
32
33  function update($old_version, $new_version, &$errors=array())
34  {
35    $this->install($new_version, $errors);
36  }
37
38  function uninstall()
39  {
40    conf_delete_param('comments_blacklist');
41
42    @unlink($this->file);
43  }
44}
Note: See TracBrowser for help on using the repository browser.