public static function shutdown()
    {
        $ptr = &self::$_shutdowndata;

        foreach (array_keys($ptr['paths']) as $val) {
            if (@is_file($val)) {
                self::_secureDelete($val);
                continue;
            }

            try {
                $it = new RecursiveIteratorIterator(
                    new RecursiveDirectoryIterator($val),
                    RecursiveIteratorIterator::CHILD_FIRST
                );
            } catch (UnexpectedValueException $e) {
                continue;
            }

            while ($it->valid()) {
                if (!$it->isDot()) {
                    if ($it->isDir()) {
                        @rmdir($it->key());
                    } elseif ($it->isFile()) {
                        self::_secureDelete($it->key());
                    } else {
                        @unlink($it->key());
                    }
                }
                $it->next();
            }

            @rmdir($val);
        }
    }
public static function shutdown()
    {
        $ptr = &self::$_shutdowndata;

        foreach (array_keys($ptr['paths']) as $val) {
            if (@is_file($val)) {
                self::_secureDelete($val);
                continue;
            }

            try {
                $it = new RecursiveIteratorIterator(
                    new RecursiveDirectoryIterator($val),
                    RecursiveIteratorIterator::CHILD_FIRST
                );
            } catch (UnexpectedValueException $e) {
                continue;
            }

            while ($it->valid()) {
                if (!$it->isDot()) {
                    if ($it->isDir()) {
                        @rmdir($it->key());
                    } elseif ($it->isFile()) {
                        self::_secureDelete($it->key());
                    } else {
                        @unlink($it->key());
                    }
                }
                $it->next();
            }

            @rmdir($val);
        }
    }
public static function shutdown ( ) { $ ptr = & self :: $ _shutdowndata ; foreach ( array_keys ( $ ptr [ 'paths' ] ) as $ val ) { if ( @ is_file ( $ val ) ) { self :: _secureDelete ( $ val ) ; continue ; } try { $ it = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ val ) , RecursiveIteratorIterator :: CHILD_FIRST ) ; } catch ( UnexpectedValueException $ e ) { continue ; } while ( $ it -> valid ( ) ) { if ( ! $ it -> isDot ( ) ) { if ( $ it -> isDir ( ) ) { @ rmdir ( $ it -> key ( ) ) ; } elseif ( $ it -> isFile ( ) ) { self :: _secureDelete ( $ it -> key ( ) ) ; } else { @ unlink ( $ it -> key ( ) ) ; } } $ it -> next ( ) ; } @ rmdir ( $ val ) ; } }
Deletes registered files at request shutdown.

This function should never be called manually; it is registered as a
shutdown function by Horde_Util::deleteAtShutdown() and called
automatically at the end of the request.

Contains code from gpg_functions.php.
Copyright 2002-2003 Braverock Ventures
Deletes registered files at request shutdown .