Giter Club home page Giter Club logo

harrisstreet-impex's People

Contributors

cmuench avatar schumacherfm avatar sylvainraye avatar tessig avatar tkn98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harrisstreet-impex's Issues

YAML export incorrectly escapes single quotes

The YAML export escapes single quotes with a \ which is incorrect and causes an error to occur on the import of any such strings.

In YAML, a double quote '' (i.e. 2 singles) is how a single ' quote is escaped.

Suggested resolution in src/HarrisStreet/CoreConfigData/Exporter/Yaml.php change:

return '\'' . addcslashes($value, '\'') . '\'';

to

return sprintf("'%s'", str_replace('\'', '\'\'', $value));

YAML export should treat numeric values as strings and enclose in quotes

Using YAML export a string like '000000' is exported without quotes. This means upon import it is then treated as a numeric value and is imported as 0. You can see how this can cause problems.

Magento core_config_data treats everything like a string so it makes sense if the export / import does also.

Possible solution: in src/HarrisStreet/CoreConfigData/Exporter/Yaml.php remove the is_numeric test and treat everything like a string.

Value beginning with '-' causes error

Example YAML:

some_settings/setting/config_value:
  default:
    0: '-15px'

Trying to import the above results in the following error:

[RuntimeException]               
  The "-1" option does not exist.  

Seems to be the same for any value starting with a minus sign.

hs:ccd:export filename (-f) gets ".yaml" appended

This is counter-intuitive if you want to write to stdout.

For example the following command does not work:

$ n98-magerun.phar hs:ccd:export --include shipping/origin -fphp://stdout

because the following filename becomes created:

Failed to write: php://stdout.yaml

Automatically adding ".yaml" destroys the portability of the switch. I suggest to remove that feature for -f / --filename and add a new switch that brings it back: --prepend-filename-with-dot-yaml-extension.

I'd like to get some feedback on this suggestion before I consider to provide a PR. Thanks.

hs:ccd:export filename (-f) gets ".yaml" appended

This is counter-intuitive if you want to write to stdout.

For example the following command does not work:

$ n98-magerun.phar hs:ccd:export --include shipping/origin -fphp://stdout

because the following filename becomes created:

Failed to write: php://stdout.yaml

Automatically adding ".yaml" destroys the portability of the switch. I suggest to remove that feature for -f / --filename and add a new switch that brings it back: --prepend-filename-with-dot-yaml-extension.

Stabilize Import by Using Store/Storeview Codes next to IDs

Like the DNS system uses names instead of numbers to make the system more robust in a distributed environment, I see great use in using store and store-view codes (which are names) instead of IDs (which are numbers) when importing data (same can be applied to exporting, too).

This change would be backwards compatible because it can be clearly differentiated between numeric ID and alpha-numeric store code (if you follow the rule to not start it with a number or you don't only use numbers).

I plan to file a PR as I got positive feedback for this feature already from my peers at work. I'm pretty sure it is much appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.