[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/module_builder/includes/ -> common.inc (summary)

(no description)

File Size: 299 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  _module_builder_drush_print()
  module_builder_get_path()
  module_builder_include()
  _module_builder_drupal_major_version()
  _module_builder_check_settings()
  _module_builder_check_hook_data()
  module_builder_update_data()
  _module_builder_get_hooks_directory()
  module_builder_get_module_files()
  module_builder_get_functions()
  _module_builder_invoke_hook()

Functions
Functions that are not part of a class:

_module_builder_drush_print($message, $indent, $type = 'message')   X-Ref
Safe version of drush_print that can be called without worrying about
where we are.


module_builder_get_path($subpath)   X-Ref
Get a path to a resource that is safe to use either on Drupal or Drush.

param: $subpath

module_builder_include($name, $extension = 'inc')   X-Ref
Include a version-specific file whether we're on drush or drupal.
That is, we first try to include a file called NAME_X.inc where X is a
Drupal major version number before falling back to NAME.inc.

Files are included from the 'includes' folder inside module_builder.

On Drush, this is a wrapper for drush_include().
On Drupal, this just goes straight for the current version.

param: $name
param: $extension

_module_builder_drupal_major_version()   X-Ref
Returns the Drupal major version number (5, 6, 7 ...)

Helper function for module_builder_include. Cribbed and hacked from drush.

_module_builder_check_settings($directory = NULL)   X-Ref
Create a directory to store hook files if it does not exist.

IMPORTANT: this function should only be used on Drupal 5 and 6.

This logic blatantly ripped off from image.module -- thanks James! :)

_module_builder_check_hook_data($directory = NULL)   X-Ref
Check hook data is available in storage file.

This allows us to check things are okay at an early stage.

param: $directory
return:

module_builder_update_data()   X-Ref
Update hook files and process them to our data file.

This is the master function to call from either UI, drush or drupal.

_module_builder_get_hooks_directory()   X-Ref
Get a directory to save or read hook data files.

This is either the variable from Drupal, or the --data option.
Use of the --data option allows a central store of hook data that needs only
be downloaded once for all Drupal sites.
Subdirectories are made for each version.

This needs to be safe to use at any bootstrap level.

return:

module_builder_get_module_files($module_root_name)   X-Ref
Helper function to get all the code files for a given module
TODO: does drush have this?

param: $module_root_name
return:

module_builder_get_functions($file)   X-Ref
Helper function to get all function names from a file.

param: $file

_module_builder_invoke_hook()   X-Ref
Helper function to invoke hook_module_builder_info() in all modules.

The tricky part is that we want to include ourselves, but module_builder
might not be installed (or even present) in Drupal if we are on Drush.



Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7