Textpattern is an open source content management system, built with PHP/MySQL, that offers a flexible usage for designers, publishers/bloggers and end-users.
Here is a snippet that can help you to remove a non-empty directory from the server. It’s a recursive function that deletes the directory with its files, folders and sub-folders.