/** * Fetches the directory object for the module with * the matching name. * * Each module and plug-in should store its project-specific data * in its own directory. * This function returns that directory. * * @param string $module_name The identifying name of the module. */ public static function get_directory($module_name) { if (HaddockProjectOrganisation_ModuleDirectoriesHelper::insist_module_directory_exists($module_name)) { $project_specific_directory = HaddockProjectOrganisation_ProjectSpecificDirectoryHelper::get_project_specific_directory(); $directory_name = $project_specific_directory->get_name() . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . $module_name; FileSystem_DirectoryHelper::mkdir_parents($directory_name); return new FileSystem_Directory($directory_name); } }