Changeset 6262 for temp/trunk


Ignore:
Timestamp:
2006/10/13 13:14:41 (20 years ago)
Author:
naka
Message:

* empty log message *

Location:
temp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/class/SC_DbConn.php

    r6260 r6262  
    2020    var $dsn; 
    2121    var $err_disp = true; 
    22  
    2322     
    2423    // ¥³¥ó¥¹¥È¥é¥¯¥¿ 
  • temp/trunk/data/lib/slib.php

    r6252 r6262  
    2020// ¥¢¥Ã¥×¥Ç¡¼¥È¤ÇÀ¸À®¤µ¤ì¤¿PHP¤òÆÉ¤ß½Ð¤¹ 
    2121sfLoadUpdateModule(); 
     22 
     23/* ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ð¡¼¥¸¥ç¥ó½êÆÀ */ 
     24function sfGetDBVersion($dsn = DEFAULT_DSN) { 
     25    $objQuery = new SC_Query($dsn); 
     26    list($db_type) = split(":", $dsn); 
     27    if($db_type == 'mysql') { 
     28        $arrRet = $objQuery->getAll("SHOW VARIABLES"); 
     29        foreach($arrRet as $array) { 
     30            if($array[0] == 'version') { 
     31                $version = "MySQL " . $array[1]; 
     32                break; 
     33            } 
     34        } 
     35    } 
     36    if($arrRet['db_type'] == 'pgsql') { 
     37        $arrRet = $objQuery->getAll("select version()"); 
     38        $arrLine = split(" " , $arrRet[0][0]); 
     39        $version = $arrLine[0] . " " . $arrLine[1]; 
     40    } 
     41    return $version; 
     42} 
    2243 
    2344/* ¥Æ¡¼¥Ö¥ë¤Î¸ºß¥Á¥§¥Ã¥¯ */ 
  • temp/trunk/html/install/index.php

    r6261 r6262  
    533533        $options['debug'] = PEAR_DB_DEBUG; 
    534534        $objDB = DB::connect($dsn, $options); 
    535         // Àܳ¥¨¥é¡¼ 
    536         if(PEAR::isError($objDB)) { 
     535        // ÀܳÀ®¸ù 
     536        if(!PEAR::isError($objDB)) { 
     537            // ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤Î¼èÆÀ 
     538            $objPage->tpl_db_version = sfGetDBVersion($dsn);             
     539        } else { 
    537540            $objErr->arrErr['all'] = ">> " . $objDB->message . "<br>"; 
    538541            // ¥¨¥é¡¼Ê¸¤ò¼èÆÀ¤¹¤ë 
     
    540543            $objErr->arrErr['all'].= $arrKey[0] . "<br>"; 
    541544            gfPrintLog($objDB->userinfo, "./temp/install.log"); 
    542         } else { 
    543             if($arrRet['db_type'] == 'mysql') { 
    544                 $arrRet = $objDB->getAll("SHOW VARIABLES"); 
    545                 foreach($arrRet as $array) { 
    546                     if($array[0] == 'version') { 
    547                         $objPage->tpl_db_version = "MySQL " . $array[1]; 
    548                     } 
    549                 } 
    550             } 
    551             if($arrRet['db_type'] == 'pgsql') { 
    552                 $arrRet = $objDB->getAll("select version()"); 
    553                 $arrLine = split(" " , $arrRet[0][0]); 
    554                 $objPage->tpl_db_version = $arrLine[0] . " " . $arrLine[1]; 
    555             } 
    556545        } 
    557546    } 
Note: See TracChangeset for help on using the changeset viewer.