Show
Ignore:
Timestamp:
11/10/07 19:54:34 (14 months ago)
Author:
jwage
Message:

Merged r3122:r3126

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r3092 r3127  
    715715        $connections = $manager->getConnections(); 
    716716         
     717        $results = array(); 
     718         
    717719        foreach ($connections as $name => $connection) { 
    718720            if ( ! empty($specifiedConnections) && !in_array($name, $specifiedConnections)) { 
     
    739741                // Reopen original connection with newly created database 
    740742                $manager->openConnection(new PDO($info['dsn'], $username, $password), $name, true); 
     743                 
     744                $results[$name] = true; 
    741745            } catch (Exception $e) { 
    742                  
     746                $results[$name] = false; 
    743747            } 
    744748        } 
     749         
     750        return $results; 
    745751    } 
    746752 
     
    762768         
    763769        $connections = $manager->getConnections(); 
     770         
     771        $results = array(); 
    764772         
    765773        foreach ($connections as $name => $connection) { 
     
    770778            try { 
    771779                $connection->export->dropDatabase($name); 
     780                 
     781                $results[$name] = true; 
    772782            } catch (Exception $e) { 
    773                  
     783                $results[$name] = false; 
    774784            } 
    775785        } 
     786         
     787        return $results; 
    776788    } 
    777789 
     
    10481060    public static function makeDirectories($path, $mode = 0777) 
    10491061    { 
     1062        if (!$path) { 
     1063          return false; 
     1064        } 
     1065         
    10501066        if (is_dir($path) || is_file($path)) { 
    10511067          return true; 
     
    10541070        return mkdir($path, $mode, true);  
    10551071    } 
     1072     
     1073    function removeDirectories($folderPath) 
     1074    { 
     1075        if (is_dir($folderPath)) 
     1076        { 
     1077            foreach (scandir($folderPath) as $value) 
     1078            { 
     1079                if ($value != '.' && $value != '..') 
     1080                { 
     1081                    $value = $folderPath . "/" . $value; 
     1082 
     1083                    if (is_dir($value)) { 
     1084                        self::removeDirectories($value); 
     1085                    } else if (is_file($value)) { 
     1086                        @unlink($value); 
     1087                    } 
     1088                } 
     1089            } 
     1090 
     1091            return rmdir ( $folderPath ); 
     1092        } else { 
     1093            return false; 
     1094        } 
     1095    } 
    10561096}