We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37286
    • 160 Posts
    This might seem like an odd question as most people probably would not be interested in installing a large amount of data with an addon. I have a tool I have been working on for about a month now to help me build forms faster. It also has table objects attached with countries and states I planned on installing as part of the addon. Then I expanded into US cities and zip codes cross referenced. This way a city/zip code combination can be verified on a form submit.

    I have a file with all the zip codes formatted to save to the database like:
    $zip = $modx->newObject('sekftUSZipCodes');
    $zip->fromArray(array('zip_code' => '501','zip_lat' => '40.81','zip_long' => '-73.04'),'',true,true);
    $zip->save();
    $zip = $modx->newObject('sekftUSZipCodes');
    $zip->fromArray(array('zip_code' => '544','zip_lat' => '40.81','zip_long' => '-73.04'),'',true,true);
    $zip->save();

    The problem is that the zip code file alone is 6.57MiB (it does zip up to about 300k) and 125599 lines.

    1) Should I post this as an optional download somewhere so it's not zipped up inside this addon?
    2) Will this even run at this size or will this time out on most servers?
    3) How would I prevent a browser timeout, or does modx take care of that for me?

    Finally, I've tried working with the installation options, but I'm still a little muddy on how to make something like this an option. If anyone knows of another addon that has something similar, let me know so I can take a look.

    Thanks