Changeset 887

Show
Ignore:
Timestamp:
08/31/07 18:14:07 (1 year ago)
Author:
mikey
Message:

added net.stubbles.lang.exceptions.stubThrowable and net.stubbles.lang.exceptions.stubRuntimeException
net.stubbles.lang.exceptions.stubException now implements net.stubbles.lang.exceptions.stubThrowable
changed some thrown stubExceptions into stubRuntimeExceptions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/events/stubLazyEventListener.php

    r768 r887  
    5959     * 
    6060     * @return  stubEventListener 
    61      * @throws  stubException 
    6261     */ 
    6362    protected function createInstance() 
     
    7473         
    7574        if (($instance instanceof stubEventListener) == false) { 
    76             throw new stubException('Lazy loaded event listener ' . $this->fqClassName . ' is not an instance of ' . $this->getPackageName() . '.stubEventListener.'); 
     75            throw new stubRuntimeException('Lazy loaded event listener ' . $this->fqClassName . ' is not an instance of ' . $this->getPackageName() . '.stubEventListener.'); 
    7776        } 
    7877         
  • trunk/src/main/php/net/stubbles/ipo/request/stubAbstractRequest.php

    r753 r887  
    7979    /** 
    8080     * cloning is forbidden 
    81      *  
    82      * @throws  stubException 
    8381     */ 
    8482    protected final function __clone() 
    8583    { 
    86         throw new stubException('Cloning of request is not allowed!'); 
     84        throw new stubRuntimeException('Cloning of request is not allowed!'); 
    8785    } 
    8886 
  • trunk/src/main/php/net/stubbles/lang/exceptions/stubException.php

    r777 r887  
    1313 * @subpackage  lang_exceptions 
    1414 */ 
    15 class stubException extends Exception implements stubObject 
     15class stubException extends Exception implements stubThrowable 
    1616{ 
    1717    /** 
     
    6767     * 
    6868     * @return  string 
     69     * @XMLIgnore 
    6970     */ 
    7071    public function hashCode() 
     
    7879     * @param   mixed  $compare 
    7980     * @return  bool 
    80      * @XMLIgnore 
    8181     */ 
    8282    public function equals($compare) 
  • trunk/src/main/php/net/stubbles/rdbms/pdo/stubDatabasePDOConnection.php

    r482 r887  
    4040    { 
    4141        if (extension_loaded('pdo') == false) { 
    42             throw new stubException('Can not create ' . __CLASS__ . ', requires PHP-extension "pdo".'); 
     42            throw new stubRuntimeException('Can not create ' . __CLASS__ . ', requires PHP-extension "pdo".'); 
    4343        } 
    4444         
  • trunk/src/main/php/net/stubbles/stubClassLoader.php

    r810 r887  
    346346stubClassLoader::load('net.stubbles.lang.stubObject', 
    347347                      'net.stubbles.lang.stubBaseObject', 
     348                      'net.stubbles.lang.exceptions.stubThrowable', 
    348349                      'net.stubbles.lang.exceptions.stubException', 
     350                      'net.stubbles.lang.exceptions.stubRuntimeException', 
    349351                      'net.stubbles.lang.serialize.stubSerializable', 
    350352                      'net.stubbles.lang.serialize.stubSerializableObject', 
  • trunk/src/main/php/net/stubbles/util/ext/stubXPClassLoader.php

    r777 r887  
    4242     * @param   string  $version  optional  the version to use 
    4343     * @throws  stubIllegalArgumentException 
    44      * @throws  stubException 
    4544     */ 
    4645    public function __construct($version = null) 
     
    5453            throw new stubIllegalArgumentException('Can not use a version of the XP-Framework that is lower than 5.0.0.'); 
    5554        } elseif (null != $version && file_exists($libPath . 'xp-rt-' . $version . '.xar') == false) { 
    56             throw new stubException('Can not find XP-Framework ' . $version . ' in lib path ' . stubConfig::getLibPath()); 
     55            throw new stubRuntimeException('Can not find XP-Framework ' . $version . ' in lib path ' . stubConfig::getLibPath()); 
    5756        } elseif (null == $version) { 
    5857            $dir     = new DirectoryIterator(stubConfig::getLibPath()); 
     
    7069 
    7170            if (version_compare($version, '5.0.0', '<') == true) { 
    72                 throw new stubException('Did not find a copy of the XP-Framework 5.0.0 or higher.'); 
     71                throw new stubRuntimeException('Did not find a copy of the XP-Framework 5.0.0 or higher.'); 
    7372            } 
    7473        } 
  • trunk/src/main/php/net/stubbles/util/log/stubLogDataFactory.php

    r416 r887  
    2828     * @param   int            $level    optional  log level of the log data 
    2929     * @return  stubLogData 
    30      * @throws  stubException  in case the created class is not an instance of stubLogData 
    3130     */ 
    3231    public static function create(stubSession $session, $target, $level = stubLogger::LEVEL_INFO) 
     
    4039        $logData = new $nqClassName($session, $target, $level); 
    4140        if (($logData instanceof stubLogData) == false) { 
    42             throw new stubException('Configured net.stubbles.util.log.class is not an instance of stubLogData.'); 
     41            throw new stubRuntimeException('Configured net.stubbles.util.log.class is not an instance of stubLogData.'); 
    4342        } 
    4443         
  • trunk/src/main/php/net/stubbles/util/xjconf/stubXJConfClassLoader.php

    r580 r887  
    8787             */ 
    8888            if ((@include 'XJConf/XJConfLoader.php') == false) { 
    89                 throw new stubException('XJConf could not be found in lib nor in include path.'); 
     89                throw new stubRuntimeException('XJConf could not be found in lib nor in include path.'); 
    9090            } 
    9191        } else { 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisConfig.php

    r807 r887  
    2828     * @param   string  $cachePath   optional  path to cache files 
    2929     * @param   string  $configPath  optional  path to config files 
    30      * @throws  stubException 
    3130     */ 
    3231    public function __construct($cachePath = null, $configPath = null) 
     
    3534        $xjconfProxy->process(); 
    3635        if (isset($this->config['parts']) == false || count($this->config['parts']) == 0) { 
    37             throw new stubException('No parts configured.'); 
     36            throw new stubRuntimeException('No parts configured.'); 
    3837        } 
    3938         
    4039        if (isset($this->config['frames']) == false || count($this->config['frames']) == 0) { 
    41             throw new stubException('No frames configured.'); 
     40            throw new stubRuntimeException('No frames configured.'); 
    4241        } 
    4342    } 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisIncludeTemplatePageElement.php

    r813 r887  
    5757    { 
    5858        if (isset($context['template']) === false || ($context['template'] instanceof stubMemphisTemplate) === false) { 
    59             throw new stubException('Context contains no template of instance net.stubbles.websites.memphis.stubMemphisTemplate'); 
     59            throw new stubRuntimeException('Context contains no template of instance net.stubbles.websites.memphis.stubMemphisTemplate'); 
    6060        } 
    6161         
  • trunk/src/main/php/net/stubbles/websites/stubFrontController.php

    r857 r887  
    7272     * @param   stubInterceptorInitializer    $interceptorInitializer    initializer for the interceptors 
    7373     * @param   stubProcessorResolverFactory  $processorResolverFactory  factory to create the processor resolver 
    74      * @throws  stubException 
    7574     */ 
    7675    public function __construct(stubRegistryInitializer $registryInitializer, stubInterceptorInitializer $interceptorInitializer, stubProcessorResolverFactory $processorResolverFactory) 
     
    106105        $this->request = new $className(); 
    107106        if (($this->request instanceof stubRequest) == false) { 
    108             throw new stubException('Configured request class is not an instance of stubRequest.'); 
     107            throw new stubRuntimeException('Configured request class is not an instance of stubRequest.'); 
    109108        } 
    110109 
     
    117116        $this->session = new $className($this->request, stubRegistry::getConfig('net.stubbles.ipo.session.name', stubSession::DEFAULT_SESSION_NAME)); 
    118117        if (($this->session instanceof stubSession) == false) { 
    119             throw new stubException('Configured session class is not an instance of stubSession.'); 
     118            throw new stubRuntimeException('Configured session class is not an instance of stubSession.'); 
    120119        } 
    121120         
  • trunk/src/main/php/net/stubbles/websites/xml/stubXMLPostInterceptor.php

    r878 r887  
    4949     * @param   stubSession    $session   access to session data 
    5050     * @param   stubResponse   $response  access to response data 
    51      * @throws  stubException 
    5251     */ 
    5352    public function postProcess(stubRequest $request, stubSession $session, stubResponse $response) 
     
    6059        $binder = stubRegistry::get('net.stubbles.ioc.stubBinder'); 
    6160        if (($binder instanceof stubBinder) === false) { 
    62             throw new stubException('No instance of net.stubbles.ioc.stubBinder in registry.'); 
     61            throw new stubRuntimeException('No instance of net.stubbles.ioc.stubBinder in registry.'); 
    6362        } 
    6463         
     
    127126     * 
    128127     * @return  array 
    129      * @throws  stubException 
    130128     */ 
    131129    protected function getCallbackList() 
     
    133131        $iniFile = stubConfig::getConfigPath() . '/xsl-callbacks.ini'; 
    134132        if (file_exists($iniFile) === false) { 
    135             throw new stubException('Configuration file ' . $iniFile . ' for XSL callback configuration is missing.'); 
     133            throw new stubRuntimeException('Configuration file ' . $iniFile . ' for XSL callback configuration is missing.'); 
    136134        } 
    137135         
  • trunk/src/main/php/net/stubbles/xml/xsl/stubXSLCallback.php

    r841 r887  
    5959    protected final function __clone() 
    6060    { 
    61         throw new stubException('Cloning of ' . __CLASS__ . ' is not allowed.'); 
     61        throw new stubRuntimeException('Cloning of ' . __CLASS__ . ' is not allowed.'); 
    6262    } 
    6363 
  • trunk/src/main/php/net/stubbles/xml/xsl/stubXSLProcessor.php

    r870 r887  
    5656    { 
    5757        if (extension_loaded('xsl') == false) { 
    58             throw new stubException('Can not create ' . __CLASS__ . ', requires PHP-extension "xsl".'); 
     58            throw new stubRuntimeException('Can not create ' . __CLASS__ . ', requires PHP-extension "xsl".'); 
    5959        } 
    6060         
  • trunk/src/test/php/net/stubbles/events/stubLazyEventListenerTestCase.php

    r768 r887  
    3030    { 
    3131        $lazyEventListener = new stubLazyEventListener('stdClass'); 
    32         $this->expectException('stubException'); 
     32        $this->expectException('stubRuntimeException'); 
    3333        $lazyEventListener->handleEvent(new stubEvent('foo')); 
    3434    } 
     
    4040    { 
    4141        $lazyEventListener = new stubLazyEventListener('stdClass'); 
    42         $this->expectException('stubException'); 
     42        $this->expectException('stubRuntimeException'); 
    4343        $lazyEventListener->autoremove(); 
    4444    } 
  • trunk/src/test/php/net/stubbles/util/log/stubLogDataFactoryTestCase.php

    r416 r887  
    4545    { 
    4646        stubRegistry::setConfig('net.stubbles.util.log.class', 'NoLogData'); 
    47         $this->expectException('stubException'); 
     47        $this->expectException('stubRuntimeException'); 
    4848        stubLogDataFactory::create(new MockstubSession(), 'foo'); 
    4949    } 
  • trunk/src/test/php/net/stubbles/websites/xml/stubXMLPostInterceptorTestCase.php

    r878 r887  
    180180    { 
    181181        stubRegistry::remove('net.stubbles.ioc.stubBinder'); 
    182         $this->expectException('stubException'); 
     182        $this->expectException('stubRuntimeException'); 
    183183        $this->xmlPostInterceptor->postProcess($this->mockRequest, $this->mockSession, $this->xmlResponse); 
    184184    }