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


PHP Debugbar::error方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $rules = array('private' => 'numeric|required', 'title' => 'max:46|required', 'paste' => 'required', 'expire' => 'required|numeric', 'private' => 'required|numeric', 'tags' => 'max:6|alpha');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return View::make('paste.form')->withErrors($messages);
     }
     $new_paste = new Paste();
     $new_paste->title = Input::get('title');
     $new_paste->token = Str::random(40);
     $new_paste->delete_token = Str::random(40);
     $new_paste->paste = Input::get('paste');
     $new_paste->private = Input::get('private');
     date_default_timezone_set('UTC');
     $expire_time = date('Y-m-d H:i:s', strtotime(sprintf('now + %s minutes', Input::get('expire'))));
     $new_paste->expire = $expire_time;
     if (!$new_paste->save()) {
         Debugbar::error('Saving failed!');
     }
     // Check if tags are set
     if (Input::has('hidden-tags')) {
         $tags = explode(' ', Input::get('hidden-tags'));
         foreach ($tags as $key => $tag) {
             $tag_model = new Tag();
             $tag_model->tag = $tag;
             $tag_model->paste_id = $new_paste->id;
             $new_paste->tags()->save($tag_model);
         }
     }
     if ($new_paste->id) {
         return Redirect::route('paste.show', $new_paste->token)->withCookie(Cookie::make('edittoken', $new_paste->token, 30));
     }
     return view::make('paste.form', array('page_title' => 'Create a paste'));
 }
开发者ID:dwbfox,项目名称:pasteboard,代码行数:40,代码来源:PasteController.php

示例2: checkLaravelCookie

 private static function checkLaravelCookie()
 {
     $cv = Request::cookie('laravel-remember');
     \Debugbar::error("laravel cookie: {$cv}");
     $uc = UserCookie::where('cookie', '=', $cv)->get()->first();
     if ($uc != null) {
         $user = User::where('id', '=', $uc->user_id)->get()->first();
         Auth::login($user);
     }
 }
开发者ID:mj1618,项目名称:punto-cms,代码行数:10,代码来源:AdminLogin.php

示例3: root

 public function root()
 {
     $items = ['Pack luggage', 'Go to airport', 'Arrive in San Juan'];
     // return $items;
     // \Log::debug($items);
     // 1 \Log::info('Just an informational message.');
     // 2 \Log::warning('Something may be going wrong.');
     // 3 \Log::error('Something is definitely going wrong.');
     // 4 \Log::critical('Danger, Will Robinson! Danger!');
     \Debugbar::error('Something is definitely going wrong.');
     return view('welcome');
 }
开发者ID:Altiano,项目名称:EasyLaravel,代码行数:12,代码来源:WelcomeController.php

示例4: index

 public function index()
 {
     \Redis::set('name', 'alegriaghost');
     $name = \Redis::get('name');
     \Redis::del('name');
     \Debugbar::info($name);
     \Debugbar::warning($name);
     \Debugbar::error($name);
     \Debugbar::addMessage($name, '$name');
     var_dump($name);
     \Redis::set('name1', 'alegriaghost1');
     \Redis::set('name2', 'alegriaghost2');
     \Redis::set('name3', 'alegriaghost3');
     $list = Redis::keys('*');
     $values = Redis::mget($list);
     var_dump($list);
     var_dump($values);
 }
开发者ID:alegriaghost,项目名称:sample-program.based-laravel,代码行数:18,代码来源:SampleController.php

示例5: function

// Login and register
# Show login form
Route::get('/login', 'Auth\\AuthController@getLogin');
# Process login form
Route::post('/login', 'Auth\\AuthController@postLogin');
# Process logout
Route::get('/logout', 'Auth\\AuthController@getLogout');
# Show registration form
Route::get('/register', 'Auth\\AuthController@getRegister');
# Process registration form
Route::post('/register', 'Auth\\AuthController@postRegister');
// Debugging
Route::get('/practice', function () {
    $data = array('foo' => 'bar');
    Debugbar::info($data);
    Debugbar::error('Error!');
    Debugbar::warning('Watch out…');
    Debugbar::addMessage('Another message', 'mylabel');
    return 'Practice';
});
Route::get('/confirm-login-worked', function () {
    # You may access the authenticated user via the Auth facade
    $user = Auth::user();
    if ($user) {
        echo 'You are logged in.';
        dump($user->toArray());
    } else {
        echo 'You are not logged in.';
    }
    return;
});
开发者ID:eldaronco,项目名称:p4,代码行数:31,代码来源:routes.php

示例6: index

 public function index()
 {
     $items = array('items' => ['Pack luggage', 'Go to airport', 'Arrive in San Juan']);
     \Debugbar::error('Something is definitely going wrong.');
     return view('welcome');
 }
开发者ID:Osiya,项目名称:EasyLaravel,代码行数:6,代码来源:WelcomeController.php

示例7: get

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
get('users', 'UsersController@getInfos');
post('users', 'UsersController@postInfos');
Route::get('/', function () {
    $url = url('foo');
    \Debugbar::error($url);
    return view('welcome');
});
Route::get('/test', function () {
    return view('test.welcome');
});
Route::get('user/{id}', function ($id) {
    return 'User ' . $id;
});
开发者ID:abougeniere,项目名称:learn,代码行数:25,代码来源:routes.php

示例8:

| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
    $pathInfo = Request::getPathInfo();
    $message = $exception->getMessage() ?: 'Exception';
    $previous = URL::previous();
    $url = Request::fullUrl();
    if ($code == 404) {
        Log::error("{$code} - {$message} @ ({$pathInfo}) | {$url} (ref: {$previous})");
        Debugbar::error("{$code}, PathInfo = {$pathInfo} | fullUrl = {$url}");
        return View::make('errors.404');
    } else {
        Log::error("{$code} - {$message} @ {$pathInfo} (ref: {$previous})\r\n{$exception}");
        Debugbar::error("{$code}, {$message} @ {$pathInfo} | \r\n{$exception}");
    }
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
开发者ID:fabyo,项目名称:Skeleton_Laravel,代码行数:31,代码来源:global.php


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