/** * Registers the directory $dir for removal when PHP shuts down. * * The directory and all of its contents will be removed recursively. * * @param string $dir */ public static function registerForRemoval($dir) { if (self::$isRegistered === false) { register_shutdown_function(array("ezcMailParserShutdownHandler", "shutdownCallback")); self::$isRegistered = true; } self::$directories[] = $dir; }