本文整理汇总了PHP中Debugbar::addCollector方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugbar::addCollector方法的具体用法?PHP Debugbar::addCollector怎么用?PHP Debugbar::addCollector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugbar
的用法示例。
在下文中一共展示了Debugbar::addCollector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: evaluatePath
/**
* @param $path
* @param array $data
* @return string
*/
protected function evaluatePath($path, array $data = [])
{
$preferences = $this->XSLTSimple->addChild('Preferences');
$url = $preferences->addChild('url');
$url->addAttribute('isHttps', Request::secure());
$url->addAttribute('currentUrl', Request::url());
$url->addAttribute('baseUrl', URL::to(''));
$url->addAttribute('previousUrl', URL::previous());
$server = $preferences->addChild('server');
$server->addAttribute('curretnYear', date('Y'));
$server->addAttribute('curretnMonth', date('m'));
$server->addAttribute('curretnDay', date('d'));
$server->addAttribute('currentDateTime', date('Y-m-d H:i:s'));
$language = $preferences->addChild('language');
$language->addAttribute('current', App::getLocale());
$default_language = \Config::get('app.default_language');
if (isset($default_language)) {
$language->addAttribute('default', $default_language);
}
$languages = \Config::get('app.available_languages');
if (is_array($languages)) {
foreach ($languages as $lang) {
$language->addChild('item', $lang);
}
}
// from form generator
if (isset($data['form'])) {
$this->XSLTSimple->addChild('Form', form($data['form']));
}
// adding form errors to xml
if (isset($data['errors'])) {
$this->XSLTSimple->addData($data['errors']->all(), 'FormErrors', false);
}
// "barryvdh/laravel-debugbar":
// adding XML tab
if (true === class_exists('Debugbar')) {
$dom = dom_import_simplexml($this->XSLTSimple)->ownerDocument;
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$prettyXml = $dom->saveXML();
// add new tab and append xml to it
if (false === \Debugbar::hasCollector('XML')) {
\Debugbar::addCollector(new \DebugBar\DataCollector\MessagesCollector('XML'));
}
\Debugbar::getCollector('XML')->addMessage($prettyXml, 'info', false);
}
$xsl_processor = new \XsltProcessor();
$xsl_processor->registerPHPFunctions();
$xsl_processor->importStylesheet(simplexml_load_file($path));
return $xsl_processor->transformToXML($this->XSLTSimple);
}
示例2: app_path
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/*
* Setup Propel
*/
if (defined('LARAVEL_ENV')) {
require app_path() . '/config/propel/config.php';
if (LARAVEL_ENV == 'local') {
$con = Propel\Runtime\Propel::getWriteConnection(\Zidisha\User\Map\UserTableMap::DATABASE_NAME);
Debugbar::addCollector(new DebugBar\DataCollector\PDO\PDOCollector($con->getConnection()));
}
}
/*
* Extending auth class with propel
*/
Auth::extend('propel', function ($app) {
return new \Zidisha\Auth\PropelUserProvider();
});
/**
* Custom validator class
*/
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new Zidisha\Form\ZidishaValidator($translator, $data, $rules, $messages);
});