Created
February 5, 2012 18:47
-
-
Save EugenMayer/1747142 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Write packaging information for a release. | |
*/ | |
function write_package_info($tag, $exclude_mask = array('.', '..', 'CVS')) { | |
if (isset($this->backend)) { | |
$fserver_url = url("fserver", array('purl' => array('disabled' => TRUE), 'absolute' => TRUE)); | |
$packaging = array(); | |
$packaging[] = "; Information added by fserver"; | |
$packaging[] = "core = \"{$tag['core']}\""; | |
$packaging[] = "datestamp = \"{$tag['timestamp']}\""; | |
$packaging[] = "project = \"{$this->name}\""; | |
$packaging[] = "project status url = \"{$fserver_url}\""; | |
$packaging[] = "version = \"{$tag['version']}\""; | |
$packaging = "\n" . implode("\n", $packaging); | |
$files = file_scan_directory($this->backend->path, '.info$', $exclude_mask); | |
foreach ($files as $path => $file) { | |
// @TODO: Parse the info file or not? | |
$info_file = file_get_contents($file->filename); | |
$info_file .= $packaging; | |
file_put_contents($file->filename, $info_file); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment