Skip to content

Commit 099c66f

Browse files
authored
Replace trigger_error, which is deprecated in PHP 8.4. (#4755)
1 parent f04ef67 commit 099c66f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Varien/Db/Adapter/Interface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ interface Varien_Db_Adapter_Interface
5050
* Error message for DDL query in transactions
5151
*/
5252
public const ERROR_DDL_MESSAGE = 'DDL statements are not allowed in transactions';
53+
public const ERROR_TRANSACTION_NOT_COMMITTED = 'Some transactions have not been committed or rolled back';
5354

5455
/**
5556
* Begin new DB transaction for connection

lib/Varien/Db/Adapter/Pdo/Mysql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ protected function _checkDdlTransaction($sql)
464464
if (in_array($startSql, $this->_ddlRoutines)
465465
&& (preg_match($this->_tempRoutines, $sql) !== 1)
466466
) {
467-
trigger_error(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE, E_USER_ERROR);
467+
throw new Varien_Db_Exception(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE);
468468
}
469469
}
470470
}
@@ -4094,7 +4094,7 @@ public function createTableFromSelect($tableName, Zend_Db_Select $select, $tempo
40944094
public function __destruct()
40954095
{
40964096
if ($this->_transactionLevel > 0) {
4097-
trigger_error('Some transactions have not been committed or rolled back', E_USER_ERROR);
4097+
throw new RuntimeException(Varien_Db_Adapter_Interface::ERROR_TRANSACTION_NOT_COMMITTED);
40984098
}
40994099
}
41004100
}

0 commit comments

Comments
 (0)