|
Revision 307, 2.3 kB
(checked in by hans, 1 year ago)
|
Refs #188 - Adding work-in-progress (still-broken!) namespace support.
|
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
namespace phing; |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
abstract class ProjectComponent { |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
* Holds a reference to the project that a project component |
|---|
| 37 |
* (a task, a target, etc.) belongs to |
|---|
| 38 |
* |
|---|
| 39 |
* @var Project A reference to the current project instance |
|---|
| 40 |
*/ |
|---|
| 41 |
protected $project = null; |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
* References the project to the current component. |
|---|
| 45 |
* |
|---|
| 46 |
* @param Project $project The reference to the current project |
|---|
| 47 |
*/ |
|---|
| 48 |
public function setProject($project) { |
|---|
| 49 |
$this->project = $project; |
|---|
| 50 |
} |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
* Returns a reference to current project |
|---|
| 54 |
* |
|---|
| 55 |
* @return Project Reference to current porject object |
|---|
| 56 |
*/ |
|---|
| 57 |
public function getProject() { |
|---|
| 58 |
return $this->project; |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
* Logs a message with the given priority. |
|---|
| 63 |
* |
|---|
| 64 |
* @param string $msg The message to be logged. |
|---|
| 65 |
* @param integer $level The message's priority at this message should have |
|---|
| 66 |
*/ |
|---|
| 67 |
public function log($msg, $level = Project::MSG_INFO) { |
|---|
| 68 |
if ($this->project !== null) { |
|---|
| 69 |
$this->project->log($msg, $level); |
|---|
| 70 |
} |
|---|
| 71 |
} |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|