_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q245500
Manager.getSubscribers
validation
public function getSubscribers($eventName = null) { if ($eventName !== null) { if (!isset($this->subscribers[$eventName])) { return array(); } if (!isset($this->sorted[$eventName])) { $this->sortSubscribers($eventName); } ...
php
{ "resource": "" }
q245501
Manager.hasSubscribers
validation
public function hasSubscribers($eventName = null) { if ($eventName !== null) { return !empty($this->subscribers[$eventName]); } foreach ($this->subscribers as $subscribers) { if ($subscribers) { return true; } } return false...
php
{ "resource": "" }
q245502
Manager.removeSubscriberInterface
validation
public function removeSubscriberInterface(SubscriberInterface $interface) { $subscribers = $this->getInterfaceSubscribers($interface); foreach ($subscribers as $row) { $this->unsubscribe($row[0], $row[1], $row[2]); } return $subscribers; }
php
{ "resource": "" }
q245503
Manager.subscribe
validation
public function subscribe($eventName, $callable, $priority = 0) { unset($this->sorted[$eventName]); // clear the sorted cache $this->subscribers[$eventName][$priority][] = $callable; }
php
{ "resource": "" }
q245504
Manager.unsubscribe
validation
public function unsubscribe($eventName, $callable) { if (!isset($this->subscribers[$eventName])) { return; } if ($this->isClosureFactory($callable)) { // factory / lazy subscriber $callable[0] = $callable[0](); } foreach ($this->subscribers...
php
{ "resource": "" }
q245505
Manager.doPublish
validation
protected function doPublish($eventName, $subscribers, Event $event) { foreach ($subscribers as $callable) { if ($event->isPropagationStopped()) { break; } \call_user_func($callable, $event, $eventName, $this); } }
php
{ "resource": "" }
q245506
Manager.sortSubscribers
validation
private function sortSubscribers($eventName) { \krsort($this->subscribers[$eventName]); $this->sorted[$eventName] = array(); foreach ($this->subscribers[$eventName] as $priority => $subscribers) { foreach ($subscribers as $k => $subscriber) { if ($this->isClosureF...
php
{ "resource": "" }
q245507
FileStreamWrapper.register
validation
public static function register($pathsExclude = array()) { $result = \stream_wrapper_unregister(static::PROTOCOL); if ($result === false) { throw new \UnexpectedValueException('Failed to unregister'); } if ($pathsExclude) { self::$pathsExclude = $pathsExclude;...
php
{ "resource": "" }
q245508
FileStreamWrapper.dir_closedir
validation
public function dir_closedir() { if (!$this->handle) { return false; } self::restorePrev(); \closedir($this->handle); self::register(); $this->handle = null; return true; }
php
{ "resource": "" }
q245509
FileStreamWrapper.dir_opendir
validation
public function dir_opendir($path, $options = 0) { if ($this->handle) { return false; } // "use" our function params so things don't complain array($options); self::restorePrev(); $this->handle = \opendir($path); self::register(); return $t...
php
{ "resource": "" }
q245510
FileStreamWrapper.dir_readdir
validation
public function dir_readdir() { if (!$this->handle) { return false; } self::restorePrev(); $success = \readdir($this->handle); self::register(); return $success; }
php
{ "resource": "" }
q245511
FileStreamWrapper.dir_rewinddir
validation
public function dir_rewinddir() { if (!$this->handle) { return false; } self::restorePrev(); \rewinddir($this->handle); self::register(); return true; }
php
{ "resource": "" }
q245512
FileStreamWrapper.rename
validation
public function rename($pathFrom, $pathTo) { self::restorePrev(); $success = \rename($pathFrom, $pathTo); self::register(); return $success; }
php
{ "resource": "" }
q245513
FileStreamWrapper.stream_close
validation
public function stream_close() { if (!$this->handle) { return; } self::restorePrev(); \fclose($this->handle); $this->handle = null; self::register(); }
php
{ "resource": "" }
q245514
FileStreamWrapper.stream_eof
validation
public function stream_eof() { if (!$this->handle) { return false; } self::restorePrev(); $result = \feof($this->handle); self::register(); return $result; }
php
{ "resource": "" }
q245515
FileStreamWrapper.stream_flush
validation
public function stream_flush() { if (!$this->handle) { return false; } self::restorePrev(); $success = \fflush($this->handle); self::register(); return $success; }
php
{ "resource": "" }
q245516
FileStreamWrapper.stream_lock
validation
public function stream_lock($operation) { if (!$this->handle) { return false; } self::restorePrev(); $success = \flock($this->handle, $operation); self::register(); return $success; }
php
{ "resource": "" }
q245517
FileStreamWrapper.stream_metadata
validation
public function stream_metadata($path, $option, $value) { self::restorePrev(); switch ($option) { case STREAM_META_TOUCH: if (!empty($value)) { $success = \touch($path, $value[0], $value[1]); } else { $success = \tou...
php
{ "resource": "" }
q245518
FileStreamWrapper.stream_open
validation
public function stream_open($path, $mode, $options, &$openedPath) { if ($this->handle) { return false; } $useIncludePath = (bool) $options & STREAM_USE_PATH; $context = $this->context; if ($context === null) { $context = \stream_context_get_default(); ...
php
{ "resource": "" }
q245519
FileStreamWrapper.stream_read
validation
public function stream_read($count) { if (!$this->handle) { return false; } self::restorePrev(); $buffer = \fread($this->handle, $count); $bufferLen = \strlen($buffer); $backtrace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $isRequire = !\i...
php
{ "resource": "" }
q245520
FileStreamWrapper.stream_seek
validation
public function stream_seek($offset, $whence = SEEK_SET) { if (!$this->handle) { return false; } self::restorePrev(); $result = \fseek($this->handle, $offset, $whence); $success = $result !== -1; self::register(); return $success; }
php
{ "resource": "" }
q245521
FileStreamWrapper.stream_stat
validation
public function stream_stat() { if (!$this->handle) { return false; } self::restorePrev(); $array = \fstat($this->handle); self::register(); return $array; }
php
{ "resource": "" }
q245522
FileStreamWrapper.stream_tell
validation
public function stream_tell() { if (!$this->handle) { return false; } self::restorePrev(); $position = \ftell($this->handle); self::register(); return $position; }
php
{ "resource": "" }
q245523
FileStreamWrapper.stream_truncate
validation
public function stream_truncate($size) { if (!$this->handle) { return false; } self::restorePrev(); $success = \ftruncate($this->handle, $size); self::register(); return $success; }
php
{ "resource": "" }
q245524
FileStreamWrapper.unlink
validation
public function unlink($path) { self::restorePrev(); $success = \unlink($path); self::register(); return $success; }
php
{ "resource": "" }
q245525
FileStreamWrapper.url_stat
validation
public function url_stat($path, $flags) { self::restorePrev(); if (!\file_exists($path)) { $info = false; } elseif ($flags & STREAM_URL_STAT_LINK) { $info = $flags & STREAM_URL_STAT_QUIET ? @\lstat($path) : \lstat($path); } else...
php
{ "resource": "" }
q245526
ChromeLogger.onOutput
validation
public function onOutput(Event $event) { $this->channelName = $this->debug->getCfg('channel'); $this->data = $this->debug->getData(); $this->processAlerts(); $this->processSummary(); $this->processLog(); if ($this->json['rows']) { \array_unshift($this->jso...
php
{ "resource": "" }
q245527
ChromeLogger.processLogEntry
validation
public function processLogEntry($method, $args = array(), $meta = array()) { if ($method === 'alert') { list($method, $args) = $this->methodAlert($args, $meta); } elseif ($method == 'assert') { \array_unshift($args, false); } elseif (\in_array($method, array('count','...
php
{ "resource": "" }
q245528
Wamp.getSubscriptions
validation
public function getSubscriptions() { if (!$this->isConnected()) { $this->debug->alert('WAMP publisher not connected to WAMP router'); return array(); } $this->publishMeta(); $this->processExistingData(); return array( 'debug.log' => array('...
php
{ "resource": "" }
q245529
Wamp.onError
validation
public function onError(Event $event) { if ($event['inConsole'] || !$event['isFirstOccur']) { return; } $this->processLogEntry( 'errorNotConsoled', array( $event['typeStr'].': '.$event['file'].' (line '.$event['line'].'): '.$event['message'...
php
{ "resource": "" }
q245530
Wamp.processLogEntry
validation
public function processLogEntry($method, $args = array(), $meta = array()) { $meta = \array_merge(array( 'format' => 'raw', 'requestId' => $this->requestId, ), $meta); if ($meta['channel'] == $this->debug->getCfg('channel')) { unset($meta['channel']); ...
php
{ "resource": "" }
q245531
Wamp.processExistingData
validation
private function processExistingData() { $data = $this->debug->getData(); $channelName = $this->debug->getCfg('channel'); foreach ($data['alerts'] as $entry) { $this->processLogEntryWEvent($entry[0], $entry[1], $entry[2]); } foreach ($data['logSummary'] as $priori...
php
{ "resource": "" }
q245532
Wamp.publishMeta
validation
private function publishMeta() { $debugClass = \get_class($this->debug); $metaVals = array( 'debug_version' => $debugClass::VERSION, ); $keys = array( 'HTTP_HOST', 'HTTPS', 'REMOTE_ADDR', 'REQUEST_METHOD', 'REQUE...
php
{ "resource": "" }
q245533
Abstracter.getCfg
validation
public function getCfg($path = null) { if (!\strlen($path)) { return $this->cfg; } if (isset($this->cfg[$path])) { return $this->cfg[$path]; } return null; }
php
{ "resource": "" }
q245534
Abstracter.getAbstraction
validation
public function getAbstraction(&$mixed, $method = null, $hist = array()) { if (\is_array($mixed)) { return $this->abstractArray->getAbstraction($mixed, $method, $hist); } elseif (\is_object($mixed)) { return $this->abstractObject->getAbstraction($mixed, $method, $hist); ...
php
{ "resource": "" }
q245535
Abstracter.getType
validation
public static function getType($val, &$typeMore = null) { if (\is_string($val)) { $type = 'string'; if (\is_numeric($val)) { $typeMore = 'numeric'; } elseif ($val === self::UNDEFINED) { $type = 'undefined'; // not a native php type! ...
php
{ "resource": "" }
q245536
Debug.alert
validation
public function alert($message, $class = 'danger', $dismissible = false) { // "use" our function params so things don't complain array($class, $dismissible); $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['...
php
{ "resource": "" }
q245537
Debug.assert
validation
public function assert($assertion, $msg = null) { // "use" our function params so things don't complain array($msg); $args = \func_get_args(); $meta = $this->internal->getMetaVals($args); $assertion = \array_shift($args); if (!$assertion) { if (!$args) { ...
php
{ "resource": "" }
q245538
Debug.clear
validation
public function clear($flags = self::CLEAR_LOG) { // "use" our function params so things don't complain array($flags); $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']), array('flags' =...
php
{ "resource": "" }
q245539
Debug.count
validation
public function count($label = null, $flags = 0) { $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']) ); // label may be ommitted and only flags passed as a single argument // (excluding p...
php
{ "resource": "" }
q245540
Debug.countReset
validation
public function countReset($label = 'default', $flags = null) { $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']) ); // label may be ommitted and only flags passed as a single argument // ...
php
{ "resource": "" }
q245541
Debug.groupEnd
validation
public function groupEnd($value = \bdk\Debug\Abstracter::UNDEFINED) { $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']), array('value' => \bdk\Debug\Abstracter::UNDEFINED) ); \extract($...
php
{ "resource": "" }
q245542
Debug.groupSummary
validation
public function groupSummary($priority = 0) { // "use" our function params so things don't complain array($priority); $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']), array('priority'...
php
{ "resource": "" }
q245543
Debug.groupUncollapse
validation
public function groupUncollapse() { if (!$this->cfg['collect']) { return; } $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']) ); $curDepth = 0; foreach ($this->r...
php
{ "resource": "" }
q245544
Debug.profile
validation
public function profile($name = null) { if (!$this->cfg['collect']) { return; } if (!$this->cfg['enableProfiling']) { $callerInfo = $this->utilities->getCallerInfo(); $this->appendLog( __FUNCTION__, array('Profile: Unable to...
php
{ "resource": "" }
q245545
Debug.profileEnd
validation
public function profileEnd($name = null) { $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']), array('name' => null), array('name') ); if ($meta['name'] === null) { ...
php
{ "resource": "" }
q245546
Debug.table
validation
public function table() { if (!$this->cfg['collect']) { return; } $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']) ); $event = $this->methodTable->onLog(new Event($this...
php
{ "resource": "" }
q245547
Debug.time
validation
public function time($label = null) { $args = \func_get_args(); $this->internal->getMetaVals( $args, array(), array('label' => null) ); \extract($args); if (isset($label)) { $timers = &$this->data['timers']['labels']; ...
php
{ "resource": "" }
q245548
Debug.timeEnd
validation
public function timeEnd($label = null, $returnOrTemplate = false, $precision = 4) { $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']), array( 'label' => null, 'returnOrT...
php
{ "resource": "" }
q245549
Debug.trace
validation
public function trace() { if (!$this->cfg['collect']) { return; } $args = \func_get_args(); $meta = $this->internal->getMetaVals( $args, array( 'caption' => 'trace', 'channel' => $this->cfg['channel'], ...
php
{ "resource": "" }
q245550
Debug.getChannel
validation
public function getChannel($channelName, $config = array()) { if (\strpos($channelName, '.') !== false) { $this->error('getChannel(): channelName should not contain period (.)'); return $this; } if (!isset($this->channels[$channelName])) { // get inherited...
php
{ "resource": "" }
q245551
Debug.getChannels
validation
public function getChannels($allDescendants = false) { if ($allDescendants) { $channels = array(); foreach ($this->channels as $channel) { $channels = \array_merge( $channels, array($channel->getCfg('channel') => $channel), ...
php
{ "resource": "" }
q245552
Debug.output
validation
public function output($options = array()) { $cfgRestore = $this->config->setCfg($options); if (!$this->cfg['output']) { $this->config->setCfg($cfgRestore); return null; } /* I'd like to put this outputAs setting bit inside Output::onOutput ...
php
{ "resource": "" }
q245553
Debug.setErrorCaller
validation
public function setErrorCaller($caller = null) { if ($caller === null) { $caller = $this->utilities->getCallerInfo(1); $caller = array( 'file' => $caller['file'], 'line' => $caller['line'], ); } if ($caller) { //...
php
{ "resource": "" }
q245554
Debug.autoloader
validation
protected function autoloader($className) { $className = \ltrim($className, '\\'); // leading backslash _shouldn't_ have been passed if (!\strpos($className, '\\')) { // className is not namespaced return; } $psr4Map = array( 'bdk\\Debug\\' => __DI...
php
{ "resource": "" }
q245555
Debug.doGroup
validation
private function doGroup($method, $args) { $meta = $this->internal->getMetaVals( $args, array('channel' => $this->cfg['channel']) ); $this->rootInstance->groupStackRef[] = array( 'channel' => $meta['channel'], 'collect' => $this->cfg['collect']...
php
{ "resource": "" }
q245556
Debug.getGroupDepth
validation
protected function getGroupDepth() { $depth = 0; foreach ($this->data['groupStacks'] as $stack) { $depth += \count($stack); } $depth += \count($this->data['groupPriorityStack']); return $depth; }
php
{ "resource": "" }
q245557
Debug.getDefaultServices
validation
private function getDefaultServices() { return array( 'abstracter' => function (Debug $debug) { return new Debug\Abstracter($debug, $debug->config->getCfgLazy('abstracter')); }, 'config' => function (Debug $debug) { return new Debug\Config(...
php
{ "resource": "" }
q245558
Debug.getMethodDefaultArgs
validation
private static function getMethodDefaultArgs($methodName) { $defaultArgs = array(); if (isset(self::$methodDefaultArgs[$methodName])) { $defaultArgs = self::$methodDefaultArgs[$methodName]; } elseif (\method_exists(self::$instance, $methodName)) { $reflectionMethod = ...
php
{ "resource": "" }
q245559
Debug.setLogDest
validation
private function setLogDest($where = 'auto') { if ($where == 'auto') { $where = $this->data['groupPriorityStack'] ? 'summary' : 'log'; } if ($where == 'log') { $this->rootInstance->logRef = &$this->rootInstance->data['log']; ...
php
{ "resource": "" }
q245560
Logger.interpolate
validation
protected function interpolate($message, array &$context = array()) { // build a replacement array with braces around the context keys \preg_match_all('/\{([a-z0-9_.]+)\}/', $message, $matches); $placeholders = \array_unique($matches[1]); $replace = array(); foreach ($placeho...
php
{ "resource": "" }
q245561
Utilities.arrayMergeDeep
validation
public static function arrayMergeDeep($arrayDef, $array2) { if (!\is_array($arrayDef) || self::isCallable($arrayDef)) { // not array or appears to be a callable return $array2; } if (!\is_array($array2) || self::isCallable($array2)) { // not array or appea...
php
{ "resource": "" }
q245562
Utilities.arrayPathGet
validation
public static function arrayPathGet($array, $path) { if (!\is_array($path)) { $path = \array_filter(\preg_split('#[\./]#', $path), 'strlen'); } $path = \array_reverse($path); while ($path) { $key = \array_pop($path); $arrayAccess = \is_array($array...
php
{ "resource": "" }
q245563
Utilities.buildAttribString
validation
public static function buildAttribString($attribs) { if (\is_string($attribs)) { return \rtrim(' '.\trim($attribs)); } $attribPairs = array(); foreach ($attribs as $k => $v) { if (\is_int($k)) { $k = $v; $v = true; }...
php
{ "resource": "" }
q245564
Utilities.buildTag
validation
public static function buildTag($tagName, $attribs = array(), $innerhtml = '') { $tagName = \strtolower($tagName); $attribStr = self::buildAttribString($attribs); return \in_array($tagName, self::$htmlEmptyTags) ? '<'.$tagName.$attribStr.' />' : '<'.$tagName.$attribSt...
php
{ "resource": "" }
q245565
Utilities.getBytes
validation
public static function getBytes($size) { if (\is_string($size) && \preg_match('/^([\d,.]+)\s?([kmgtp])b?$/i', $size, $matches)) { $size = \str_replace(',', '', $matches[1]); switch (\strtolower($matches[2])) { case 'p': $size *= 1024; ...
php
{ "resource": "" }
q245566
Utilities.getCallerInfo
validation
public static function getCallerInfo($offset = 0) { $return = array( 'file' => null, 'line' => null, 'function' => null, 'class' => null, 'type' => null, ); $backtrace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE...
php
{ "resource": "" }
q245567
Utilities.getInterface
validation
public static function getInterface() { $return = 'http'; $isCliOrCron = \count(\array_filter(array( \defined('STDIN'), isset($_SERVER['argv']), !\array_key_exists('REQUEST_METHOD', $_SERVER), ))) > 0; if ($isCliOrCron) { // TERM is a l...
php
{ "resource": "" }
q245568
Utilities.isList
validation
public static function isList($val) { if (!\is_array($val)) { return false; } $keys = \array_keys($val); foreach ($keys as $i => $key) { if ($i != $key) { return false; } } return true; }
php
{ "resource": "" }
q245569
Utilities.parseAttribString
validation
public static function parseAttribString($str, $dataDecode = true) { $attribs = array(); $regexAttribs = '/\b([\w\-]+)\b(?: \s*=\s*(["\'])(.*?)\\2 | \s*=\s*(\S+) )?/xs'; \preg_match_all($regexAttribs, $str, $matches); $keys = \array_map('strtolower', $matches[1]); $values = \...
php
{ "resource": "" }
q245570
Utilities.requestId
validation
public static function requestId() { return \hash( 'crc32b', (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'terminal') .(isset($_SERVER['REQUEST_TIME_FLOAT']) ? $_SERVER['REQUEST_TIME_FLOAT'] : $_SERVER['REQUEST_TIME']) .(isset($_SERVER['...
php
{ "resource": "" }
q245571
Utilities.serializeLog
validation
public static function serializeLog($data) { $str = \serialize($data); if (\function_exists('gzdeflate')) { $str = \gzdeflate($str); } $str = \chunk_split(\base64_encode($str), 124); return "START DEBUG\n" .$str // chunk_split appends a "\r\n" ...
php
{ "resource": "" }
q245572
Utilities.unserializeLog
validation
public static function unserializeLog($str) { $strStart = 'START DEBUG'; $strEnd = 'END DEBUG'; if (\preg_match('/'.$strStart.'[\r\n]+(.+)[\r\n]+'.$strEnd.'/s', $str, $matches)) { $str = $matches[1]; } $str = self::isBase64Encoded($str) ? \base64_decod...
php
{ "resource": "" }
q245573
Utilities.buildAttribArrayVal
validation
private static function buildAttribArrayVal($key, $value = array()) { if ($key == 'class') { if (!\is_array($value)) { $value = \explode(' ', $value); } $value = \array_filter(\array_unique($value)); \sort($value); $value = \implode...
php
{ "resource": "" }
q245574
Utilities.buildAttribBoolVal
validation
private static function buildAttribBoolVal($key, $value = true) { if ($key == 'autocomplete') { $value = $value ? 'on' : 'off'; } elseif ($key == 'spellcheck') { $value = $value ? 'true' : 'false'; } elseif ($key == 'translate') { $value = $value ? 'yes' :...
php
{ "resource": "" }
q245575
Output.getCfg
validation
public function getCfg($path = null) { if ($path == 'outputAs') { $ret = $this->cfg['outputAs']; if (!$ret) { $ret = $this->getDefaultOutputAs(); } } elseif ($path == 'css') { $ret = $this->getCss(); } else { $ret = ...
php
{ "resource": "" }
q245576
Output.onOutput
validation
public function onOutput(Event $event) { if (!$event['isTarget']) { /* All channels share the same data. We only need to do this via the channel that called output */ return; } $this->data = $this->debug->getData(); ...
php
{ "resource": "" }
q245577
Output.closeOpenGroups
validation
private function closeOpenGroups() { $this->data['groupPriorityStack'][] = 'main'; while ($this->data['groupPriorityStack']) { $priority = \array_pop($this->data['groupPriorityStack']); foreach ($this->data['groupStacks'][$priority] as $i => $info) { if ($info...
php
{ "resource": "" }
q245578
Output.getDefaultOutputAs
validation
private function getDefaultOutputAs() { $ret = 'html'; $interface = $this->debug->utilities->getInterface(); if ($interface == 'ajax') { $ret = $this->cfg['outputAsDefaultNonHtml']; } elseif ($interface == 'http') { $contentType = $this->debug->utilities->getR...
php
{ "resource": "" }
q245579
Output.removeHideIfEmptyGroups
validation
private function removeHideIfEmptyGroups(&$log) { $groupStack = array(); $groupStackCount = 0; $removed = false; for ($i = 0, $count = \count($log); $i < $count; $i++) { $method = $log[$i][0]; if (\in_array($method, array('group', 'groupCollapsed'))) { ...
php
{ "resource": "" }
q245580
Output.setOutputAs
validation
private function setOutputAs($outputAs) { if (\is_object($this->cfg['outputAs'])) { /* unsubscribe current OutputInterface there can only be one 'outputAs' at a time if multiple output routes are desired, use debug->addPlugin() */ ...
php
{ "resource": "" }
q245581
Output.uncollapseErrors
validation
private function uncollapseErrors(&$log) { $groupStack = array(); for ($i = 0, $count = \count($log); $i < $count; $i++) { $method = $log[$i][0]; if (\in_array($method, array('group', 'groupCollapsed'))) { $groupStack[] = $i; } elseif ($method == '...
php
{ "resource": "" }
q245582
MethodProfile.end
validation
public function end() { \unregister_tick_function(array($this, 'tickFunction')); while ($this->funcStack) { $this->popStack(); } // sort by totalTime descending \uasort($this->data, function ($valA, $valB) { return ($valA['totalTime'] < $valB['totalTim...
php
{ "resource": "" }
q245583
MethodProfile.start
validation
public function start() { if ($this->isProfiling) { return false; } $backtrace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); $backtrace = $this->backtraceRemoveInternal($backtrace); foreach ($backtrace as $frame) { $class = isset($frame['class']) ? ...
php
{ "resource": "" }
q245584
MethodProfile.popStack
validation
protected function popStack() { $stackInfo = \array_pop($this->funcStack); $funcPopped = $stackInfo['function']; $timeElapsed = \microtime(true) - $stackInfo['tsStart']; $this->data[$funcPopped]['ownTime'] += $timeElapsed - $stackInfo['subTime']; $this->data[$funcPopped]['tot...
php
{ "resource": "" }
q245585
MethodProfile.pushStack
validation
protected function pushStack($funcName) { $this->funcStack[] = array( 'function' => $funcName, 'tsStart' => $this->timeLastTick, 'subTime' => 0, // how much time spent in nested functions ); if (!isset($this->data[$funcName])) { $this->...
php
{ "resource": "" }
q245586
Config.getCfgLazy
validation
public function getCfgLazy($name) { if (!isset($this->cfgLazy[$name])) { return array(); } $return = $this->cfgLazy[$name]; unset($this->cfgLazy[$name]); return $return; }
php
{ "resource": "" }
q245587
Config.doSetCfg
validation
private function doSetCfg($cfg) { $return = array(); foreach ($cfg as $k => $v) { if ($k == 'debug') { $return[$k] = \array_intersect_key($this->cfg, $v); $this->setDebugCfg($v); } elseif (isset($this->debug->{$k}) && \is_object($this->debug->{...
php
{ "resource": "" }
q245588
Config.getCfgAll
validation
private function getCfgAll() { $cfg = array(); foreach (\array_keys($this->configKeys) as $classname) { if ($classname === 'debug') { $cfg['debug'] = $this->cfg; } elseif (isset($this->debug->{$classname})) { $cfg[$classname] = $this->debug->{$...
php
{ "resource": "" }
q245589
Config.getConfigKeys
validation
private function getConfigKeys() { if (isset($this->configKeys)) { return $this->configKeys; } $this->configKeys = array( 'debug' => array( // any key not found falls under 'debug'... ), 'abstracter' => array( 'c...
php
{ "resource": "" }
q245590
Config.normalizeArray
validation
private function normalizeArray($cfg) { $return = array( 'debug' => array(), // initialize with debug... we want debug values first ); $configKeys = $this->getConfigKeys(); foreach ($cfg as $k => $v) { $translated = false; foreach ($configKeys as ...
php
{ "resource": "" }
q245591
Config.setCopyValues
validation
private function setCopyValues($values) { if (isset($values['debug']['emailLog']) && $values['debug']['emailLog'] === true) { $values['debug']['emailLog'] = 'onError'; } foreach (array('emailFrom','emailFunc','emailTo') as $key) { if (isset($values['debug'][$key]) && ...
php
{ "resource": "" }
q245592
Config.setDebugCfg
validation
private function setDebugCfg($cfg) { if (isset($cfg['key'])) { $cfg = \array_merge($cfg, $this->debugKeyValues($cfg['key'])); } if (isset($cfg['logEnvInfo']) && \is_bool($cfg['logEnvInfo'])) { $keys = \array_keys($this->cfg['logEnvInfo']); $cfg['logEnvInfo...
php
{ "resource": "" }
q245593
File.onConfig
validation
public function onConfig(Event $event) { $file = $this->debug->getCfg('file'); $this->setFile($file); }
php
{ "resource": "" }
q245594
File.onLog
validation
public function onLog(Event $event) { if (!$this->fileHandle) { return; } $method = $event['method']; if ($method == 'groupUncollapse') { return; } $args = $event['args']; $meta = $event['meta']; $isSummaryBookend = $method == '...
php
{ "resource": "" }
q245595
File.setFile
validation
protected function setFile($file) { if ($file == $this->file) { // no change return; } if ($this->fileHandle) { // close existing file \fclose($this->fileHandle); $this->fileHandle = null; } $this->file = $file; ...
php
{ "resource": "" }
q245596
Base.checkTimestamp
validation
protected function checkTimestamp($val) { $secs = 86400 * 90; // 90 days worth o seconds $tsNow = \time(); if ($val > $tsNow - $secs && $val < $tsNow + $secs) { return \date('Y-m-d H:i:s', $val); } return false; }
php
{ "resource": "" }
q245597
Base.methodTable
validation
protected function methodTable($array, $columns = array()) { if (!\is_array($array)) { return $this->dump($array); } $keys = $columns ?: $this->debug->methodTable->colKeys($array); $table = array(); $classnames = array(); if ($this->debug->abstracter->isAb...
php
{ "resource": "" }
q245598
Base.processLog
validation
protected function processLog() { $str = ''; foreach ($this->data['log'] as $entry) { $channel = isset($entry[2]['channel']) ? $entry[2]['channel'] : null; if ($this->channelTest($channel)) { $str .= $this->processLogEntryWEvent($entry[0], $entry[1], $entry[2]...
php
{ "resource": "" }
q245599
Base.processSubstitutions
validation
protected function processSubstitutions($args, &$hasSubs) { $subRegex = '/%' .'(?:' .'[coO]|' // c: css, o: obj with max info, O: obj w generic info .'[+-]?' // sign specifier .'(?:[ 0]|\'.{1})?' // padding specifier ...
php
{ "resource": "" }