Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
241cc5fa
Commit
241cc5fa
authored
6 years ago
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polyfill qa_db_query_sub with DbConnection
parent
f2dbb2e9
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
qa-db.php
qa-include/qa-db.php
+4
-5
No files found.
qa-include/qa-db.php
View file @
241cc5fa
...
...
@@ -220,7 +220,7 @@ function qa_db_prefix_callback($matches)
*/
function
qa_db_apply_sub
(
$query
,
$arguments
)
{
// function left intact as some code calls this
(or qa_db_query_sub)
directly
// function left intact as some code calls this directly
$query
=
preg_replace_callback
(
'/\^([A-Za-z_0-9]+)/'
,
'qa_db_prefix_callback'
,
$query
);
...
...
@@ -262,9 +262,8 @@ function qa_db_apply_sub($query, $arguments)
*/
function
qa_db_query_sub
(
$query
)
// arguments for substitution retrieved using func_get_args()
{
$funcargs
=
func_get_args
();
return
qa_db_query_sub_params
(
$query
,
array_slice
(
$funcargs
,
1
));
$params
=
array_slice
(
func_get_args
(),
1
);
return
qa_service
(
'database'
)
->
query
(
$query
,
$params
);
}
/**
...
...
@@ -277,7 +276,7 @@ function qa_db_query_sub($query) // arguments for substitution retrieved using f
*/
function
qa_db_query_sub_params
(
$query
,
$params
)
{
return
qa_
db_query_raw
(
qa_db_apply_sub
(
$query
,
$params
)
);
return
qa_
service
(
'database'
)
->
query
(
$query
,
$params
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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