00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 define('MULTI_SUCCESS', 0);
00018
00019
00020 define('MULTI_NOTHING_TO_DO', 0);
00021
00022
00023 define('MULTI_NAGIOS_OK', 0);
00024
00025
00026 define('MULTI_NAGIOS_WARNING', 1);
00027
00028
00029 define('MULTI_NAGIOS_CRITICAL', 2);
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 function _multi_recommended_version($core, $project = 'drupal', $float = FALSE, $path = FALSE) {
00123
00124 if (!$path) {
00125 $path = 'http://updates.drupal.org/release-history/'. $project. '/'. $core;
00126 }
00127 if ($xml = @simplexml_load_file($path)) {
00128 if ($error = $xml->xpath('/error')) {
00129 return drush_set_error('MULTI_COULD_NOT_LOAD_UPDATE_FILE', $error[0]);
00130 }
00131 else {
00132 $recommended_major = $xml->xpath("/project/recommended_major");
00133 if (!empty($recommended_major)) {
00134 $xpath_releases = "/project/releases/release[status='published'][version_major=" . (string)$recommended_major[0] . "]";
00135 $releases = $xml->xpath($xpath_releases);
00136 $release = (array)$releases[0];
00137 }
00138 else {
00139 drush_log('No recommended version available, taking latest release', 'warning');
00140 $xpath_releases = '/project/releases/release';
00141 $releases = $xml->xpath($xpath_releases);
00142 $release = (array)$releases[0];
00143 }
00144 return (!$float) ? $release : $release['version'];
00145 }
00146 }
00147 else {
00148
00149 return drush_set_error('MULTI_DOWNLOAD_FAILED',
00150 dt('Could not download project status information from !url',
00151 array('!url' => $path)
00152 )
00153 );
00154 }
00155 }
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 function _multi_released_versions($core, $project = 'drupal') {
00172 $url = 'http://updates.drupal.org/release-history/' .$project . '/'. $core . '.x';
00173 if ($xml = @simplexml_load_file($url)) {
00174 if ($error = $xml->xpath('/error')) {
00175 return drush_set_error('MULTI_COULD_NOT_LOAD_UPDATE_FILE',
00176 $error[0]
00177 );
00178 }
00179 else {
00180 $recommended_major = $xml->xpath("/project/recommended_major");
00181 $xpath_releases = "/project/releases/release[status='published'][version_major=" . (string)$recommended_major[0] . "]";
00182 $releases = $xml->xpath($xpath_releases);
00183 foreach ($releases as $release) {
00184 $released_versions[] = 'drupal-' . $release->version;
00185 }
00186 usort($released_versions, "strnatcmp");
00187 return $released_versions;
00188 }
00189 }
00190 else {
00191
00192 return drush_set_error('MULTI_DOWNLOAD_FAILED',
00193 dt('Could not download project status information from !url',
00194 array('!url' => $url))
00195 );
00196 }
00197 }
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210 function _multi_check_project($core, $project = 'drupal') {
00211
00212 $url = 'http://updates.drupal.org/release-history/'. $project . '/'. $core;
00213 if ($xml = @simplexml_load_file($url)) {
00214 if ($error = $xml->xpath('/error')) {
00215 return drush_set_error('MULTI_INVALID_PROJECT_OR_MAJOR_VERSION',
00216 dt('Combination of project !project and major version !$core does not exist.',
00217 array('!project' => $project, '!core' => $core)
00218 )
00219 );
00220 }
00221 else {
00222 return TRUE;
00223 }
00224 }
00225 else {
00226
00227 return drush_set_error('MULTI_DOWNLOAD_FAILED',
00228 dt('Could not download project status information from !url',
00229 array('!url' => $url))
00230 );
00231 }
00232 }
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 function _multi_scan_sites($symlinks = TRUE){
00255
00256
00257
00258 $sites = array();
00259 $scan_result = drush_scan_directory(
00260 rtrim(drush_get_context('DRUSH_DRUPAL_ROOT')) . '/sites', '/^settings\.php$/'
00261 );
00262
00263 foreach($scan_result as $site ) {
00264
00265 $tmp = array();
00266 $tmp = explode('/', ltrim($site->filename, '/'));
00267
00268 if (!$symlinks) {
00269 $dir = $tmp;
00270
00271 $dir = implode('/', $dir);
00272
00273 $dir = '/' . $dir;
00274 if (is_link($dir)) {
00275 continue;
00276 }
00277 }
00278 $sites[] = $tmp[count($tmp)-2];
00279 }
00280 return $sites;
00281 }
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332 function _multi_scan_symlinks($dir = FALSE, $recurse = TRUE, $min_depth = 0, $depth = 0 ) {
00333
00334 if (!$dir) {
00335 $dir = (string) drush_get_context('DRUSH_DRUPAL_ROOT');
00336 }
00337
00338 $path_parts = pathinfo($dir);
00339 $dir = (is_link($dir) && !realpath($dir)) ? $path_parts['dirname'] . '/' . readlink($dir) : $dir;
00340
00341 $nomask = array('.', '..', 'CVS');
00342 $files = array();
00343
00344 if (is_dir($dir) && $handle = opendir($dir)) {
00345 while (FALSE !== ($file = readdir($handle))) {
00346
00347 if (!in_array($file, $nomask)) {
00348 if (is_dir("$dir/$file") && $recurse && !is_link("$dir/$file")) {
00349
00350 $files = array_merge( _multi_scan_symlinks("$dir/$file", $recurse, $min_depth, $depth + 1), $files);
00351 }
00352 elseif ($depth >= $min_depth) {
00353 $filename = "$dir/$file";
00354 if (is_link($filename)) {
00355 $basename = basename($file);
00356 $files[$basename] = new stdClass();
00357 $files[$basename]->filename = $filename;
00358 $files[$basename]->basename = $basename;
00359 $files[$basename]->target = readlink($filename);
00360 $files[$basename]->dirname = dirname($filename);
00361 }
00362 }
00363 }
00364 }
00365 closedir($handle);
00366 }
00367 return $files;
00368 }
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381 function _multi_preserve_symlinks($drupal_root, $new_drupal_root) {
00382
00383
00384 if (drush_op('chdir', realpath($new_drupal_root))) {
00385
00386
00387 $symlinks = array();
00388 $symlinks = _multi_scan_symlinks($drupal_root, TRUE);
00389
00390
00391 foreach ($symlinks as $symlink) {
00392
00393
00394 if (is_file($symlink->basename) || is_dir($symlink->basename)) {
00395 if (!drush_op('rename', $symlink->basename, $symlink->basename . '-' . date('Y-m-d\TH:i') . '-drupalupdate')) {
00396 return drush_set_error('MULTI_COULD_NOT_RENAME',
00397 dt('Could not rename !existing to !backup',
00398 array(
00399 '!existing' => $symlink->basename,
00400 '!backup' => $symlink->basename . '-' . date('Y-m-d\TH:i') . '-drupalupdate'
00401 )
00402 )
00403 );
00404 }
00405 }
00406
00407 $symlink_target = _multi_relative_path(realpath($symlink->target));
00408
00409
00410
00411 $symlink_dir = ltrim(str_replace($drupal_root, '', $symlink->dirname), '/');
00412 (!empty($symlink_dir)) ? $symlink_dir .= '/' : $symlink_dir;
00413
00414 if (!drush_op('symlink', $symlink_target, $symlink_dir . $symlink->basename)) {
00415 return drush_set_error('MULTI_COULD_NOT_CREATE_SYMLINK',
00416 dt('Could not create symbolic link from !target into !pwd.',
00417 array(
00418 '!target' => rtrim($filename, '/'),
00419 '!pwd' => getcwd()
00420 )
00421 )
00422 );
00423 }
00424 }
00425 }
00426
00427 else {
00428 return drush_set_error('DRUSH_SM_COULD_CHANGE_NEW_DRUPAL_ROOT',
00429 dt('chdir(): Could not change to new Drupal root !new.',
00430 array('!new' => $new_drupal_root)
00431 )
00432 );
00433 }
00434 }
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448 function _multi_available_installations() {
00449 $scan_result = array();
00450 $scan_result = drush_scan_directory(
00451 rtrim(drush_get_context('DRUSH_DRUPAL_ROOT')) . '/..',
00452 '/^drupal-' . drush_drupal_major_version().'/', array(), 0, FALSE
00453 );
00454 if (empty($scan_result)) {
00455 return 0;
00456 }
00457 else {
00458 foreach ($scan_result as $install) {
00459 $installations[] = $install->basename;
00460 }
00461 usort($installations, "strnatcmp");
00462 return $installations;
00463 }
00464 }
00465
00466
00467
00468
00469
00470
00471
00472
00473 function _multi_previous_installations() {
00474
00475 $installations = array();
00476 if(count($installations = _multi_available_installations()) != 1) {
00477 $size = array_keys($installations, _multi_current_version());
00478 if (sizeof($size) == 0) {
00479 return FALSE;
00480 }
00481
00482 $previous_versions = array_chunk($installations, $size[0]);
00483 if (sizeof($previous_versions[0]) != 0) {
00484 return $previous_versions[0];
00485 }
00486 else {
00487 return FALSE;
00488 }
00489 }
00490 else {
00491 return FALSE;
00492 }
00493 }
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503 function _multi_previous_installation() {
00504
00505 $installations = array();
00506 $installations = _multi_available_installations();
00507 if ($length = count($installations) != 1) {
00508
00509 $pos = array_keys($installations, _multi_current_version());
00510 if (bcsub($pos[0],1) != -1 ) {
00511
00512 return $installations[bcsub($pos[0],1)];
00513 }
00514 else {
00515 return FALSE;
00516 }
00517 }
00518 else {
00519 return FALSE;
00520 }
00521 }
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533 function _multi_relative_path($target) {
00534
00535 $folder = $target;
00536 $target = getcwd();
00537
00538
00539 $target = trim($target,'/');
00540 $folder = trim($folder,'/');
00541 while (substr_count($target, '//') ) $target = str_replace('//', '/', $target);
00542 while (substr_count($folder, '//')) $folder = str_replace('//', '/', $folder);
00543
00544
00545 $arr1 = explode('/', $target);
00546 if ($arr1 == array('')) $arr1 = array();
00547 $arr2 = explode('/', $folder);
00548 if ($arr2 == array('')) $arr2 = array();
00549 $size1 = count($arr1);
00550 $size2 = count($arr2);
00551
00552
00553 $path='';
00554 for($i=0; $i<min($size1,$size2); $i++) {
00555 if ($arr1[$i] == $arr2[$i]) continue;
00556 else $path = '../'.$path.$arr2[$i].'/';
00557 }
00558 if ($size1 > $size2)
00559 for ($i = $size2; $i < $size1; $i++)
00560 $path = '../'.$path;
00561 else if ($size2 > $size1)
00562 for ($i = $size1; $i < $size2; $i++)
00563 $path .= $arr2[$i].'/';
00564
00565 return $path;
00566 }
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586 function _multi_nagios_root() {
00587
00588 if ($file = drush_get_option('file')) {
00589 if (!is_file($file)) {
00590 $file = FALSE;
00591 }
00592 }
00593 else {
00594 $file = FALSE;
00595 }
00596 if ($recommended_version = _multi_recommended_version(drush_drupal_major_version(). '.x', 'drupal', FALSE, $file)) {
00597
00598 if ((float) drush_drupal_version() < (float) $recommended_version['version']) {
00599
00600 $update_type = $recommended_version['terms']->term->value;
00601 if($update_type == 'Security update') {
00602 $status_signal = dt('DRUPAL ROOT CRITICAL');
00603 $status_code = MULTI_NAGIOS_CRITICAL;
00604 }
00605 else {
00606 $status_signal = dt('DRUPAL ROOT WARNING');
00607 $status_code = MULTI_NAGIOS_WARNING;
00608 }
00609
00610 drush_print(
00611 dt('!status_signal - !version @ !drupal_root: drupal-!remcommended_version (!update_type) from !release-date available, see !release_link for details.',
00612 array(
00613 '!status_signal' => $status_signal,
00614 '!version' => _multi_current_version(),
00615 '!drupal_root' => drush_get_context('DRUSH_DRUPAL_ROOT'),
00616 '!remcommended_version' => $recommended_version['version'],
00617 '!update_type' => $update_type,
00618 '!release-date' => date('Y-m-d\ H:i', $recommended_version['date']),
00619 '!release_link' => $recommended_version['release_link'],
00620 )
00621 )
00622 );
00623 return $status_code;
00624 }
00625 else {
00626 drush_print(
00627 dt('DRUPAL ROOT OK - !version @ !drupal_root is uptodate.',
00628 array(
00629 '!version' => _multi_current_version(),
00630 '!drupal_root' => drush_get_context('DRUSH_DRUPAL_ROOT'),
00631 )
00632 )
00633 );
00634 return MULTI_NAGIOS_OK;
00635 }
00636 }
00637 else {
00638 return $recommended_version;
00639 }
00640 }
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652 function _multi_nagios_site() {
00653
00654 drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');
00655 include(DRUSH_BASE_PATH . '/commands/pm/updatecode.pm.inc');
00656
00657 $updatable = FALSE;
00658 $updates = $security_updates = $not_supported = array();
00659
00660 drush_bootstrap_max();
00661
00662
00663 ob_start();
00664 $projects = _pm_get_update_info();
00665 ob_end_clean();
00666
00667
00668 foreach($projects as $project) {
00669 switch (pm_update_filter($project)) {
00670 case dt('Update available') :
00671 $updates[] = $project['name'];
00672 $updatable = TRUE;
00673 break;
00674 case dt('SECURITY UPDATE available'):
00675 $security_updates[] = $project['name'];
00676 $updatable = TRUE;
00677 break;
00678 case dt('Installed version not supported'):
00679 $not_supported[] = $project['name'];
00680 $updatable = TRUE;
00681 break;
00682 }
00683 }
00684
00685
00686 switch (drush_drupal_major_version()) {
00687 case 5:
00688 $updates_path = '/?q=admin/logs/updates';
00689 break;
00690 case 6:
00691 case 7:
00692 $updates_path = '/?q=admin/reports/updates';
00693 break;
00694 }
00695
00696
00697 if($updatable) {
00698
00699 if (!empty($security_updates)) {
00700 $status_msg = dt('DRUPAL SITE CRITICAL - !uri @ !site_root: ',
00701 array(
00702 '!uri' => drush_get_context('DRUSH_URI'),
00703 '!site_root'=> drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . drush_get_context('DRUSH_DRUPAL_SITE_ROOT'),
00704 )
00705 );
00706 $status_msg .= dt('SECURITY UPDATES available for !modules',
00707 array(
00708 '!modules' => implode(',', $security_updates),
00709 )
00710 );
00711 if (!empty($updates)) {
00712 $status_msg .= dt(', Updates available for !modules',
00713 array(
00714 '!modules' => implode(',', $updates)
00715 )
00716 );
00717 }
00718 if (!empty($not_supported)) {
00719 $status_msg .= dt(', Installed version not supported: !modules',
00720 array(
00721 '!module' => implode(',', $not_supported)
00722 )
00723 );
00724 }
00725 $status_msg .= dt(', see http://!update_uri for details.',
00726 array(
00727 '!update_uri' => drush_get_context('DRUSH_URI') . $updates_path
00728 )
00729 );
00730 $status_code = MULTI_NAGIOS_CRITICAL;
00731 }
00732
00733 else if (!empty($updatable) || !empty($not_supported)) {
00734 $status_msg = dt('DRUPAL SITE WARNING - !uri @ !site_root: ',
00735 array(
00736 '!uri' => drush_get_context('DRUSH_URI'),
00737 '!site_root'=> drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . drush_get_context('DRUSH_DRUPAL_SITE_ROOT'),
00738 )
00739 );
00740 if (!empty($updates)) {
00741 $status_msg .= dt('Updates available for !modules',
00742 array(
00743 '!modules' => implode(',', $updates)
00744 )
00745 );
00746 }
00747 if (!empty($not_supported)) {
00748 if (!empty($updates)) {
00749 $status_msg .= ', ';
00750 }
00751 $status_msg .= dt('Installed version not supported: !modules',
00752 array(
00753 '!module' => implode(',', $not_supported)
00754 )
00755 );
00756 }
00757 $status_msg .= dt(', see http://!update_uri for details.',
00758 array(
00759 '!update_uri' => drush_get_context('DRUSH_URI') . $updates_path
00760 )
00761 );
00762 $status_code = MULTI_NAGIOS_WARNING;
00763 }
00764 }
00765 else {
00766
00767 $status_msg = dt('DRUPAL SITE OK - !uri @ !site_root: Everything is uptodate.',
00768 array(
00769 '!uri' => drush_get_context('DRUSH_URI'),
00770 '!site_root'=> drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . drush_get_context('DRUSH_DRUPAL_SITE_ROOT'),
00771 )
00772 );
00773 $status_code = MULTI_NAGIOS_OK;
00774 }
00775
00776
00777 drush_print($status_msg);
00778 return $status_code;
00779 }
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809 function _multi_sql_dump_full($db_spec = array(), $site = NULL, $datetime = NULL, $comment = NULL, $target = NULL) {
00810
00811
00812 $result_file = $target . '/' . $site . $datetime . $comment . '.sql';
00813
00814
00815 drush_set_option('result-file', $result_file);
00816
00817 $exec = drush_sql_dump($db_spec);
00818 if (drush_op_system($exec[0]) == 0) {
00819 drush_log(
00820 dt('SQL dump for site !site, database !database saved in !file.',
00821 array(
00822 '!site' => $site,
00823 '!database' => $db_spec['database'],
00824 '!file' => $result_file
00825 )
00826 ),
00827 'success'
00828 );
00829 if (drush_get_option('bzip2')) {
00830
00831 if (is_file($result_file . '.bz2')){
00832 drush_shell_exec('rm '. $result_file . '.bz2');
00833 drush_log(
00834 dt('Overwriting existing file !file',
00835 array('!file' => $result_file . '.bz2')
00836 ),
00837 'success'
00838 );
00839 }
00840 if (drush_shell_exec("bzip2 \"$result_file\"")) {
00841 drush_log(dt('Compressed !file using bzip2.',
00842 array('!file' => $result_file)),
00843 'success'
00844 );
00845 }
00846 }
00847 }
00848 }
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871 function _multi_sql_dump_tables($db_spec = array(), $site = NULL, $datetime = NULL, $comment = NULL, $target = NULL) {
00872
00873
00874 $exec = 'echo "SHOW TABLES"|';
00875 $exec.= 'mysql -u' . $db_spec['username'];
00876 $exec.= ' -p'. $db_spec['password'];
00877 $exec.= ' '. $db_spec['database'];
00878 $output = shell_exec($exec);
00879
00880 $tables = array();
00881 $tables = explode("\n", $output);
00882
00883 unset($tables[0]);
00884
00885 unset($tables[sizeof($tables)]);
00886
00887
00888 foreach($tables as $table) {
00889
00890
00891 $result_file = $target . '/' . $site . '.' . $table . $datetime . $comment . '.sql';
00892
00893
00894 $exec = 'mysqldump -u' . $db_spec['username'];
00895 $exec.= ' -p'. $db_spec['password'];
00896 $exec.= ' '. $db_spec['database'] .' ' . $table;
00897
00898 if (drush_shell_exec($exec . '>' . $result_file)) {
00899 drush_log(
00900 dt('SQL dump for site !site, datebase !database, table !table saved in !file.',
00901 array(
00902 '!site' => $site,
00903 '!database' => $db_spec['database'],
00904 '!table' => $table,
00905 '!file' => $result_file
00906 )
00907 ),
00908 'success'
00909 );
00910 if (drush_get_option('bzip2')) {
00911
00912 if (is_file($result_file . '.bz2')){
00913 drush_shell_exec('rm '. $result_file . '.bz2');
00914 drush_log(
00915 dt('Overwriting existing file !file',
00916 array('!file' => $result_file . '.bz2')
00917 ),
00918 'success'
00919 );
00920 }
00921 if (drush_shell_exec("bzip2 \"$result_file\"")) {
00922 drush_log(dt('Compressed !file using bzip2.',
00923 array('!file' => $result_file)),
00924 'success'
00925 );
00926 }
00927 }
00928 }
00929 }
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945 function _multi_current_version() {
00946 return 'drupal-' . drush_drupal_version();
00947 }
00948
00949
00950
00951
00952
00953
00954
00955 function _multi_check_site($site) {
00956
00957 $sites = array();
00958 $sites = _multi_scan_sites();
00959 if (in_array($site, $sites)) {
00960 return TRUE;
00961 }
00962 return FALSE;
00963 }
00964
00965
00966
00967
00968
00969
00970
00971
00972 function _multi_check_db_url($site) {
00973
00974 $db_spec = array();
00975 $db_spec = _drush_sql_get_db_spec();
00976
00977
00978 switch ($db_spec['driver']) {
00979 case 'mysql':
00980 $link = @mysql_connect(
00981 $db_spec['host'] . ':' . $db_spec['port'],
00982 $db_spec['username'],
00983 $db_spec['password'],
00984 $db_spec['database']
00985 );
00986 break;
00987 case 'mysqli':
00988
00989 $link = mysqli_connect(
00990 $db_spec['host'],
00991 $db_spec['username'],
00992 $db_spec['password'],
00993 $db_spec['database'],
00994 $db_spec['port']
00995 );
00996 break;
00997 case 'pgsql':
00998
00999
01000 $connection_string = 'host=' . $db_spec['host'] .' ';
01001 $connection_string .= 'user=' . $db_spec['user'] .' ';
01002 $connection_string .= 'password=' . $db_spec['password'] .' ';
01003 $connection_string .= 'dbname=' . $db_spec['database'];
01004 if (!empty($db_spec['port'])) {
01005 $connection_string .= ' port=' . $db_spec['port'];
01006 }
01007 $link = pg_connect($connection_string);
01008 break;
01009 }
01010
01011
01012 if (!$link) {
01013 return FALSE;
01014 }
01015 else {
01016
01017 switch ($db_spec['driver']) {
01018 case 'mysql':
01019 mysql_close($link);
01020 break;
01021 case 'mysqli':
01022 mysqli_close($link);
01023 break;
01024 case 'pgsql':
01025 pg_close($link);
01026 break;
01027 }
01028 return TRUE;
01029 }
01030 }
01031
01032
01033
01034