maintain.class.php 857 Bytes
Newer Older
Jan Grewe's avatar
Jan Grewe committed
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
<?php

if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');

class cdn_maintain extends PluginMaintain {
  
  function install($plugin_version, &$errors=array()) {
    $q = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment) VALUES ("cdn_host", "cdn#.example.com", "CDN host");';
    pwg_query($q);
    $q = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment) VALUES ("cdn_enabled", "false", "CDN enabled")';
    pwg_query($q);
    $q = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment) VALUES ("cdn_count", "3", "CDN host count")';
    pwg_query($q);
  }

  function activate($plugin_version, &$errors=array()) {
  }
  
  function update($old_version, $new_version, &$errors=array()) {
  }

  function deactivate() {
  }

  function uninstall() {
    $q = 'DELETE FROM '.CONFIG_TABLE.' WHERE param LIKE "cdn_%";';
    pwg_query($q);
  }

}

?>