The supported way to use Moodle functions from outside Moodle is to use web services. The wiki lists the functions that are currently available.
General developer forum
Using Moodle functions outside Moodle
This discussion has been locked so you can no longer reply to it.