. */ /** * Abstract class providing properties and methods common to all * the project components * * @author Andreas Aderhold * @author Hans Lellelid * @version $Revision: 1.5 $ * @package phing */ abstract class ProjectComponent { /** * Holds a reference to the project that a project component * (a task, a target, etc.) belongs to * * @var object A reference to the current project instance */ protected $project = null; /** * References the project to the current component. * * @param object The reference to the current project * @access public */ function setProject($project) { $this->project = $project; } /** * Returns a reference to current project * * @return object Reference to current porject object * @access public */ function getProject() { return $this->project; } /** * Logs a message with the given priority. * * @param string The message to be logged. * @param integer The message's priority at this message should have */ public function log($msg, $level = PROJECT_MSG_INFO) { if ($this->project !== null) { $this->project->log($msg, $level); } } }