当前位置: 首页>>代码示例>>PHP>>正文


PHP Debugger::barDump方法代码示例

本文整理汇总了PHP中Tracy\Debugger::barDump方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::barDump方法的具体用法?PHP Debugger::barDump怎么用?PHP Debugger::barDump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracy\Debugger的用法示例。


在下文中一共展示了Debugger::barDump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadPhotosFormSucceded

 /**
  * Processing of Upload Photos Form
  *
  * @Privilege('generate')
  *
  * @param Form $form
  */
 public function uploadPhotosFormSucceded(Form $form)
 {
     $values = $form->getValues();
     $event = $this->loadItem($values['id']);
     $calendar = $event->ref('calendar');
     $year = $calendar->yearpart === 'podzim' ? $calendar->year : $calendar->year - 1;
     $date = substr($event->datestart, 0, 4) . substr($event->datestart, 5, 2) . substr($event->datestart, 8, 2);
     // check if the year dir exist. if not, create one
     $params = $this->context->parameters;
     $dirYear = $params['wwwDir'] . $params['chroniclePhotosStorage'] . '/' . $year . ($year + 1) . '/';
     // check if the event dir exists. if not, create one
     $dir = $dirYear . $date . '/';
     if (!file_exists($dir)) {
         mkdir($dir, 0777, TRUE);
     }
     \Tracy\Debugger::barDump($dir);
     // start uploading files
     $counter = 0;
     foreach ($values['upload'] as $file) {
         if ($file->isOK()) {
             if ($file->isImage()) {
                 do {
                     $counter += 1;
                     //increment counter until you hit empty space for file
                     $filePath = $dir . \Nette\Utils\Strings::padLeft($counter, 4, '0') . '.jpg';
                 } while (file_exists($filePath));
                 $image = $file->toImage();
                 $image->save($filePath, 85, \Nette\Image::JPEG);
                 $this->database->table('chronicle_photos')->insert(['event_id' => $values['id'], 'order' => $counter]);
                 $this->flashMessage("Soubor " . $file->getName() . " byl úspěšně nahrán!");
             } else {
                 $form->addError('Soubor' . $file->getName() . ' nebyl rozpoznán jako fotka.');
             }
         } else {
             $form->addError('Nepodařilo se nahrát soubor:' . $file->getName());
         }
     }
     //change event visibility
     if (!array_key_exists('showchronicle', $values)) {
         //user did not have the sufficient permission
         $showchronicle = FALSE;
     } else {
         $showchronicle = $values['showchronicle'] ? TRUE : FALSE;
     }
     $this->events->showChronicle($values['id'], $showchronicle);
     if (!$form->hasErrors()) {
         $this->redirect('default');
     }
 }
开发者ID:patrickkusebauch,项目名称:27skauti,代码行数:56,代码来源:ChroniclePresenter.php

示例2: bdd

/**
 * Bar dump; die;
 */
function bdd()
{
    foreach (func_get_args() as $var) {
        Debugger::barDump($var);
    }
    die;
}
开发者ID:milo,项目名称:componette.com,代码行数:10,代码来源:shortcuts.php

示例3: barDump

/**
 * Tracy\Debugger::barDump() shortcut.
 */
function barDump($var)
{
    foreach (func_get_args() as $arg) {
        Debugger::barDump($arg);
    }
    return $var;
}
开发者ID:inteve,项目名称:web-project,代码行数:10,代码来源:shortcuts.php

示例4: doDump

 protected function doDump($data)
 {
     if (!class_exists('\\Tracy\\Debugger')) {
         return;
     }
     Debugger::barDump($data, null, $this->options);
 }
开发者ID:YepFoundation,项目名称:tracy-twig-extensions,代码行数:7,代码来源:BarDumpExtension.php

