1<?php
2
3require_once(dirname(__FILE__)."/../pfccommand.class.php");
4
5/**
6 * This command deletes the cached configuration. Uses it to take into account new parameters.
7 *
8 * @author Stephane Gully <stephane.gully@gmail.com>
9 */
10class pfcCommand_rehash extends pfcCommand
11{
12  var $desc = "This command deletes the cached configuration. Uses it to take into account new parameters.";
13
14  function run(&$xml_reponse, $p)
15  {
16    $clientid    = $p["clientid"];
17    $param       = $p["param"];
18    $sender      = $p["sender"];
19    $recipient   = $p["recipient"];
20    $recipientid = $p["recipientid"];
21
22    $c =& pfcGlobalConfig::Instance();
23    // just destroy the cache
24    // do not synchronizeWithCache() because it will reload the same parameters as the current one
25    // the right way is to wait for the next page reload and the new parameters will be taken into account
26    $destroyed = $c->destroyCache();
27
28    if ($destroyed)
29      $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', '');");
30    else
31      $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ko', '');");
32  }
33}
34
35?>