fixes sqlite3 error

This commit is contained in:
Abdulrahman
2019-07-09 23:30:27 +03:00
parent 9dc9584fff
commit 164419023f
3 changed files with 11 additions and 1 deletions

View File

@@ -46,7 +46,14 @@ class KleejaDatabase
{
try
{
$this->connect_id = new SQLite3(PATH . $db_name, SQLITE3_OPEN_READWRITE);
if (class_exists('SQLite3'))
{
$this->connect_id = new SQLite3(PATH . $db_name, SQLITE3_OPEN_READWRITE);
}
else
{
$this->error_msg('SQLite3 extension is not installed in your server!');
}
}
catch (Exception $e)
{

View File

@@ -133,6 +133,7 @@ case 'c':
$no_config = ! file_exists(PATH . 'config.php') || ig('force') ? false : true;
$writeable_path = is_writable(PATH) ? true : false;
$sqlite3_exists = class_exists('SQLite3');
echo gettpl('configs.html');

View File

@@ -10,7 +10,9 @@
<td class="TdInput">
<select name="db_type" id="db_type" style="text-align:left;direction:ltr">
<option value="mysql" selected>{{echo $lang['DB_TYPE_MYSQL']}}</option>
{{if ($sqlite3_exists):}}
<option value="sqlite">{{echo $lang['DB_TYPE_SQLITE']}}</option>
{{endif;}}
</select>
</td>
</tr>