root/tags/2.2.0RC2/classes/phing/ProjectComponent.php

Revision 1, 2.3 kB (checked in by hans, 3 years ago)

Initial checkin

Line 
1 <?php
2 /*
3  *  $Id: ProjectComponent.php,v 1.5 2003/12/24 13:02:08 hlellelid Exp $
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 /**
23  *  Abstract class providing properties and methods common to all
24  *  the project components
25  *
26  * @author    Andreas Aderhold <andi@binarycloud.com>
27  * @author    Hans Lellelid <hans@xmpl.org>
28  * @version   $Revision: 1.5 $
29  * @package   phing
30  */
31 abstract class ProjectComponent {
32
33     /**
34      *  Holds a reference to the project that a project component
35      *  (a task, a target, etc.) belongs to
36      *
37      *  @var    object  A reference to the current project instance
38      */
39     protected $project = null;
40
41     /**
42      *  References the project to the current component.
43      *
44      *  @param    object    The reference to the current project
45      *  @access   public
46      */
47     function setProject($project) {
48         $this->project = $project;
49     }
50
51     /**
52      *  Returns a reference to current project
53      *
54      *  @return   object   Reference to current porject object
55      *  @access   public
56      */
57     function getProject() {
58         return $this->project;
59     }
60
61     /**
62      *  Logs a message with the given priority.
63      *
64      *  @param  string   The message to be logged.
65      *  @param  integer  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.