本文整理汇总了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);
});
}