use OC files API to create missing directory which should handle special chars in every environment correctly
also create root dir if it doesn't exist yet
added createMissingDirectories() method
added missing parameter documentation
switched to dirname()