本文整理汇总了PHP中App::missing方法的典型用法代码示例。如果您正苦于以下问题:PHP App::missing方法的具体用法?PHP App::missing怎么用?PHP App::missing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App
的用法示例。
在下文中一共展示了App::missing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->userdata = $this->checkUserdata();
// apply authorization filter
$this->beforeFilter(function () {
if (!$this->userdata && Request::segment(1) !== 'login') {
return Redirect::to('/login');
}
});
// templates for app errors
App::missing(function ($exception) {
return Response::view('errors.404_cms', array(), 404);
});
App::error(function (Exception $exception, $code) {
Log::error($exception);
if ($code == 403) {
return Response::view('/errors/error_403', array(), 403);
}
});
// shared assets
Orchestra\Asset::add("bootstrap-css", "assets/css/bootstrap.min.css");
Orchestra\Asset::add("bootstrap-theme", "assets/css/bootstrap-theme.min.css");
Orchestra\Asset::add("font-awesome", "assets/css/font-awesome.min.css");
Orchestra\Asset::add("cms-css", "assets/css/cms.css");
Orchestra\Asset::add("jquery", "assets/js/jquery.js");
Orchestra\Asset::add("bootstrap-js", "assets/js/bootstrap.min.js");
Orchestra\Asset::add("handlers-js", "assets/js/handlers.js");
// shared views
View::share("active_menu_id", 1);
View::share("userdata", $this->userdata);
// configuration
Config::set("view.pagination", "common/pagination");
}
示例2: app_path
|
| 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);
});
/*
|--------------------------------------------------------------------------
| 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';
/**
* Register not found function to handle 404.
*/
App::missing(function () {
Cache::flush();
$config = Theme::first();
$themes = Config::get('themes');
$admin_theme = $themes[$config->admin_theme];
View::share('admin_theme', $admin_theme);
return Response::view('admin.404', [], 404);
});
示例3: define
/**
* Define Current Docs Version Constant
*/
if (!defined('DOCS_VERSION')) {
$version = Cookie::get('docs_version', '4.2');
if (Input::query('version') and in_array(Input::query('version'), array('4.0', '4.1', '4.2', 'master'))) {
$version = Input::query('version');
}
define('DOCS_VERSION', $version);
}
/**
* Catch A 404 On Docs...
*/
App::missing(function ($e) {
if (Request::is('docs/*')) {
return Redirect::to('docs');
}
});
/**
* Main Route...
*/
Route::get('/', function () {
return View::make('index');
});
/**
* Documentation Routes...
*/
Route::get('docs/dev', function () {
Cookie::queue('docs_version', 'master', 525600);
return Redirect::back();
});
示例4: php_sapi_name
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::missing(function ($exception) {
return Response::view('errors.missing', [], 404);
});
App::error(function (Exception $exception, $code) {
Log::error($exception);
if (App::environment() == 'production' and $code != 404) {
$emailData = array('user' => "the Scheduler", 'content' => nl2br(Request::instance()->fullUrl() . "\r\n\r\n" . $exception->getMessage() . "\r\n\r\n" . $exception->getFile() . ":" . $exception->getLine() . "\r\n\r\n" . $exception->getTraceAsString()));
Mail::send('emails.reportProblem', $emailData, function ($msg) {
$msg->to('admin@brianjacobsgolf.com')->subject("[Brian Jacobs Golf] Exception Thrown!");
if (Auth::check()) {
$msg->from(Auth::user()->email, Auth::user()->name);
}
});
return View::make('pages.admin.error')->withError("Uh-oh! It looks like you stumbled across an error. We apologize for the issue. The problem has been automatically reported to Brian Jacobs Golf. If you continue to have trouble, email admin@brianjacobsgolf.com for more help.");
}
});
App::error(function (Scheduler\Exceptions\FormValidationException $exception, $code) {
示例5: unset
unset($user);
} catch (\PDOException $e) {
if (!in_array($request->path(), array('install', 'install/db', 'install/api', 'install/user', 'install/complete'))) {
return Redirect::to('/install', 302);
}
}
});
App::after(function ($request, $response) {
if (get_class($response) != 'Symfony\\Component\\HttpFoundation\\BinaryFileResponse') {
$response->header('Cache-Control', 'no-cache, must-revalidate');
$response->header('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
}
});
App::missing(function ($exception) {
Log::error('URL : ' . URL::current());
$error = new Andriynto\Ebri\Controllers\Error();
return $error->_404();
});
/*
|--------------------------------------------------------------------------
| Auth Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify user logged in.
|
*/
Route::filter('ebri.loggedin', function () {
$api = App::make('ebri.api');
if (!$api->logsUserIn()) {
return $api->getApiServer()->resourceJson(array('message' => 'User logged out or not activated.'), 405);
}
示例6: app_path
*/
App::error(function (Exception $exception, $code) {
Log::error($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);
});
App::missing(function () {
return Response::make("This is not a valid URL for this REST service.", 404);
});
/*
|--------------------------------------------------------------------------
| 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';
示例7:
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| 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) {
Log::error($exception);
return BaseController::error(Config::get('response.unknown.code'), Config::get('response.unknown.http'), 'Unknown error');
});
App::missing(function (Exception $exception) {
return BaseController::error(Config::get('response.method.code'), Config::get('response.method.http'), 'Method not found');
});
App::error(function (Viper\Exception $exception) {
return BaseController::error($exception->getCode(), $exception->getStatusCode(), $exception->getMessage());
});
/*
|--------------------------------------------------------------------------
| 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 () {
示例8: link_to
return $list;
}
return '<li>' . link_to($routes[0]['route'], $routes[0]['text']) . '</li>';
});
/*
|--------------------------------------------------------------------------
| 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 Closure to execute when that URI is requested.
|
*/
App::missing(function ($exception) {
return View::make('child.404');
});
Route::get('/', function () {
return View::make('home');
});
Route::get('/donate', function () {
return View::make('donate');
});
Route::get('/animehd', function () {
return View::make('animehd');
});
Route::get('/sitemap', function () {
$sitemap = App::make("sitemap");
$sitemap->add('http://www.masterani.me/', '2014-07-09T20:10:00+02:00', '1.0', 'daily');
$sitemap->add('http://www.masterani.me/latest', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
$sitemap->add('http://www.masterani.me/anime', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
示例9: function
<?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 Closure to execute when that URI is requested.
|
*/
App::missing(function () {
return Redirect::to('/404');
});
route::get('/404', function () {
return View::make('error.404');
});
Route::get('/', function () {
return View::make('index');
});
Route::get('/tcit/student/subscribe', 'HomeController@showForm');
示例10: function
Route::post('/upload-slider', 'SliderController@upload');
});
Route::get('/speciality', 'SpecialitiesController@create');
Route::group(['prefix' => 'speciality'], function () {
Route::post('/save', 'SpecialitiesController@store');
Route::post('/delete', 'SpecialitiesController@destroy');
});
Route::get('/user', 'UsersController@create');
Route::group(['prefix' => 'user'], function () {
Route::post('/save', 'UsersController@store');
Route::post('/update', 'UsersController@update');
Route::post('/show', 'UsersController@show');
Route::post('/activate', 'UsersController@activate');
});
/*
Route::get('/clientes/{cliente}/{reporte}', 'FilesController@getFileNames');
Route::get('/clientes', function(){
return View::make('clientes');
});
Route::post('/upload-file/{cliente}/{reporte}','FilesController@uploadFile');
Route::get('/delete_file','FilesController@deleteFile');
Route::get('/send-email/{cliente}/{reporte}','HomeController@sendEmail');
*/
});
App::missing(function ($exception) {
return Response::view('errors.404');
});
示例11: function
<?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 Closure to execute when that URI is requested.
|
*/
// Auth Filter
Route::filter('sentry_auth', function () {
// If user is not logged in redirect to login page
if (!Sentry::check()) {
return Redirect::to('/');
}
});
/**
* APIs
*/
Route::group(array('before' => 'sentry_auth'), function () {
Route::resource('booking', 'BookingController');
});
Route::get('logout', array('uses' => 'BookingController@getLogout'));
Route::controller('/', 'HomeController');
App::missing(function ($exception) {
return View::make('home.index');
});
示例12: app_path
/*
|--------------------------------------------------------------------------
| 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 maintenace mode is in effect for this application.
|
*/
App::down(function () {
return Response::make("Be right back!", 503);
});
App::missing(function ($exception) {
if (Auth::guest()) {
return Redirect::to('/');
} else {
return Response::view('errors.404', array(), '404');
}
});
/*
|--------------------------------------------------------------------------
| 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';
示例13: function
<?php
include 'routes/public.php';
Route::group(['prefix' => 'api'], function () {
include 'routes/api.php';
});
App::missing(function ($exception) {
return Response::unauthorized();
});
Route::get('/api/search/doctors', 'DoctorController@search');
Route::get('/api/specializations', 'DoctorController@showAllSpecializations');
Route::post('/auth/doctor/signup', 'DoctorController@signup');
Route::post('/auth/doctor/login', 'DoctorController@login');
Route::get('/api/clinic/{id}', 'ClinicController@show');
Route::get('/api/clinics', 'ClinicController@index');
Route::post('/api/appointment', 'AppointmentController@makeAppointment');
Route::post('/api/appointment/verify', 'AppointmentController@verifyAppointment');
Route::get('/seealldocs', function () {
return Response::json(['doctors' => Doctor::all()]);
});
示例14: function
GET /resource index resource.index
GET /resource/create create resource.create
POST /resource store resource.store
GET /resource/{resource} show resource.show
GET /resource/{resource}/edit edit resource.edit
PUT/PATCH /resource/{resource} update resource.update
DELETE /resource/{resource} destroy resource.destroy
*/
});
// API routes for Landing Page Urls operations
Route::group(array('prefix' => 'api/'), function () {
Route::resource('landingpageurls', 'LandingPageUrlsController');
});
// Resource Routes for User management
Route::group(array('prefix' => 'api/'), function () {
Route::resource('users', 'UserController');
});
// API routes for WordCloud // NOT the landing Page word cloud
Route::group(array('prefix' => 'api/wordcloud'), function () {
// Step 5 : Download word cloud string
Route::get('/gettagcloud/{dataaccountid}', 'WordController@index');
// Step 5 : delete delete Ids and save segmets
Route::post('/savesegmentmap/{dataaccount}', 'WordController@saveSegmentMap');
});
////////////////////////// USER AUTHENTICATION
// Catch all route
App::missing(function ($exception) {
return "XXXX PATH ERROR";
return var_dump($exception);
return View::make('index');
});
示例15:
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| 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) {
Log::error($exception);
return Response::view('error', ['error' => 'A website error has occurred.
The website administrator has been notified of the issue.
Sorry for the temporary inconvenience.'], 500);
});
App::missing(function ($exception) {
return Response::view('error', ['error' => '404 Not Found.'], 404);
});
/*
|--------------------------------------------------------------------------
| 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);
});
/*