- add support for multiple directories

This commit is contained in:
Andreas Burchert (scarya)
2010-10-20 20:29:47 +00:00
parent 05897c3e01
commit b58a9d3b88
2 changed files with 100 additions and 91 deletions

View File

@@ -69,7 +69,7 @@ class FroxlorPkgCreator
// parse the config
if (!$this->_checkConfig()) {
die("Error in FroxlorPkgCreator::_checkConfig()");
throw new Exception("Error in FroxlorPkgCreator::_checkConfig()");
}
$this->pack($toPath);
@@ -99,7 +99,6 @@ class FroxlorPkgCreator
private function _checkConfig()
{
foreach ($this->_config as $key => $var) {
// TODO maybe more excluded files?
if (strstr($var, "userdata.inc")) {
// delete this entry
unset($this->_config[$key]);
@@ -132,7 +131,8 @@ class FroxlorPkgCreator
if ($zip->open($toPath, ZIPARCHIVE::OVERWRITE)) {
// write data
foreach ($this->_config as $var) {
$zip->addFile($var, strstr($var, "lib/"));
$name = str_replace("froxlor/", "", strstr($var, "froxlor/"));
$zip->addFile($var, $name);
}
// close it