function _potx_parse_shipped_configuration in Translation template extractor 7.2
Same name and namespace in other branches
- 8 potx.inc \_potx_parse_shipped_configuration()
- 6.3 potx.inc \_potx_parse_shipped_configuration()
- 7.3 potx.inc \_potx_parse_shipped_configuration()
Parse shipped configuration for translatables. Drupal 8+
Parameters
string $save_callback:
string $api_version:
2 calls to _potx_parse_shipped_configuration()
- PotxTestCase::testDrupal8ShippedConfiguration in tests/
potx.test - Test parsing of Drupal 8 shipped configuration files.
- potx_drush_extract in ./
potx.drush.inc - Drush command callback.
File
- ./
potx.inc, line 2319 - Extraction API used by the web and command line interface.
Code
function _potx_parse_shipped_configuration($save_callback = '_potx_save_string', $api_version = POTX_API_CURRENT) {
global $_potx_config_set;
if ($api_version > POTX_API_7) {
foreach ($_potx_config_set as $config_path) {
// Find the schema that matches the config file.
$path_info = pathinfo($config_path);
$config_name = $path_info['filename'];
$schema = _potx_find_matching_schema($config_name);
if ($schema == '') {
// No schema was found matching this config.
continue;
}
$config_code = file_get_contents($config_path);
$parsed_config = Yaml::parse($config_code);
unset($config_code);
_potx_find_shipped_config_translatables($parsed_config, $schema, NULL, NULL, $config_path, $save_callback);
}
}
}