[3824] trunk/htdocs/system/schema/sqlite/connection.php: Check for db file existence along with whether or not it can be written to .

0 views
Skip to first unread message

svn-N...@habariproject.org

unread,
Nov 24, 2009, 9:37:44 AM11/24/09
to habar...@googlegroups.com
Revision
3824
Author
rickc
Date
2009-11-24 14:37:44 +0000 (Tue, 24 Nov 2009)

Log Message

Check for db file existence along with whether or not it can be written to. Allows SQLite to install. Whitespace changes.

Modified Paths

Diff

Modified: trunk/htdocs/system/schema/sqlite/connection.php (3823 => 3824)


--- trunk/htdocs/system/schema/sqlite/connection.php	2009-11-24 13:04:27 UTC (rev 3823)
+++ trunk/htdocs/system/schema/sqlite/connection.php	2009-11-24 14:37:44 UTC (rev 3824)
@@ -65,8 +65,8 @@
 			}
 			$connect_string = implode( ':', array( $type, $file ) );
 		}
-		if (!is_writable($file)) {
-			die(_t('Database file must be writable.'));
+		if ( file_exists( $file ) && !is_writable( $file ) ) {
+			die( _t( 'Database file must be writable.' ) );
 		}
 		$conn = parent::connect( $connect_string, $db_user, $db_pass );
 		$this->exec( 'PRAGMA synchronous = OFF' );
Reply all
Reply to author
Forward
0 new messages