switch ($element->tagName) {
case 'authorname':
$data['authorName'] = $element->nodeValue;
- break;
+ break;
case 'authorurl':
$data['authorURL'] = $element->nodeValue;
- break;
+ break;
}
}
- break;
+ break;
case 'files':
$elements = $xpath->query('child::*', $category);
$data[$element->tagName.'Path'] = $element->getAttribute('path');
}
}
- break;
+ break;
case 'general':
$elements = $xpath->query('child::*', $category);
DateUtil::validateDate($element->nodeValue);
$data['date'] = $element->nodeValue;
- break;
+ break;
case 'stylename':
$data['name'] = $element->nodeValue;
- break;
+ break;
case 'version':
if (!Package::isValidVersion($element->nodeValue)) {
}
$data['version'] = $element->nodeValue;
- break;
+ break;
case 'copyright':
case 'description':
case 'image':
case 'license':
$data[$element->tagName] = $element->nodeValue;
- break;
+ break;
}
}
- break;
+ break;
}
}
$xml->startElement('files');
$xml->writeElement('variables', 'variables.xml');
if ($templates) $xml->writeElement('templates', 'templates.tar');
- if ($images) $xml->writeElement('images', 'images.tar');
- if ($icons) $xml->writeElement('icons', 'icons.tar');
+ if ($images) $xml->writeElement('images', 'images.tar', array('path' => $this->imagePath));
+ if ($icons) $xml->writeElement('icons', 'icons.tar', array('path' => $this->iconPath));
$xml->endElement();
// append style info file to style tar
$styleTar->add($templatesTarName, 'templates.tar', $templatesTarName);
@unlink($templatesTarName);
}
-
+
if ($images && ($this->imagePath && $this->imagePath != 'images/')) {
// create images tar
$imagesTarName = FileUtil::getTemporaryFilename('images_', '.tar');
if (file_exists($path) && is_dir($path)) {
$handle = opendir($path);
- $regEx = new Regex('\.(jpg|jpeg|gif|png|svg)');
+ $regEx = new Regex('\.(jpg|jpeg|gif|png|svg)$', Regex::CASE_INSENSITIVE);
while (($file = readdir($handle)) !== false) {
if (is_file($path.$file) && $regEx->match($file)) {
$imagesTar->add($path.$file, '', $path);
if (file_exists($path) && is_dir($path)) {
$icons = glob($path.'*.svg');
foreach ($icons as $icon) {
- $iconsTar->add($path.$icon, '', $path);
+ $iconsTar->add($icon, '', $path);
}
}