$root = new Components_Helper_Root(
$package->_options['packagedirectory']
);
- $package->_options['dir_roles'] = array(
- 'bin' => 'script',
- 'script' => 'script',
- 'doc' => 'doc',
- 'example' => 'doc',
- 'js' => 'horde',
- 'horde' => 'horde',
- 'lib' => 'php',
- 'migration' => 'data',
- 'scripts' => 'data',
- 'test' => 'test',
- );
+ $package->_options['dir_roles'] = $this->_getMapping($root->getBase());
return new Components_Pear_Package_Contents_List(
$package->_options['packagedirectory'],
new Components_Pear_Package_Contents_Ignore(
)
);
}
+
+ /**
+ * Return the directory <-> role mapping for the specific package.
+ *
+ * @param string $path The package path.
+ *
+ * @return array The mapping.
+ */
+ private function _getMapping($path)
+ {
+ switch ($path) {
+ case 'horde/':
+ return array(
+ 'admin' => 'horde',
+ 'bin' => 'script',
+ 'config' => 'horde',
+ 'script' => 'script',
+ 'docs' => 'doc',
+ 'js' => 'horde',
+ 'lib' => 'horde',
+ 'scripts' => 'data',
+ 'services' => 'horde',
+ 'test' => 'test',
+ 'templates' => 'horde',
+ 'themes' => 'horde',
+ 'util' => 'horde',
+ );
+ break;
+ default:
+ return array(
+ 'bin' => 'script',
+ 'script' => 'script',
+ 'doc' => 'doc',
+ 'example' => 'doc',
+ 'js' => 'horde',
+ 'horde' => 'horde',
+ 'lib' => 'php',
+ 'migration' => 'data',
+ 'scripts' => 'data',
+ 'test' => 'test',
+ );
+ break;
+ }
+ }
}
\ No newline at end of file