Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config:debug command #220

Merged
merged 13 commits into from
Oct 14, 2014
Merged

Conversation

jmolivas
Copy link
Member

  • Add ConfigDebugCommand Class
  • Register config:debug command
  • Add execute method code
  • Use table helper for output
  • Extract config list to method getAllConfigurations
  • Import InputArgument class
  • Add config-name argument
  • Read config-name argument
  • Add getConfigurationByName method
  • Call getConfigurationByName if config_name entered
  • Update docblocks
  • Import Drupal\Component\Serialization\Yaml class
  • Use Yaml::encode to process read configuration

@jmolivas
Copy link
Member Author

PR not yet merged because:

  $config = $configStorage->read($config_name);
  $configuration = json_encode($config, JSON_PRETTY_PRINT);
  $configuration = str_replace(
          ['{', '}', ',', '""', '"', "    "],
          ['', '', '', '\'\'', '', '  '] ,
          $configuration);
  $configuration = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", $configuration);

I am terrible with regexp :(
Maybe iterate the keys and values will be a better idea.
Feel free to send improvements

@jmolivas jmolivas changed the title Add config:dump command Add config:debug command Oct 14, 2014
@jmolivas
Copy link
Member Author

When no documentation the code is the documentation. I found the solution at drupal core config module file path core/modules/config/src/Form/ConfigSingleExportForm.php

use Drupal\Component\Serialization\Yaml;
...
$configuration = $configStorage->read($config_name);
$configurationEncoded = Yaml::encode($configuration);

jmolivas added a commit that referenced this pull request Oct 14, 2014
Add config:debug command

Merge this for a new release today
@jmolivas jmolivas merged commit cc7c33f into hechoendrupal:master Oct 14, 2014
@jmolivas jmolivas deleted the config-dump branch October 14, 2014 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant