protected function _rrmdir( $path )
    {
        $i = new DirectoryIterator( $path );
        foreach( $i as $f )
        {
            if( $f->isFile() )
            {
                $this->warn( 'Permanently removed file ' . str_replace( base_path(), null, $f->getRealPath() ) );
                unlink( $f->getRealPath() );
            }
            else if( !$f->isDot() && $f->isDir() )
            {
                $this->_rrmdir( $f->getRealPath() );
            }
        }
        $this->warn( 'Permanently removed directory' . str_replace( base_path(), null, $path ) );
        rmdir( $path );
    }
protected function _rrmdir( $path )
    {
        $i = new DirectoryIterator( $path );
        foreach( $i as $f )
        {
            if( $f->isFile() )
            {
                $this->warn( 'Permanently removed file ' . str_replace( base_path(), null, $f->getRealPath() ) );
                unlink( $f->getRealPath() );
            }
            else if( !$f->isDot() && $f->isDir() )
            {
                $this->_rrmdir( $f->getRealPath() );
            }
        }
        $this->warn( 'Permanently removed directory' . str_replace( base_path(), null, $path ) );
        rmdir( $path );
    }
protected function _rrmdir ( $ path ) { $ i = new DirectoryIterator ( $ path ) ; foreach ( $ i as $ f ) { if ( $ f -> isFile ( ) ) { $ this -> warn ( 'Permanently removed file ' . str_replace ( base_path ( ) , null , $ f -> getRealPath ( ) ) ) ; unlink ( $ f -> getRealPath ( ) ) ; } else if ( ! $ f -> isDot ( ) && $ f -> isDir ( ) ) { $ this -> _rrmdir ( $ f -> getRealPath ( ) ) ; } } $ this -> warn ( 'Permanently removed directory' . str_replace ( base_path ( ) , null , $ path ) ) ; rmdir ( $ path ) ; }
Recursively removes a folder along with all its files and directories
@param String $path
Recursively removes a folder along with all its files and directories