/** * Configures the global Logger instance */ protected function configureLoggers() { $loggers = array(); foreach ($this->extractConfig('logging') as $name => $config) { $logger = LoggerBase::factory($name); $logger->configure((array) $config); $logger->initialize(); $logKey = isset($config['name']) ? $config['name'] : $name; $loggers[$logKey] = $logger; } if (Strata::isBundledServer()) { $logger = LoggerBase::factory('Console'); $logger->initialize(); $loggers['StrataConsole'] = $logger; } $this->setConfig('runtime.loggers', $loggers); }
/** * Command to return the eval-able code to startup PsySH in interactive debugger * Works the same way as eval(\Psy\sh()); * psy/psysh must be loaded in your project * @link http://psysh.org/ * @link https://github.com/cakephp/cakephp/blob/master/src/basics.php * @return string */ function breakpoint() { if (!WP_DEBUG) { return; } if ((PHP_SAPI === 'cli-server' || PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && class_exists('\\Psy\\Shell')) { if (Strata::isBundledServer()) { Strata::app()->getLogger("StrataConsole")->debug("\n\nLaunching debugger...\n\n"); } list(, $caller) = debug_backtrace(false); extract(\Psy\Shell::debug(get_defined_vars(), isset($caller) ? $caller : null)); return; } trigger_error("psy/psysh must be installed and you must be in a CLI environment to use the breakpoint function", E_USER_WARNING); }