From: Michael M Slusarz Date: Thu, 29 Jan 2009 04:11:24 +0000 (-0700) Subject: Move patchset feature determination to Vcs lib X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7847e0b7df1709d136be6fc9d1628ce07a14714f;p=horde.git Move patchset feature determination to Vcs lib --- diff --git a/chora/patchsets.php b/chora/patchsets.php index 340701a1a..caccddf90 100644 --- a/chora/patchsets.php +++ b/chora/patchsets.php @@ -1,5 +1,7 @@ * @author Chuck Hagenbuch + * @author Michael Slusarz * @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; } diff --git a/framework/Vcs/lib/Horde/Vcs/Cvs.php b/framework/Vcs/lib/Horde/Vcs/Cvs.php index 09a3f407f..65e5b0545 100644 --- a/framework/Vcs/lib/Horde/Vcs/Cvs.php +++ b/framework/Vcs/lib/Horde/Vcs/Cvs.php @@ -42,13 +42,15 @@ class Horde_Vcs_Cvs extends Horde_Vcs_Rcs 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; } /** @@ -146,7 +148,7 @@ class Horde_Vcs_Cvs extends Horde_Vcs_Rcs { $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');