示例5: renderDefault

 public function renderDefault()
 {
     $this->template->anyVariable = 'any value';
     //		$dao = $this->articles;
     $this->template->articles = $this->articles->getArticles()->findAll();
     $posts = $this->EntityManager->getRepository(Posts::getClassName());
     $this->template->posts = $posts->findAll();
     $this->template->myparametr = $this->context->parameters['first_parametr'];
     //		$this->template->test = $this->doSomeRefactoring('Hello world from blog');
     //		$post = new Posts();
     //		$post->title = 'New title';
     //		$post->text = 'New text New textNew text';
     //		$post->created_at = new \Nette\Utils\DateTime;
     //
     //
     //		$this->EntityManager->persist($post);
     //		$this->EntityManager->flush();
     //		$dao = $this->EntityManager->getRepository(Posts::getClassName());
     //		$dao->setTitle('test');
     //		$dao->__call('set', ['title' => 'my title']);
     //		dump($dao->__isset('title'));
     //		$dao->__set('title', 'test');
     try {
         $this->checkNum(2);
         \Tracy\Debugger::barDump('If you see this, the number is 1 or below');
     } catch (Nette\Application\BadRequestException $e) {
         Debugger::log('Message: ' . $e->getMessage());
         var_dump($e->getMessage());
     }
     //		finally {
     //			\Tracy\Debugger::barDump('Got here Finally');
     //		}
 }
开发者ID:regiss,项目名称:doctrine-sand,代码行数:33,代码来源:Blog.php

示例6: barDump

 /**
  * Tracy\Debugger::barDump() shortcut.
  * @tracySkipLocation
  */
 function barDump($var, $title = '')
 {
     $backtrace = debug_backtrace();
     $source = isset($backtrace[1]['class']) ? $backtrace[1]['class'] : basename($backtrace[0]['file']);
     $line = $backtrace[0]['line'];
     $title .= empty($title) ? '' : ' – ';
     return Debugger::barDump($var, $title . $source . ' (' . $line . ')');
 }
开发者ID:pw-press,项目名称:web-project,代码行数:12,代码来源:bootstrap.php

示例7: invoke

 /**
  * Invoke all cron methods
  */
 private function invoke(array $methods)
 {
     foreach ($methods as $method) {
         Debugger::barDump($method->annotations, $method->name);
         $instance = $this->context->createInstance($method->class);
         callback($instance, $method->name)->invokeArgs([$this->context, $this->getParameters()]);
     }
 }
开发者ID:f3l1x,项目名称:nette-plugins,代码行数:11,代码来源:CronPresenter.php

示例8: dd

function dd($var, $title = '')
{
    $backtrace = debug_backtrace(null);
    // Ready for PHP 5.4
    $source = isset($backtrace[1]['class']) ? $backtrace[1]['class'] : basename($backtrace[0]['file']);
    $line = $backtrace[0]['line'];
    if ($title !== '') {
        $title .= ' – ';
    }
    return \Tracy\Debugger::barDump($var, $title . $source . ' (' . $line . ')');
}
开发者ID:spagr,项目名称:nette-testy,代码行数:11,代码来源:bootstrap.php

示例9: checkAndCreateRoot

 public function checkAndCreateRoot()
 {
     $uid = $this->user->id;
     $rootFolderName = '/' . $uid;
     $rootFolder = $this->folder->findOneBy(array('user_id' => $uid, 'name' => $rootFolderName));
     if (!$rootFolder) {
         $defaultQuota = $this->getDefaultQuota($this->user);
         \Tracy\Debugger::barDump('Creating default folder ' . $rootFolderName . ' with quota ' . $defaultQuota);
         $this->createFolder($rootFolderName, $defaultQuota, 'Základní uživatelská složka.');
     }
 }
开发者ID:HKFree,项目名称:NAS,代码行数:11,代码来源:StorageManager.php

示例10: getModules

 /**
  * @return array JSON modules and data definition
  */
 public function getModules()
 {
     $this->resolvedConfig = [];
     $this->resolvedModules = [];
     foreach ($this->useModules as $moduleName) {
         $this->resolveModuleConfig($moduleName);
     }
     // so that dependendencies are required via js container with settings instead of pure requirejs definition
     // array is reversed to put dependents after their dependencies
     $this->resolvedConfig = array_reverse($this->resolvedConfig);
     if (class_exists('Tracy\\Debugger')) {
         Debugger::barDump($this->resolvedConfig, __METHOD__);
     }
     return $this->resolvedConfig;
 }
开发者ID:instante,项目名称:require-js,代码行数:18,代码来源:JsModuleContainer.php

