/** * Returns TRUE if the first part of $haystack matches the string $needle * * @param string $haystack Full string to check * @param string $needle Reference string which must be found as the "first part" of the full string * @return boolean TRUE if $partStr was found to be equal to the first part of $str */ public static function isFirstPartOfStr($haystack, $needle) { return Tx_Rnbase_Utility_Strings::isFirstPartOfStr($haystack, $needle); }
/** * Returns the Backtrase excluding the log calls. * * @return array */ private function getBacktrace() { \tx_rnbase::load('tx_rnbase_util_Debug'); $trace = array_reverse(\tx_rnbase_util_Debug::getTracePaths()); $lastIgnoreKey = 0; $ignoreClasses = array('DMK\\Mklog\\Logger\\', 'TYPO3\\CMS\\Core\\Log\\', 'TYPO3\\CMS\\Core\\Utility\\GeneralUtility::devLog', 'Tx_Rnbase_Utility_Logger', 'tx_rnbase_util_Logger'); foreach ($trace as $key => $path) { $ignore = false; foreach ($ignoreClasses as $ignoreClass) { $ignore = \Tx_Rnbase_Utility_Strings::isFirstPartOfStr($path, $ignoreClass); if ($ignore) { break; } } // break if ther is no more ignore if ($ignore) { $lastIgnoreKey = $key; } } return array_splice($trace, $lastIgnoreKey + 1); }