Changeset 2823

Show
Ignore:
Timestamp:
11/19/08 20:09:31 (7 weeks ago)
Author:
rickc
Message:

Create an SQLite db in either /user or /user/sites/url if only a file name is given in the config file, depending on whether it's a multisite installation or not. Change should be transparent to existing installations. If the config file contains a path instead of a bare file name, the path will be honored. Fixes ticket #273.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/schema/sqlite/connection.php

    r2809 r2823  
    5757    { 
    5858        list( $type, $file )= explode( ':', $connect_string, 2 ); 
     59        if( $file == basename( $file ) ) { 
     60            if( file_exists( HABARI_PATH . '/' . $file ) ) { 
     61                $file = HABARI_PATH . '/' . $file; 
     62            } 
     63            else { 
     64                $file = HABARI_PATH . '/' . Site::get_path( 'user', TRUE ) . $file; 
     65            } 
     66            $connect_string = implode( ':', array( $type, $file ) ); 
     67        } 
    5968        return parent::connect( $connect_string, $db_user, $db_pass ); 
    6069    }