本文整理汇总了PHP中App::down方法的典型用法代码示例。如果您正苦于以下问题:PHP App::down方法的具体用法?PHP App::down怎么用?PHP App::down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App
的用法示例。
在下文中一共展示了App::down方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: app_path
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 maintenace mode is in effect for this application.
|
*/
App::down(function () {
$ip = Request::getClientIp();
$whitelist = array("173.13.187.110");
if (!in_array($ip, $whitelist)) {
return Response::view('maintenance', array(), 403);
}
});
/*
|--------------------------------------------------------------------------
| 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';
/*
示例2: die
}
die($response);
});
/*
|--------------------------------------------------------------------------
| 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 () {
if (!empty($_COOKIE['dev'])) {
return NULL;
}
return Response::view('maintenance', array(), 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';
require app_path() . '/composers.php';
require app_path() . '/lib/helpers/translate.php';
示例3: app_path
| us to have error handling setup before we boot our application.
|
*/
require __DIR__ . '/errors.php';
/*
|--------------------------------------------------------------------------
| 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 show_error_page(503);
});
/*
|--------------------------------------------------------------------------
| Require The Functions File
|--------------------------------------------------------------------------
|
| We will require a file which you can define any custom functions for
| your application, before any usage of these functions occurs. This
| is just a convenient way to organize your code.
|
*/
require app_path() . '/functions.php';
/*
|--------------------------------------------------------------------------
| Require The Hooks File
示例4: array
/*App::missing(function($exception)
{
return Response::view('errorpages.404', array(), 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 maintenace mode is in effect for this application.
|
*/
App::down(function () {
return Response::view('errors.maintenance');
});
App::bind('TaskInterface', function () {
return new TaskRepository();
});
App::bind('ProjectInterface', function () {
return new ProjectRepository();
});
App::bind('CalendarInterface', function () {
return new CalendarRepository();
});
App::bind('TimesheetInterface', function () {
return new TimesheetRepository();
});
App::bind('TodoInterface', function () {
return new TodoRepository();
示例5: app_path
| shown, which includes a detailed stack trace during debug.
|
*/
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::view('public.maintenance', array(), 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';
require app_path() . '/blade.php';
示例6: app_path
case 500:
return Response::make(View::make('error/500'), 500);
default:
return Response::make(View::make('error/404'), 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 maintenace mode is in effect for this application.
|
*/
App::down(function () {
return Response::make(View::make('error/503'), 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';
示例7: app_path
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
return Response::make("Sistem ini sedang dikemaskini. Harap Maaf.", 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("Sistem Dalam Selenggaraan!", 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';
示例8: trim
App::down(function () {
// Get Path Info
$pathInfo = trim(currentPathInfo(), "/");
// Allowed
$allowed = false;
// Check for Login Page
if (currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::loginRoute(), \Developeryamhi\AuthModule\UserItem::loginRouteParams()) || currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::logoutRoute(), \Developeryamhi\AuthModule\UserItem::logoutRouteParams())) {
$allowed = true;
}
// Check for User
if (!$allowed && Auth::check() && Auth::user()->canAccess("maintainance_mode")) {
$allowed = true;
}
// Get IPs if Setting Created
$maintainance_ip_use_as = getSetting("maintainance_ip_use_as");
$maintainance_ips = getSetting("maintainance_ips");
// Check if Setting is Valid
if ($maintainance_ip_use_as && $maintainance_ips && !empty($maintainance_ips)) {
// IP List
$ip_list = explode("\r\n", $maintainance_ips);
// Current Visitor IP
$currentIP = Request::getClientIp();
// Found
$found = in_array($currentIP, $ip_list);
// Check Found
if ($found && $maintainance_ip_use_as == "whitelist") {
$allowed = true;
} else {
if (!$found && $maintainance_ip_use_as == "whitelist") {
$allowed = false;
} else {
if ($found && $maintainance_ip_use_as == "blacklist") {
$allowed = false;
} else {
if (!$found && $maintainance_ip_use_as == "blacklist") {
$allowed = true;
}
}
}
}
}
// Check for Scripts, Styles & Images
if (!$allowed && (in_array(substr($pathInfo, -3), array(".js")) || in_array(substr($pathInfo, -4), array(".css", ".jpg", ".png")))) {
// Set Allowed
$allowed = true;
}
// Check Allowed
if (!$allowed) {
return Response::view("laravel-admin::maintainance", array("errorTitle" => "System Undergoing Changes"), 503);
}
});
示例9: function
Route::get('/galerias', ['as' => 'galleries', 'uses' => 'GalleryController@index']);
Route::get('/galeria/{slug}/{id}', ['as' => 'gallery', 'uses' => 'GalleryController@show']);
// Plana Aadministrativa
route::get('/plana-administrativa', ['as' => 'leadership', 'uses' => 'LeaderShipController@index']);
// Incotec
route::get('/incotec', ['as' => 'incotec', 'uses' => 'IncotecController@index']);
// Contacto
Route::get('/contacto', ['as' => 'contact', 'uses' => 'ContactController@index']);
Route::post('/contacto', ['as' => 'contact_store', 'before' => 'csrf', 'uses' => 'ContactController@store']);
// Login
Route::post('/login', ['as' => 'login', 'before' => 'csrf', 'uses' => 'AuthController@postLogin']);
Route::get('/logout', ['as' => 'logout', 'before' => 'auth', 'uses' => 'AuthController@logout']);
Route::group(['before' => 'guest'], function () {
Route::get('/login', ['as' => 'login', 'uses' => 'AuthController@showLogin']);
Route::get('/forgot-password', ['as' => 'forgot', 'uses' => 'AuthController@getForgotPassword']);
Route::post('/forgot-password', ['as' => 'forgot-post', 'uses' => 'AuthController@postForgotPassword']);
Route::get('/recover/{code}', ['as' => 'account-recover', 'uses' => 'AuthController@getRecover']);
});
Route::group(['before' => 'auth'], function () {
require __DIR__ . '/routes/auth.php';
Route::group(['before' => 'is_admin'], function () {
require __DIR__ . '/routes/admin.php';
});
});
App::missing(function ($exception) {
return Redirect::route('error_404');
});
// mantenimiento
App::down(function () {
return Redirect::route('error_503');
});
示例10: app_path
App::error(function (Exception $exception, $code) {
Log::error($exception);
});
App::error(function (Illuminate\Session\TokenMismatchException $exception) {
return Response::make("CSRF error.", 500);
});
/*
|--------------------------------------------------------------------------
| 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 DebugHelpers::generateMaintenanceModeResponse();
});
/*
|--------------------------------------------------------------------------
| 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';
require app_path() . '/events.php';
示例11: function
<?php
/* GLOBAL PATTERN
==========================================*/
App::down(function () {
return "Maintaining";
});
Route::pattern('id', '\\d+');
Route::pattern('username', '[a-z0-9_.]+');
Route::pattern('slug', '[a-zA-Z0-9-]+');
/* END GLOBAL PATTERN
==========================================*/
/* BACKEND ROUTES
==========================================*/
/*
* Logged routes without permission
*/
Route::group(array('before' => 'basicAuth', 'prefix' => Config::get('backend.uri')), function () {
Route::get('advertiser-manager', array('as' => 'AdvertiserManagerIndex', 'uses' => 'AdvertiserManagerController@index'));
Route::get('advertiser-manager/dashboard', array('as' => 'AdvertiserManagerDashboard', 'uses' => 'DashboardAdvertiserManagerController@showIndex'));
Route::get('advertiser-manager/logout', array('as' => 'AdvertiserManagerLogout', 'uses' => 'AdvertiserManagerController@logout'));
Route::get('advertiser-manager/access-denied', array('as' => 'AdvertiserManagerAccessDenied', 'uses' => 'AdvertiserManagerController@getAccessDenied'));
Route::get('advertiser', array('as' => 'AdvertiserIndex', 'uses' => 'AdvertiserController@index'));
Route::get('advertiser/dashboard', array('as' => 'AdvertiserDashboard', 'uses' => 'DashboardAdvertiserController@showIndex'));
Route::get('advertiser/logout', array('as' => 'AdvertiserLogout', 'uses' => 'AdvertiserController@logout'));
Route::get('advertiser/access-denied', array('as' => 'AdvertiserAccessDenied', 'uses' => 'AdvertiserController@getAccessDenied'));
Route::get('publisher-manager', array('as' => 'PublisherManagerIndex', 'uses' => 'PublisherManagerController@index'));
Route::get('publisher-manager/approve', array('as' => 'PublisherManagerDashboard', 'uses' => 'ApprovePublisherManagerController@showList'));
Route::post('publisher-manager/show-list', array('as' => 'PublisherManagershowListDashboard', 'uses' => 'DashboardPublisherManagerController@showListDashboard'));
Route::get('publisher-manager/logout', array('as' => 'PublisherManagerLogout', 'uses' => 'PublisherManagerController@logout'));
Route::get('publisher-manager/access-denied', array('as' => 'PublisherManagerAccessDenied', 'uses' => 'PublisherManagerController@getAccessDenied'));
示例12: json_encode
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
$message = $exception->getMessage();
return json_encode(array('error' => array('code' => $code, 'message' => empty($message) ? 'The resource or path you are looking for does not exist.' : $message, 'file' => $exception->getFile(), 'line' => $exception->getLine())));
});
/*
|--------------------------------------------------------------------------
| 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 json_encode(array('error' => array('code' => '503', 'message' => 'Sorry, server is in maintenance.')));
});
/*
|--------------------------------------------------------------------------
| 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: array
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
if (!Config::get('app.debug')) {
return Response::view('notifications.500', array(), 500);
}
});
/*
|--------------------------------------------------------------------------
| 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::view('notifications.maintenance', array(), 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';
示例14: array
return Response::view('errors.default', array(), $code);
}
}
});
/*
|--------------------------------------------------------------------------
| 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("We are down for maintenance!", 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';
/*
|--------------------------------------------------------------------------
| Macro for the menu items active states
示例15: app_path
| shown, which includes a detailed stack trace during debug.
|
*/
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 View::make('system.down');
});
/*
|--------------------------------------------------------------------------
| 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';
require app_path() . '/events.php';