Changeset 1188

Show
Ignore:
Timestamp:
12/25/07 18:57:54 (8 months ago)
Author:
mikey
Message:

a call to vfsStreamWrapper::register() will now reset the root to null (implemented because of a hint by David Zülke)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/vfs/package.php

    r1187 r1188  
    4141- moved vfsStreamWrapper::PROTOCOL to vfsStream::SCHEME 
    4242- added new vfsStream::url() method to assist in creating correct vfsStream urls 
     43- a call to vfsStreamWrapper::register() will now reset the root to null (implemented because of a hint by David Zülke) 
    4344EOT; 
    4445 
  • trunk/src/main/php/org/stubbles/vfs/vfsStreamWrapper.php

    r1183 r1188  
    4444     * method to register the stream wrapper 
    4545     * 
     46     * Please be aware that a call to this method will reset the root element 
     47     * to null. 
     48     * If the stream is already registered the method returns silently. If there 
     49     * is already another stream wrapper registered for the scheme used by 
     50     * vfsStream a vfsStreamException will be thrown. 
     51     * 
    4652     * @throws  vfsStreamException 
    4753     */ 
    4854    public static function register() 
    4955    { 
     56        self::$root = null; 
    5057        if (true == self::$registered) { 
    5158            return; 
  • trunk/src/test/php/org/stubbles/vfs/vfsStreamWrapperTestCase.php

    r1183 r1188  
    9393 
    9494    /** 
     95     * ensure that a call to vfsStreamWrapper::register() resets the stream 
     96     *  
     97     * Implemented because of a hint by David Zülke. 
     98     */ 
     99    public function testResetByRegister() 
     100    { 
     101        $this->assertReference($this->foo, vfsStreamWrapper::getRoot()); 
     102        vfsStreamWrapper::register(); 
     103        $this->assertNull(vfsStreamWrapper::getRoot()); 
     104    } 
     105 
     106    /** 
    95107     * assure that a directory iteration works as expected 
    96108     */