本文整理匯總了PHP中Illuminate\Support\Facades\Input::Get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::Get方法的具體用法?PHP Input::Get怎麽用?PHP Input::Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Support\Facades\Input
的用法示例。
在下文中一共展示了Input::Get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: register_watcher
private function register_watcher()
{
$watcher = $this;
Route::get('/_watcher', function () use($watcher) {
clearstatcache();
$input = $watcher->cleanup(json_decode(Input::Get('query')));
Event::fire('watcher:check', array($input));
$response = array('do' => 'NOOP');
if ($input !== null && $input->timestamp) {
$timestamp = strtotime($input->timestamp);
$viewBase = app_path() . '/views/';
$controllerBase = app_path() . '/controllers/';
$modelBase = app_path() . '/models/';
$views = $watcher->check_modified($viewBase, $timestamp);
$controllers = $watcher->check_modified($controllerBase, $timestamp);
$models = $watcher->check_modified($modelBase, $timestamp);
$otherDirs = array();
if (isset($input->additionalfolders)) {
$additionalfolders = $input->additionalfolders;
if (is_array($additionalfolders)) {
foreach ($additionalfolders as $folder) {
$otherBase = base_path() . DS . $folder;
if (is_dir($otherBase)) {
$otherDirs += $watcher->check_modified($controllerBase, $timestamp);
}
}
}
}
if (count($views) > 0 || count($controllers) > 0 || count($models) > 0 || count($otherDirs) > 0) {
$response = array('do' => 'RELOAD');
}
if (isset($input->css)) {
foreach ($input->css as $cssFile) {
$file = public_path() . $cssFile;
if (file_exists($file) && filemtime($file) > $timestamp) {
$response = array('do' => 'RELOAD');
}
}
}
if (isset($input->js)) {
foreach ($input->js as $jsFile) {
$file = public_path() . $jsFile;
if (file_exists($file) && filemtime($file) > $timestamp) {
$response = array('do' => 'RELOAD');
}
}
}
if (filemtime($watcher->watcher_reload_file) > $timestamp) {
$response = array('do' => 'RELOAD');
}
return Response::json($response);
}
return Response::json($response);
});
}