Skip to content

Instantly share code, notes, and snippets.

@pifantastic
Created August 18, 2011 23:14
Show Gist options
  • Save pifantastic/1155520 to your computer and use it in GitHub Desktop.
Save pifantastic/1155520 to your computer and use it in GitHub Desktop.
<?php
// A little header help.
$branch_conf_path = getcwd() . '/../.bzr/branch/branch.conf';
if (!headers_sent() && file_exists($branch_conf_path)) {
$branch_conf = file_get_contents($branch_conf_path);
foreach (explode("\n", $branch_conf) as $line) {
list($key, $value) = explode("=", $line, 2);
if (trim($key) == 'bound_location') {
$url = parse_url(trim($value), PHP_URL_PATH);
header('X-Launchpad-Branch: ' . basename($url));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment