src/Filesystem.php
public function remove($path)
    {
        if (! $this->adapter->isAbsolute($path)) {
            $path = $this->rootPath . $path;
        }
        if ($this->isFile($path, true)) {
            $this->adapter->unlink($path);
        } else {
            // clean the directory
            $path = rtrim($path, '/') . '/';
            foreach ($this->adapter->glob($path . '*') as $itemPath) {
                $this->remove($itemPath, true);
            }
            // remove it
            $this->adapter->rmdir($path);
        }
        return $this;
    }
public function remove($path)
    {
        if (! $this->adapter->isAbsolute($path)) {
            $path = $this->rootPath . $path;
        }
        if ($this->isFile($path, true)) {
            $this->adapter->unlink($path);
        } else {
            // clean the directory
            $path = rtrim($path, '/') . '/';
            foreach ($this->adapter->glob($path . '*') as $itemPath) {
                $this->remove($itemPath, true);
            }
            // remove it
            $this->adapter->rmdir($path);
        }
        return $this;
    }
public function remove ( $ path ) { if ( ! $ this -> adapter -> isAbsolute ( $ path ) ) { $ path = $ this -> rootPath . $ path ; } if ( $ this -> isFile ( $ path , true ) ) { $ this -> adapter -> unlink ( $ path ) ; } else { // clean the directory $ path = rtrim ( $ path , '/' ) . '/' ; foreach ( $ this -> adapter -> glob ( $ path . '*' ) as $ itemPath ) { $ this -> remove ( $ itemPath , true ) ; } // remove it $ this -> adapter -> rmdir ( $ path ) ; } return $ this ; }
Removes a file or directory recursively.

@param  string  $path
@return Tarsana\Filesystem
Removes a file or directory recursively .