Using Doctor to setup & update Quanta

Doctor is the shell-based component used to control, manipulate, and administer Quanta websites.

Doctor has a wide variety of uses:

1) Doctor installs Quanta: 

When you install Quanta, you are actually running an instance of Doctor setup.
Doctor takes care of creating system directories, placing them in the right place, and performing all the necessary system and security check.

Usage: on your command line, go to the system root and run: 

./doctor yoursite setup

where yoursite is the URL of your site.

2) Doctor repairs the environment when something goes wrong: 

You can run doctor anytime you need to perform one of those operations: 

- detects and attempts to fix all broken symlinks
- creates missing system directories
- informs you on whatever is wrong or missing

Usage: on your command line, go to the system root and run:

./doctor yoursite check

where yoursite is the URL of your site.

3) Doctor updates Quanta: 

You can run doctor to update your environment after you applied some changes to system directories, or any other updates you want to run.

Usage: on your command line, go to the system root and run: 

./doctor yoursite check

(yes, it's the same as the previous one!)


4) Doctor clears temporary folders and caches 

You can run doctor to clear all your temporary folders, caches, and run all Garbage collectors.

Stuff that will be wiped include:

- all generated thumbnails (in /engine/tmp/yoursite/thumbs)
- all cached node paths (in /engine/tmp/cache)
- javascript and css 

Usage: on your command line, go to the system root and run: 

./doctor yoursite clear_cache


5) Other modules can interact with Doctor: 

Thanks to the use of hooks, all modules (core and contributed ones) can interact with Doctor at all its phases: setup, check, etc.

Doctor currently uses those two hooks:
hook_doctor() - (is executed when running doctor check)
hook_setup()  - (is executed when running doctor setup)

Usage: given a custom Quanta module mymodule on your mymodule.hook.inc file, create a function similar to the following:

function mymodule_setup($env, $vars) {
  Doctor::talk('Hello!');
}