Ticket #133: 133.diff

File 133.diff, 4.3 kB (added by skippy, 11 months ago)
  • system/classes/installhandler.php

     
    203203        if (! $pdo_extension_ok) { 
    204204            $requirements_met= false; 
    205205        } 
     206        /* Check for PDO drivers */ 
     207        $pdo_drivers= array_combine( PDO::getAvailableDrivers(), PDO::getAvailableDrivers() ); 
     208        if ( isset( $pdo_drivers['sqlite2'] ) ) { 
     209            // we don't currently support SQLite2, so exclude it 
     210            unset( $pdo_drivers['sqlite2'] ); 
     211        } 
     212        $pdo_drivers_ok= count( $pdo_drivers ); 
     213        $this->theme->assign( 'pdo_drivers_ok', $pdo_drivers_ok ); 
     214        $this->theme->assign( 'pdo_drivers', $pdo_drivers ); 
     215        if ( ! $pdo_drivers_ok ) { 
     216            $requirements_met= false; 
     217        } 
    206218        return $requirements_met; 
    207219    } 
    208220 
  • system/installer/script.js

     
    1515 
    1616function setDatabaseType() 
    1717{ 
    18     switch($('#databasetype').val()) { 
     18    switch($('#db_type').val()) { 
    1919        case 'mysql': 
    2020            $('.forsqlite').hide(); 
    2121            $('.formysql').show(); 
     
    3030 
    3131function checkDBCredentials() 
    3232{ 
    33     if ( ( $('#databasetype').val() == 'mysql' ) && ( $('#databasehost').val() != '' ) && ( $('#databaseuser').val() != '' ) && ( $('#databasename').val() != '' ) ) { 
     33    if ( ( $('#db_type').val() == 'mysql' ) && ( $('#databasehost').val() != '' ) && ( $('#databaseuser').val() != '' ) && ( $('#databasename').val() != '' ) ) { 
    3434        $.ajax({ 
    3535            type: 'POST', 
    3636            url: 'ajax/check_mysql_credentials', 
     
    6969            error: handleAjaxError, 
    7070        }); 
    7171    } 
    72     else if ( ( $('#databasetype').val() == 'sqlite' ) && ( $('#databasefile').val() != '' ) ) { 
     72    else if ( ( $('#db_type').val() == 'sqlite' ) && ( $('#databasefile').val() != '' ) ) { 
    7373        $.ajax({ 
    7474            type: 'POST', 
    7575            url: 'ajax/check_sqlite_credentials', 
     
    196196    setDatabaseType(); 
    197197    checkDBCredentials(); 
    198198    checkSiteConfigurationCredentials(); 
    199     $('#databasetype').change(setDatabaseType); 
     199    $('#db_type').change(setDatabaseType); 
    200200    $('#databasesetup input').keyup(function(){queueTimer(checkDBCredentials)}); 
    201201    $('#siteconfiguration input').keyup(function(){queueTimer(checkSiteConfigurationCredentials)}); 
    202202    $('#databaseuser').focus() 
  • system/installer/requirements.php

     
    7373        <?php if (! $pdo_extension_ok) {?> 
    7474          <h2>PDO extension needed...</h2> 
    7575          <p class="instructions"> 
    76             <em>habari</em> requires that the PDO PHP extension  be installed. 
     76            <em>habari</em> requires that the <a href="http://www.php.net/pdo">PDO PHP extension</a> be installed.  Please contact your hosting provider to enable PDO. 
    7777          </p> 
    78           <strong>@todo Installing PDO instructions</strong> 
    7978        <?php }?> 
     79    <?php if ( ! $pdo_drivers_ok ) { ?> 
     80      <h2>No PDO drivers enabled</h2> 
     81        <p class="instructions"><em>habari</em> requires that at least one <a href="http://www.php.net/pdo">PDO driver</a> be installed.  Please ask your hosting provider to enable one of the PDO drivers supported by Habari.</p> 
     82    <? } ?> 
    8083     </div> 
    8184    </div> 
    8285  </body> 
  • system/installer/db_setup.php

     
    2929            <div class="options"> 
    3030             
    3131                <div class="inputfield"> 
    32                     <label for="databasetype">Database Type <strong>*</strong></label> 
    33                     <select id="databasetype" name="db_type" onchange="setDatabaseType(this)"> 
    34                         <option value="mysql" <?php echo $db_type=='mysql' ? 'selected' : ''; ?>>MySQL</option> 
    35                         <option value="sqlite" <?php echo $db_type=='sqlite' ? 'selected' : ''; ?>>SQLite</option> 
    36                     </select> 
     32                    <label for="db_type">Database Type <strong>*</strong></label> 
     33                    <?php echo Utils::html_select( 'db_type', $pdo_drivers, $db_type ); ?> 
    3734                    <div class="help"> 
    3835                        <strong>Database Type</strong> specifies the type of database to which  
    3936                        Habari will connect.  Changing this setting may affect the other fields