Skip to content

Conversation

@pzfl
Copy link

@pzfl pzfl commented Mar 25, 2015

The clause else if(extension_loaded('pdo_sqlite') && is_writeable($path)) is redundant, because this code path is only executed, if $path is not writeable. So the right part of that and expression is always false and thus the driver will never be set to sqlite.

Additionally #57 claims, that sqlite is a lot slower than files so there is no point in preferring this driver over files by default.

The clause `else if(extension_loaded('pdo_sqlite') && is_writeable($path))` is redundant, because this code path is only executed, if $path is not writeable. So the right part of that and expression is always false and thus the driver will never be set to sqlite.

Additionally #57 claims, that sqlite is a lot slower than files so there is no point in preferring this driver over files by default.
@khoaofgod
Copy link
Member

agree, if path is writeable then files is set already, so if files is not set, then path is not writeable the PDO sqlite will never get to TRUE.

and SQLite is slower than files, so I agree to remove it out of autoClass.

khoaofgod added a commit that referenced this pull request Mar 25, 2015
Removed redundant if clause in getAutoClass()
@khoaofgod khoaofgod merged commit 0cba995 into PHPSocialNetwork:final Mar 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants