. */ require_once 'phing/ProjectComponent.php'; require_once 'phing/tasks/system/condition/Condition.php'; /** * Condition that tests whether a given reference exists. * * @author Matthias Pigulla (Phing) * @version $Revision: 905 $ * @package phing.tasks.system.condition */ class ReferenceExistsCondition extends ProjectComponent implements Condition { private $refid; public function setRef($id) { $this->refid = (string) $id; } /** * Check whether the reference exists. * @throws BuildException */ public function evaluate() { if ($this->refid === null) { throw new BuildException("No ref attribute specified for reference-exists " . "condition"); } $refs = $this->project->getReferences(); return isset($refs[$this->refid]); } }