note 55618 deleted from function.readdir by tularis

From: Date: Sun, 13 May 2007 19:02:39 +0000
Subject: note 55618 deleted from function.readdir by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-126526@lists.php.net to get a copy of this message
Note Submitter: anonymous at anonymous dot org ---- My simple function for clean up .svn directory It doesn't recursive, but exec rmdir :P function clean_svn( $stack ) { $dir_list = array(); $rm_list = array(); // translate to real path $stack = realpath( $stack ); // Initial dir_list with $stack array_push( $dir_list, $stack ); while( $current_dir = array_pop( $dir_list ) ) { $search = $current_dir . "\\" . "{*,.svn}"; foreach( glob( $search, GLOB_ONLYDIR | GLOB_BRACE ) as $name ) { if( ereg( '\.svn$', $name ) ) array_push( $rm_list, $name ); else array_push( $dir_list, $name ); } } // remove directory foreach( $rm_list as $name ) { exec( "rmdir /S /Q $name" ); } }

« previous php.notes (#126526) next »