Delete File(s) on Package Uninstall

Permalink
Hello,

Is there a way to function that runs when you package is uninstalled?
I need to delete some files off the server when people uninstall my package.

celwell
 
nteaviation replied on at Permalink Reply
nteaviation
In the package class there is an uninstall function. See:
http://www.concrete5.org/api/

I am just guessing, but maybe in your package controller.php you could do something like:
public function uninstall() {
        parent::uninstall();
        // Delete files
        unlink('path/to/file.txt');
    }

I am an old procedure oriented programmer that is still getting the hang of OOP. Any C5 OOP experts care to comment?