示例11: httpGet

 private function httpGet($action, $parameters = array())
 {
     \Tracy\Debugger::barDump('SC - ' . $action . ' ' . implode(', ', $parameters));
     $url = $this->storageServerURL . '/' . $action;
     if (!empty($parameters)) {
         $url = $url . '?' . http_build_query($parameters);
     }
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_HEADER, false);
     $data = curl_exec($ch);
     $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     return $data;
 }
开发者ID:HKFree,项目名称:NAS,代码行数:16,代码来源:StorageConnector.php

示例12: signInFormSuccess

 public function signInFormSuccess(\Nette\Application\UI\Form $form)
 {
     $values = $form->getValues();
     \Tracy\Debugger::barDump($form);
     if ($values->remember) {
         $this->getUser()->setExpiration('+ 14 days', FALSE);
     } else {
         $this->getUser()->setExpiration('+ 20 minutes', TRUE);
     }
     try {
         $this->getUser()->login($values->username, $values->password);
     } catch (\Nette\Security\AuthenticationException $e) {
         $form->addError($e->getMessage());
         return;
     }
     $this->redirect('Homepage:');
 }
开发者ID:v108b,项目名称:nette-sandbox,代码行数:17,代码来源:SignPresenter.php

示例13: process

 public function process(\Nette\Forms\Form $form)
 {
     if ($form->isSuccess()) {
         /** @var Thumbnailer */
         $thumbator = $this->context->thumbator;
         $thumb1 = new Thumb(100, 200, './');
         $thumb2 = new Thumb(400, 500, './', Thumb::FILENAME_FORMAT_ORIGINAL);
         $thumb3 = new Thumb(200, 100, './', Thumb::FILENAME_FORMAT_DIMENSION);
         $thumb4 = new Thumb(40, 50, './', Thumb::FILENAME_FORMAT_ORIGINAL | Thumb::FILENAME_FORMAT_DIMENSION);
         $thumb5 = new Thumb(300, 800, './', Thumb::FILENAME_FORMAT_VALUE);
         $thumb5->setFilename('felix the caT!!');
         $thumbator->addThumb($thumb1);
         $thumbator->addThumb($thumb2);
         $thumbator->addThumb($thumb3);
         $thumbator->addThumb($thumb4);
         $thumbator->addThumb($thumb5);
         // Success handler
         $thumbator->onSuccess[] = function ($t) {
             Debugger::barDump('Sucess handler');
         };
         $thumbator->process($form->values->picture);
         Debugger::barDump($form->values);
     }
 }
开发者ID:f3l1x,项目名称:nette-plugins,代码行数:24,代码来源:HomepagePresenter.php

示例14: render

 public function render(Form $form, $mode = NULL, $control = NULL)
 {
     \Tracy\Debugger::barDump(func_get_args());
     if ($this->form !== $form) {
         $this->form = $form;
     }
     if ($mode === 'pair') {
         if (is_string($control)) {
             $control = $form[$control];
         }
         return $this->renderPair($control);
     } elseif ($mode === 'container') {
         return $this->renderControls($control);
     } elseif ($mode === 'errors') {
         return $this->renderAllErrors($form);
     } else {
         $errors = '';
         if ($mode === NULL) {
             $errors = $this->renderAllErrors($form);
             $form->cleanErrors();
         }
         return $errors . parent::render($form, $mode);
     }
 }
开发者ID:jirinapravnik,项目名称:common,代码行数:24,代码来源:Bs3FormRenderer.php

示例15: url

<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">

<style> html { background: url(assets/arrow.png) no-repeat bottom right; height: 100%; } </style>

<h1>Tracy Debug Bar demo</h1>

<p>You can dump variables to bar in rightmost bottom egde.</p>

<?php 
require __DIR__ . '/../src/tracy.php';
use Tracy\Debugger;
Debugger::enable(Debugger::DEVELOPMENT, __DIR__ . '/log');
$arr = array(10, 20.2, TRUE, NULL, 'hello', (object) NULL, array());
Debugger::barDump(get_defined_vars());
Debugger::barDump($arr, 'The Array');
Debugger::barDump('<a href="#">test</a>', 'String');
开发者ID:jave007,项目名称:test,代码行数:16,代码来源:barDump.php


注:本文中的Tracy\Debugger::barDump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。