Skip to content

Commit

Permalink
Merge pull request #34 from globalis-ms/develop
Browse files Browse the repository at this point in the history
version 1.0.1
  • Loading branch information
Pierre Dargham authored Jan 21, 2020
2 parents 0ce0fa0 + dd8802b commit 668fd66
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
# PHP PSR-12 Coding Standards
# https://www.php-fig.org/psr/psr-12/

root = true

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ sudo: false
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"issues": "https://github.com/globalis-ms/wp-cubi-helpers/issues"
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5.0"
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/functions-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ function mysql_disable_nocache_mod()
*/
function query_set_nocache(string $query): string
{
return preg_replace('/SELECT(\s)/i', 'SELECT SQL_NO_CACHE$1', $query, 1);
$select_query = trim($query);

if (0 === stripos($select_query, 'SELECT ') && 0 !== stripos($select_query, 'SELECT SQL_NO_CACHE')) {
return 'SELECT SQL_NO_CACHE' . substr($select_query, 6);
}

return $query;
}

/**
Expand Down

0 comments on commit 668fd66

Please sign in to comment.