1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

add option for force refresh

This commit is contained in:
Vinzenz Hersche 2018-05-15 04:19:16 +02:00
parent 3be3bb65a3
commit 40a60c9847

View file

@ -78,14 +78,14 @@ class sqlDAL {
* @param array $values A array, containing the values for the prepared statement.
* @return Object Depend if mysqlnd is active or not, a object, but always false on fail
*/
static function readSql($preparedStatement, $formats = "", $values = array()) {
static function readSql($preparedStatement, $formats = "", $values = array(),$refreshCache=false) {
global $global, $disableMysqlNdMethods, $readSqlCached;
$crc = $preparedStatement.implode($values);
if(empty($readSqlCached)){
$readSqlCached = array();
}
if ((function_exists('mysqli_fetch_all')) && ($disableMysqlNdMethods == false)) {
if(empty($readSqlCached[$crc])){
if((empty($readSqlCached[$crc]))||($refreshCache)){
$readSqlCached[$crc]="false";
if (!($stmt = $global['mysqli']->prepare($preparedStatement))){
log_error("[sqlDAL::readSql] Prepare failed: (" . $global['mysqli']->errno . ") " . $global['mysqli']->error."<br>\n{$preparedStatement}");