Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pasteque
pasteque-server
Commits
6c97dd7c
Commit
6c97dd7c
authored
Oct 31, 2018
by
Karamel
Browse files
Remove unused SysModule DynamicDB.
parent
764f2e3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/check/file_checksums.php
View file @
6c97dd7c
...
...
@@ -94,7 +94,6 @@ $filesToCheck = [
'src/lib/System/SysModules/Database/DBModule.php'
,
'src/lib/System/SysModules/Database/SingleDB.php'
,
'src/lib/System/SysModules/Database/InifileDB.php'
,
'src/lib/System/SysModules/Database/DynamicDB.php'
,
'src/lib/System/DAO/DoctrineModel.php'
,
'src/lib/System/DAO/DAOFactory.php'
,
'src/lib/System/DAO/DBException.php'
,
...
...
src/lib/System/SysModules/Database/DynamicDB.php
deleted
100644 → 0
View file @
764f2e3f
<?php
// Pastèque Web back office, Dynamic database module
//
// Copyright (C) 2015 Scil (http://scil.coop)
//
// This file is part of Pastèque.
//
// Pastèque is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pastèque is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pastèque. If not, see <http://www.gnu.org/licenses/>.
namespace
Pasteque\Server\System\SysModules\Database
;
class
DynamicDB
extends
DBModule
{
protected
static
$expectedProperties
=
array
(
"db_dsn"
,
"db_username"
,
"db_password"
);
// Remember, this cache dies at the end of each HTTP request, no panic
private
$data
=
NULL
;
private
function
getLocalAuthDatabase
()
{
return
new
\
PDO
(
$this
->
getProperty
(
'db_dsn'
),
$this
->
getProperty
(
'db_username'
),
$this
->
getProperty
(
'db_password'
);
}
function
getDatabase
(
$uid
)
{
if
(
$this
->
data
==
NULL
)
{
$dbh
=
\
Pasteque\get_local_auth_database
();
$stmt
=
$dbh
->
prepare
(
'SELECT * FROM pasteque_databases WHERE user_id = :user_id'
);
$stmt
->
bindParam
(
':user_id'
,
$uid
);
$stmt
->
execute
();
$result
=
$stmt
->
fetchAll
();
if
(
count
(
$result
)
!=
1
)
{
die
(
"No database found for "
.
$uid
);
}
$data
=
$result
[
0
];
}
return
$data
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment