From 268a66418bffe032788b1fe608d081644e952675 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 23 Jun 2022 14:24:23 +1200 Subject: [PATCH] ENH Move backtrace ignored functions into yml config. Each module that adds its own methods will do it via yml. This keeps framework consistent with the others. --- _config/backtrace.yml | 33 +++++++++++++++++++++++++++++++++ src/Dev/Backtrace.php | 31 +------------------------------ 2 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 _config/backtrace.yml diff --git a/_config/backtrace.yml b/_config/backtrace.yml new file mode 100644 index 000000000..13c83889e --- /dev/null +++ b/_config/backtrace.yml @@ -0,0 +1,33 @@ +--- +Name: framework-backtrace +--- +SilverStripe\Dev\Backtrace: + ignore_function_args: + - 'mysql_connect' + - 'mssql_connect' + - 'pg_connect' + - ['PDO', '__construct'] + - ['mysqli', 'mysqli'] + - ['mysqli', 'select_db'] + - ['mysqli', 'real_connect'] + - ['SilverStripe\\ORM\\DB', 'connect'] + - ['SilverStripe\\Security\\Security', 'check_default_admin'] + - ['SilverStripe\\Security\\Security', 'encrypt_password'] + - ['SilverStripe\\Security\\Security', 'setDefaultAdmin'] + - ['SilverStripe\\ORM\\DB', 'createDatabase'] + - ['SilverStripe\\Security\\Member', 'checkPassword'] + - ['SilverStripe\\Security\\Member', 'changePassword'] + - ['SilverStripe\\Security\\MemberAuthenticator\\MemberAuthenticator', 'checkPassword'] + - ['SilverStripe\\Security\\MemberPassword', 'checkPassword'] + - ['SilverStripe\\Security\\PasswordValidator', 'validate'] + - ['SilverStripe\\Security\\PasswordEncryptor_PHPHash', 'encrypt'] + - ['SilverStripe\\Security\\PasswordEncryptor_PHPHash', 'salt'] + - ['SilverStripe\\Security\\PasswordEncryptor_LegacyPHPHash', 'encrypt'] + - ['SilverStripe\\Security\\PasswordEncryptor_LegacyPHPHash', 'salt'] + - ['SilverStripe\\Security\\PasswordEncryptor_MySQLPassword', 'encrypt'] + - ['SilverStripe\\Security\\PasswordEncryptor_MySQLPassword', 'salt'] + - ['SilverStripe\\Security\\PasswordEncryptor_MySQLOldPassword', 'encrypt'] + - ['SilverStripe\\Security\\PasswordEncryptor_MySQLOldPassword', 'salt'] + - ['SilverStripe\\Security\\PasswordEncryptor_Blowfish', 'encrypt'] + - ['SilverStripe\\Security\\PasswordEncryptor_Blowfish', 'salt'] + - ['*', 'updateValidatePassword'], diff --git a/src/Dev/Backtrace.php b/src/Dev/Backtrace.php index 2bfbe73e6..efd962301 100644 --- a/src/Dev/Backtrace.php +++ b/src/Dev/Backtrace.php @@ -20,36 +20,7 @@ class Backtrace * so all arguments of the provided functions will be filtered out. * @var array */ - private static $ignore_function_args = [ - 'mysql_connect', - 'mssql_connect', - 'pg_connect', - ['PDO', '__construct'], - ['mysqli', 'mysqli'], - ['mysqli', 'select_db'], - ['mysqli', 'real_connect'], - ['SilverStripe\\ORM\\DB', 'connect'], - ['SilverStripe\\Security\\Security', 'check_default_admin'], - ['SilverStripe\\Security\\Security', 'encrypt_password'], - ['SilverStripe\\Security\\Security', 'setDefaultAdmin'], - ['SilverStripe\\ORM\\DB', 'createDatabase'], - ['SilverStripe\\Security\\Member', 'checkPassword'], - ['SilverStripe\\Security\\Member', 'changePassword'], - ['SilverStripe\\Security\\MemberAuthenticator\\MemberAuthenticator', 'checkPassword'], - ['SilverStripe\\Security\\MemberPassword', 'checkPassword'], - ['SilverStripe\\Security\\PasswordValidator', 'validate'], - ['SilverStripe\\Security\\PasswordEncryptor_PHPHash', 'encrypt'], - ['SilverStripe\\Security\\PasswordEncryptor_PHPHash', 'salt'], - ['SilverStripe\\Security\\PasswordEncryptor_LegacyPHPHash', 'encrypt'], - ['SilverStripe\\Security\\PasswordEncryptor_LegacyPHPHash', 'salt'], - ['SilverStripe\\Security\\PasswordEncryptor_MySQLPassword', 'encrypt'], - ['SilverStripe\\Security\\PasswordEncryptor_MySQLPassword', 'salt'], - ['SilverStripe\\Security\\PasswordEncryptor_MySQLOldPassword', 'encrypt'], - ['SilverStripe\\Security\\PasswordEncryptor_MySQLOldPassword', 'salt'], - ['SilverStripe\\Security\\PasswordEncryptor_Blowfish', 'encrypt'], - ['SilverStripe\\Security\\PasswordEncryptor_Blowfish', 'salt'], - ['*', 'updateValidatePassword'], - ]; + private static $ignore_function_args = []; /** * Return debug_backtrace() results with functions filtered