<?php
/**
+ * Patchsets script.
+ *
* Copyright 1999-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
*
* @author Anil Madhavapeddy <anil@recoil.org>
* @author Chuck Hagenbuch <chuck@horde.org>
+ * @author Michael Slusarz <slusarz@horde.org>
* @package Chora
*/
require_once dirname(__FILE__) . '/lib/base.php';
-// Exit if cvsps isn't active or it's not a subversion repository.
-if (empty($conf['paths']['cvsps']) &&
- !$GLOBALS['VC']->hasFeature('patchsets')) {
+// Exit if patchset feature is not available.
+if (!$GLOBALS['VC']->hasFeature('patchsets')) {
header('Location: ' . Chora::url('', $where));
exit;
}
protected $_branches = true;
/**
- * Returns the temporary file path.
+ * Does this driver support the given feature?
*
- * @return string Temporary file path.
+ * @return boolean True if driver supports the given feature.
*/
- public function getTempPath()
+ public function hasFeature($feature)
{
- return $this->_paths['temp'];
+ return (($feature != 'patchsets') || $this->getPath('cvsps'))
+ ? parent::hasFeature($feature)
+ : false;
}
/**
{
$this->assertValidRevision($rev);
- $tmpfile = Util::getTempFile('vc', true, $this->getTempPath());
+ $tmpfile = Util::getTempFile('vc', true, $this->_paths['temp']);
$where = $fileob->queryModulePath();
$pipe = popen($this->getPath('cvs') . ' -n server > ' . escapeshellarg($tmpfile), VC_WINDOWS ? 'wb' : 'w');