Changeset 730cf45


Ignore:
Timestamp:
12/07/11 15:24:22 (5 months ago)
Author:
mrook
Branches:
master
Children:
961ce15
Parents:
0a714d7
git-author:
Michiel Rook <mrook@…> (12/07/11 15:24:22)
git-committer:
Michiel Rook <mrook@…> (12/07/11 15:24:22)
Message:

Add "level" attribute and docs to phpevaltask

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • classes/phing/tasks/system/PhpEvalTask.php

    r575e47e r730cf45  
    4242    protected $returnProperty = null; // name of property to set to return value  
    4343    protected $params = array(); // parameters for function calls 
     44     
     45    protected $logLevel = Project::MSG_INFO; 
     46     
     47    /** 
     48     * Set level of log messages generated (default = info) 
     49     * @param string $level 
     50     */ 
     51    public function setLevel($level) 
     52    { 
     53        switch ($level) 
     54        { 
     55            case "error": $this->logLevel = Project::MSG_ERR; break; 
     56            case "warning": $this->logLevel = Project::MSG_WARN; break; 
     57            case "info": $this->logLevel = Project::MSG_INFO; break; 
     58            case "verbose": $this->logLevel = Project::MSG_VERBOSE; break; 
     59            case "debug": $this->logLevel = Project::MSG_DEBUG; break; 
     60        } 
     61    } 
    4462     
    4563    /** Main entry point. */ 
     
    88106        } 
    89107         
    90         $this->log("Calling PHP function: " . $h_func . "()"); 
     108        $this->log("Calling PHP function: " . $h_func . "()", $this->logLevel); 
    91109        foreach($params as $p) { 
    92110            $this->log("  param: " . $p, Project::MSG_VERBOSE); 
     
    105123     */ 
    106124    protected function evalExpression() { 
    107         $this->log("Evaluating PHP expression: " . $this->expression); 
     125        $this->log("Evaluating PHP expression: " . $this->expression, $this->logLevel); 
    108126        if (!StringHelper::endsWith(';', trim($this->expression))) { 
    109127            $this->expression .= ';'; 
  • docs/phing_guide/book/chapters/appendixes/AppendixB-CoreTasks.html

    r2baac48 r730cf45  
    19961996                                <td>No</td> 
    19971997                        </tr> 
     1998                <tr> 
     1999                <td>level</td> 
     2000                <td>String</td> 
     2001                <td>Control the level at which phplint reports status messages. 
     2002                    One of <em>error</em>, <em>warning</em>, <em>info</em>, <em>verbose</em>, 
     2003                    <em>debug</em>.</td> 
     2004                <td><em>info</em></td> 
     2005                <td>No</td> 
     2006            </tr> 
    19982007                </tbody> 
    19992008        </table> 
Note: See TracChangeset for help on using the changeset viewer.