PHP script to control subversion checkout/update

I would like to create a php scripts that can.

1. checkout from a repository to any specified folder
2. svn update any specified folder.

These functions should be available to cPanel user WHM not necessary.

can somebody point me in the right direction? I mean where to place the scripts and how to get the links to these scripts on cpanel.