ryancramerdesign / ProcessWire

Our repository has moved to https://github.com/processwire – please head there for the latest version.
https://processwire.com
Other
727 stars 201 forks source link

[ProcessFieldExportImport] Long Functions (?) #2064

Open LimeWub opened 7 years ago

LimeWub commented 7 years ago

Hello there :)

This is more of a question than an issue.

I am currently working on a module to import a set of preset templates/fields for every new PW installation; so as to speed up development time at the beginning of a project.

I am looking into the wire/ProcessTemplate/ProcessTemplateExportImport.php (and the ProcessField equivalent) and I can see I could make use of some of the functionality in there -in particular ___buildImport() -.

However, this function expects get and post input to work. I think if I were to provide a json string instead (as a method parameter) this should be working fine. Am I wrong to think that? Looking at the method it's also 150-ish lines long.

Basically is there a reason this is one method or would it be ok for me to break it down into at least 2 (Data Aquisition + Processing) methods and commit this back?