You are here

function potx_local_init in Translation template extractor 7.3

Same name and namespace in other branches
  1. 8 potx.local.inc \potx_local_init()

Initialize potx to run locally, e.g. by drush.

Parameters

string $module_path: Path to the module that is being parsed by potx.

3 calls to potx_local_init()
PotxTestCase::setUp in tests/potx.test
Sets up a Drupal site for running functional and integration tests.
potx_drush_extract in ./potx.drush.inc
Drush command callback.
potx_select_component_form_submit in ./potx.admin.inc
Generate translation template or translation file for the requested component.

File

./potx.local.inc, line 12

Code

function potx_local_init($module_path = NULL) {
  global $_potx_found_modules;
  global $_potx_schema_lookup;
  global $_potx_reverse_lookup_built;
  $_potx_found_modules = array();
  $_potx_schema_lookup = array();
  $_potx_reverse_lookup_built = FALSE;
  global $potx_callbacks;
  $potx_callbacks = array(
    'schema_store_lookup' => '_potx_schema_store_lookup',
    'schema_reverse_lookup' => '_potx_schema_reverse_lookup',
    'load_module_metadata' => '_potx_load_module_metadata',
    'store_module_metadata' => '_potx_store_module_metadata',
    'schema_store' => '_potx_schema_store',
    'schema_load' => '_potx_schema_load',
  );
  if ($module_path !== NULL) {
    _potx_find_all_modules($module_path);
  }
}