@@ -12,14 +12,20 @@ class SqlitePresenter implements PresenterInterface
1212 */
1313 protected PDO $ db ;
1414
15+ /**
16+ * Runway Config
17+ */
18+ protected array $ config ;
19+
1520 /**
1621 * Constructor
1722 *
18- * @param string $dsn PDO connection dsn
23+ * @param array $config Runway Config
1924 */
20- public function __construct (string $ dsn )
25+ public function __construct (array $ config )
2126 {
22- $ this ->db = new PDO ($ dsn , null , null , [
27+ $ this ->config = $ config ;
28+ $ this ->db = new PDO ($ config ['apm ' ]['dest_db_dsn ' ], null , null , [
2329 PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION ,
2430 PDO ::ATTR_DEFAULT_FETCH_MODE => PDO ::FETCH_ASSOC ,
2531 PDO ::ATTR_EMULATE_PREPARES => false
@@ -483,14 +489,16 @@ public function getRequestsData(string $threshold, int $page, int $perPage, stri
483489 $ stmt = $ this ->db ->prepare ($ requestQuery );
484490 $ stmt ->execute ($ paginatedRequestIds );
485491 $ requests = $ stmt ->fetchAll (PDO ::FETCH_ASSOC );
492+
493+ $ shouldMaskIp = $ this ->shouldMaskIpAddresses ();
486494
487495 // Fetch details for each request
488496 foreach ($ requests as &$ request ) {
489497 $ details = $ this ->getRequestDetails ($ request ['request_id ' ]);
490498 $ request = array_merge ($ request , $ details );
491499
492500 // Mask IP address if the option is enabled
493- if ($ this -> shouldMaskIpAddresses () ) {
501+ if ($ shouldMaskIp === true ) {
494502 $ request ['ip ' ] = $ this ->maskIpAddress ($ request ['ip ' ]);
495503 }
496504 }
0 commit comments