Skip to content

Instantly share code, notes, and snippets.

@scottdavis
Created January 24, 2010 08:52
Show Gist options
  • Save scottdavis/285108 to your computer and use it in GitHub Desktop.
Save scottdavis/285108 to your computer and use it in GitHub Desktop.
<?php
public function pearfarm_build() {
$tags = $this->get_tags();
$tag = array_pop($tags);
if($this->has_spec($tag) == false) {
$this->cleanup();
return false;
}
if($this->get_tag($tag)) {
$specfile = $this->temp_location . '/pearfarm.spec';
include $specfile;
if (!isset($spec)) {
$this->cleanup();
return false;
}
$spec->writePackageFile();
$pear_command = implode(' ', array('cd', $this->temp_location, '&&', 'pear', '-c', sys_get_temp_dir() . '/.pearrc', 'package'));
$pear_add_channel = implode(' ', array('pear', '-c', sys_get_temp_dir() . '/.pearrc', 'channel-discover', $spec->getChannel()));
exec($pear_add_channel, $out);
exec($pear_command, $out2, $result);
$file = $this->temp_location . "/{$spec->getName()}-{$spec->getReleaseVersion()}.tgz";
return (file_exists($file)) ? $file : false;
}else{
$this->cleanup();
return false;
}
$this->cleanup();
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment