mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-06 22:45:02 +02:00
[ticket/15243] Check permissions before installing with SQLite
PHPBB3-15243
This commit is contained in:
parent
eafbaf4c30
commit
e6bdba7da1
@ -199,6 +199,7 @@ $lang = array_merge($lang, array(
|
|||||||
'INST_ERR_DB_NO_NAME' => 'No database name specified.',
|
'INST_ERR_DB_NO_NAME' => 'No database name specified.',
|
||||||
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
|
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
|
||||||
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
|
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
|
||||||
|
'INST_ERR_DB_NO_WRITABLE' => 'Both the database and the directory containing it must be writable.',
|
||||||
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
|
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
|
||||||
'INST_ERR_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.',
|
'INST_ERR_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.',
|
||||||
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
|
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
|
||||||
|
@ -336,6 +336,15 @@ class database
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if SQLite database is writable
|
||||||
|
if ($dbms_info['SCHEMA'] === 'sqlite'
|
||||||
|
&& (!$this->filesystem->is_writable($dbhost) || !$this->filesystem->is_writable(pathinfo($dbhost, PATHINFO_DIRNAME))))
|
||||||
|
{
|
||||||
|
$errors[] = array(
|
||||||
|
'title' =>'INST_ERR_DB_NO_WRITABLE',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Try to connect to db
|
// Try to connect to db
|
||||||
if (is_array($db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, false, true)))
|
if (is_array($db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, false, true)))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user