|
Revision 97, 0.9 kB
(checked in by mikey, 2 years ago)
|
add metadata to star file
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
require 'star/starWriter.php'; |
|---|
| 3 |
$starArchive = new StarArchive(new StarWriter('build/xjconf.star')); |
|---|
| 4 |
$dirIt = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('XJConf')); |
|---|
| 5 |
$removePath = dirname(__FILE__); |
|---|
| 6 |
foreach ($dirIt as $file) { |
|---|
| 7 |
if ($file->isFile() == false || substr($file->getPathname(), -4) != '.php') { |
|---|
| 8 |
continue; |
|---|
| 9 |
} |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
$fqClassName = str_replace('/', '.', str_replace('XJConf/', 'net/xjconf/', str_replace(DIRECTORY_SEPARATOR, '/', str_replace('.php', '', $file->getPathname())))); |
|---|
| 13 |
$starArchive->add(new StarFile($file->getPathname(), $removePath), $fqClassName); |
|---|
| 14 |
} |
|---|
| 15 |
$starArchive->addMetaData('title', 'XJConf for PHP'); |
|---|
| 16 |
$starArchive->addMetaData('package', 'net.xjconf'); |
|---|
| 17 |
$starArchive->addMetaData('version', '0.2.0-dev'); |
|---|
| 18 |
$starArchive->addMetaData('author', 'XJConf Development Team <http://php.xjconf.net>'); |
|---|
| 19 |
$starArchive->addMetaData('copyright', '© 2007 XJConf Development Team'); |
|---|
| 20 |
$starArchive->create(); |
|---|
| 21 |
?> |
|---|