bjornbjorn/snippetssync.ee2_addon — pull request #3 by jannisg (2012-01-08 08:33:12+00:00)
Title: Folders now settable via config.php + Auto create folders + Sanitize filenames.

* Folder names can now be set via $['config'] as "snippetssync\_sn\_folder" and "snippetssync\_gv\_folder" respectively. _(the fallbacks of 'snippets/' and 'global\_variables/' remain if no folder is otherwise specified.)_
* Added automatic creation of snippets & global_variables folders if they don't exist. _(If the designated folders don't exist yet, the script creates them if it can get write permissions to the folder.)_
* Any file extension can now be used (if any). _(As opposed to be confined to .html. Some might like to use .snip or .gvar or something…)_
* Filename is now being sanitized to allow only azAZ09-_ as per the requirements of global vars and snippets in EE. _(Previously it was possible (and write this to the DB) to create filenames that would result in illegally named global variables or snippets.)_

## Note!

__Please__ check my code, I did test everything but I wrote all this after only having just learned PHP + CI in the last 5 days. If stuff is not quite right I would appreciate you telling me what I have done wrong so I can do better next time.