I'm writing a module to custom drupal for our needs.

My question is about including files.

I have some page callbacks, which are defined in my hook_menu function like so:

$items['mymodule/myaction'] = array(
    'title' => 'Custom Action',
    'page callback' => 'mymodule_myaction',
    'type' => MENU_CALLBACK,
    'file' => 'mymodule.module',
    'access callback' => TRUE,
    );
 
However, common functions, such as `url()` cannot be used because they are not included.

I would have thought that `/includes/common.inc` would be already included, since drupal has got far enough to call my page callback function.

In my handler function, I have had to include:

require_once './includes/common.inc';
require_once './includes/path.inc';

to access drupal's functionality that I want.

Or have I missed something really obvious!!?

-matt