Development

Changeset 4739

You must first sign up to be able to contribute.

Changeset 4739

Show
Ignore:
Timestamp:
07/28/07 07:56:12 (1 year ago)
Author:
dwhittle
Message:

dwhittle: merge trunk changes to branch (r4717:4738)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/lib/exception/sfActionException.class.php

    r3248 r4739  
    2121class sfActionException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfActionException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfAutoloadException.class.php

    r3248 r4739  
    2121class sfAutoloadException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfAutoloadException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfCacheException.class.php

    r3248 r4739  
    2121class sfCacheException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfCacheException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfConfigurationException.class.php

    r3248 r4739  
    2222class sfConfigurationException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfConfigurationException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfContextException.class.php

    r3248 r4739  
    2020class sfContextException extends sfException 
    2121{ 
    22   /** 
    23    * Class constructor. 
    24    * 
    25    * @param string The error message 
    26    * @param int    The error code 
    27    */ 
    28   public function __construct($message = null, $code = 0) 
    29   { 
    30     parent::__construct($message, $code); 
    31     $this->setName('sfContextException'); 
    32   } 
    3322} 
  • branches/dwhittle/lib/exception/sfControllerException.class.php

    r3248 r4739  
    2222class sfControllerException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfControllerException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfDatabaseException.class.php

    r3248 r4739  
    2121class sfDatabaseException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfDatabaseException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfError404Exception.class.php

    r4309 r4739  
    2020{ 
    2121  /** 
    22    * Class constructor. 
    23    * 
    24    * @param string The error message 
    25    * @param int    The error code 
    26    */ 
    27   public function __construct($message = null, $code = 0) 
    28   { 
    29     $this->setName('sfError404Exception'); 
    30     parent::__construct($message, $code); 
    31   } 
    32  
    33   /** 
    3422   * Forwards to the 404 action. 
    3523   * 
  • branches/dwhittle/lib/exception/sfException.class.php

    r3248 r4739  
    3434  public function __construct($message = null, $code = 0) 
    3535  { 
    36     if ($this->getName() === null) 
    37     { 
    38       $this->setName('sfException'); 
    39     } 
    40  
    4136    parent::__construct($message, $code); 
    4237 
    43     if (sfConfig::get('sf_logging_enabled') && $this->getName() != 'sfStopException') 
    44     { 
    45       sfLogger::getInstance()->err('{'.$this->getName().'} '.$message); 
    46     } 
    47   } 
    48  
    49   /** 
    50    * Retrieves the name of this exception. 
    51    * 
    52    * @return string This exception's name 
    53    */ 
    54   public function getName() 
    55   { 
    56     return $this->name; 
     38    if (sfConfig::get('sf_logging_enabled') && __CLASS__ != 'sfStopException') 
     39    { 
     40      sfLogger::getInstance()->err(sprintf('{%s} %s', __CLASS__, $message)); 
     41    } 
    5742  } 
    5843 
     
    7055 
    7156    // don't print message if it is an sfStopException exception 
    72     if (method_exists($exception, 'getName') && $exception->getName() == 'sfStopException') 
     57    if (get_class($exception) == 'sfStopException') 
    7358    { 
    7459      if (!sfConfig::get('sf_test')) 
  • branches/dwhittle/lib/exception/sfFactoryException.class.php

    r3248 r4739  
    2222class sfFactoryException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfFactoryException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfFileException.class.php

    r3248 r4739  
    2121class sfFileException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfFileException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfFilterException.class.php

    r3248 r4739  
    2222class sfFilterException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfFilterException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfForwardException.class.php

    r3248 r4739  
    2222class sfForwardException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfForwardException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfInitializationException.class.php

    r3248 r4739  
    2121class sfInitializationException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfInitializationException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfParseException.class.php

    r3248 r4739  
    2222class sfParseException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfParseException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfRenderException.class.php

    r3248 r4739  
    2121class sfRenderException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfRenderException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfSecurityException.class.php

    r3248 r4739  
    2121class sfSecurityException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfSecurityException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfStopException.class.php

    r3248 r4739  
    2020{ 
    2121  /** 
    22    * Class constructor. 
    23    * 
    24    * @param string The error message 
    25    * @param int    The error code 
    26    */ 
    27   public function __construct($message = null, $code = 0) 
    28   { 
    29     $this->setName('sfStopException'); 
    30  
    31     // disable xdebug to avoid backtrace in error log 
    32     if (function_exists('xdebug_disable')) 
    33     { 
    34       xdebug_disable(); 
    35     } 
    36  
    37     parent::__construct($message, $code); 
    38   } 
    39  
    40   /** 
    4122   * Stops the current action. 
    4223   */ 
  • branches/dwhittle/lib/exception/sfStorageException.class.php

    r3248 r4739  
    2222class sfStorageException extends sfException 
    2323{ 
    24   /** 
    25    * Class constructor. 
    26    * 
    27    * @param string The error message 
    28    * @param int    The error code 
    29    */ 
    30   public function __construct($message = null, $code = 0) 
    31   { 
    32     $this->setName('sfStorageException'); 
    33     parent::__construct($message, $code); 
    34   } 
    3524} 
  • branches/dwhittle/lib/exception/sfValidatorException.class.php

    r3248 r4739  
    2121class sfValidatorException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfValidatorException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/lib/exception/sfViewException.class.php

    r3248 r4739  
    2121class sfViewException extends sfException 
    2222{ 
    23   /** 
    24    * Class constructor. 
    25    * 
    26    * @param string The error message 
    27    * @param int    The error code 
    28    */ 
    29   public function __construct($message = null, $code = 0) 
    30   { 
    31     $this->setName('sfViewException'); 
    32     parent::__construct($message, $code); 
    33   } 
    3423} 
  • branches/dwhittle/test/unit/exception/sfExceptionsTest.php

    r2277 r4739  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(40, new lime_output_color()); 
     13$t = new lime_test(20, new lime_output_color()); 
    1414 
    1515foreach (array( 
     
    2121  $class = sprintf('sf%sException', ucfirst($class)); 
    2222  $e = new $class(); 
    23   $t->is($e->getName(), $class, sprintf('"%s" exception name is "%s"', $class, $class)); 
    24   $t->is(get_parent_class($e), 'sfException', sprintf('"%s" inherits from sfException', $class)); 
     23  $t->ok($e instanceof sfException, sprintf('"%s" inherits from sfException', $class)); 
    2524}