Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Last active December 18, 2015 15:58
Show Gist options
  • Save Mikulas/5807905 to your computer and use it in GitHub Desktop.
Save Mikulas/5807905 to your computer and use it in GitHub Desktop.
DibiEvent.php patch for Diagnostics Panel - don't show source file from libs
diff --git a/DibiEvent.php b/DibiEvent.php
index 9c5e609..89fe867 100644
--- a/DibiEvent.php
+++ b/DibiEvent.php
@@ -71,9 +71,9 @@ class DibiEvent
}
$rc = new ReflectionClass('dibi');
- $dibiDir = dirname($rc->getFileName()) . DIRECTORY_SEPARATOR;
+ $libsDir = realpath(__DIR__ . '/../../../../') . DIRECTORY_SEPARATOR;
foreach (debug_backtrace(FALSE) as $row) {
- if (isset($row['file']) && is_file($row['file']) && strpos($row['file'], $dibiDir) !== 0) {
+ if (isset($row['file']) && is_file($row['file']) && strpos($row['file'], $libsDir) !== 0) {
$this->source = array($row['file'], (int) $row['line']);
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment