root/trunk/classes/phing/ProjectComponent.php

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  *  $Id$
4  *
5  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16  *
17  * This software consists of voluntary contributions made by many individuals
18  * and is licensed under the LGPL. For more information please see
19  * <http://phing.info>.
20  */
21
22 namespace phing;
23
24 /**
25  *  Abstract class providing properties and methods common to all
26  *  the project components
27  *
28  * @author    Andreas Aderhold <andi@binarycloud.com>
29  * @author    Hans Lellelid <hans@xmpl.org>
30  * @version   $Revision: 1.5 $
31  * @package   phing
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
Note: See TracBrowser for help on using the browser.