[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/phing/ -> BuildException.php (source)

   1  <?php
   2  /*
   3   *  $Id: BuildException.php 3076 2006-12-18 08:52:12Z fabien $
   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   * BuildException is for when things go wrong in a build execution.
  24   *
  25   * @author   Andreas Aderhold <andi@binarycloud.com>
  26   * @version  $Revision: 1.12 $
  27   * @package  phing
  28   */
  29  class BuildException extends Exception {
  30  
  31      /** location in the xml file */
  32      protected $location = null; 
  33              
  34      /** The nested "cause" exception. */
  35      protected $cause;
  36      
  37      /**
  38       * Construct a BuildException.
  39       * Supported signatures:
  40       *         throw new BuildException($causeExc);
  41       *         throw new BuildException($msg);
  42       *         throw new Buildexception($causeExc, $loc);
  43       *         throw new BuildException($msg, $causeExc);
  44       *         throw new BuildException($msg, $loc);
  45       *         throw new BuildException($msg, $causeExc, $loc);
  46       */
  47      function __construct($p1, $p2 = null, $p3 = null) {        
  48          
  49          $cause = null;
  50          $loc = null;
  51          $msg = "";
  52          
  53          if ($p3 !== null) {
  54              $cause = $p2;
  55              $loc = $p3;
  56              $msg = $p1;
  57          } elseif ($p2 !== null) {
  58              if ($p2 instanceof Exception) {
  59                  $cause = $p2;
  60                  $msg = $p1;
  61              } elseif ($p2 instanceof Location) {
  62                  $loc = $p2;
  63                  if ($p1 instanceof Exception) {
  64                      $cause = $p1;
  65                  } else {
  66                      $msg = $p1;
  67                  }
  68              }
  69          } elseif ($p1 instanceof Exception) {
  70              $cause = $p1;
  71          } else {
  72              $msg = $p1;
  73          }
  74          
  75          parent::__construct($msg);
  76          
  77          if ($cause !== null) {
  78              $this->cause = $cause;
  79              $this->message .= " [wrapped: " . $cause->getMessage() ."]";
  80          }
  81          
  82          if ($loc !== null) {
  83              $this->setLocation($loc);
  84          }                
  85      }
  86      
  87      function getCause() {
  88          return $this->cause;
  89      }
  90      
  91      function getLocation() {
  92          return $this->location;
  93      }
  94  
  95      function setLocation($loc) {        
  96          $this->location = $loc;
  97          $this->message = $loc->toString() . ': ' . $this->message;
  98      }
  99  
 100  }


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7