Skip to content

Commit

Permalink
Uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaDafinser committed Jul 25, 2014
1 parent 902846d commit 6f76e28
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions IntranetGeoIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,22 @@ public function getListHooksRegistered()

/**
*
* @see \Piwik\Plugin::install()
*/
public function install()
{
return $this->copyDataFile();
}

/**
* @see \Piwik\Plugin::activate()
*/
public function activate()
{
return $this->copyDataFile();
}

private function copyDataFile()
{
if (! file_exists($this->getDataFilePath()) && file_exists($this->getDataExampleFilePath())) {
copy($this->getDataExampleFilePath(), $this->getDataFilePath());
Expand All @@ -60,6 +73,17 @@ public function activate()
return;
}

/**
*
* @see \Piwik\Plugin::uninstall()
*/
public function uninstall()
{
if (file_exists($this->getDataFilePath())) {
unlink($this->getDataFilePath());
}
}

/**
* Called by event `Tracker.newVisitorInformation`
*
Expand Down

0 comments on commit 6f76e28

Please sign in to comment.