Changeset 3127 for trunk/lib/Doctrine.php
- Timestamp:
- 11/10/07 19:54:34 (14 months ago)
- Files:
-
- 1 modified
-
trunk/lib/Doctrine.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine.php
r3092 r3127 715 715 $connections = $manager->getConnections(); 716 716 717 $results = array(); 718 717 719 foreach ($connections as $name => $connection) { 718 720 if ( ! empty($specifiedConnections) && !in_array($name, $specifiedConnections)) { … … 739 741 // Reopen original connection with newly created database 740 742 $manager->openConnection(new PDO($info['dsn'], $username, $password), $name, true); 743 744 $results[$name] = true; 741 745 } catch (Exception $e) { 742 746 $results[$name] = false; 743 747 } 744 748 } 749 750 return $results; 745 751 } 746 752 … … 762 768 763 769 $connections = $manager->getConnections(); 770 771 $results = array(); 764 772 765 773 foreach ($connections as $name => $connection) { … … 770 778 try { 771 779 $connection->export->dropDatabase($name); 780 781 $results[$name] = true; 772 782 } catch (Exception $e) { 773 783 $results[$name] = false; 774 784 } 775 785 } 786 787 return $results; 776 788 } 777 789 … … 1048 1060 public static function makeDirectories($path, $mode = 0777) 1049 1061 { 1062 if (!$path) { 1063 return false; 1064 } 1065 1050 1066 if (is_dir($path) || is_file($path)) { 1051 1067 return true; … … 1054 1070 return mkdir($path, $mode, true); 1055 1071 } 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 } 1056 1096 }