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


PHP Input::Get方法代码示例

本文整理汇总了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);
     });
 }
开发者ID:zulfajuniadi,项目名称:laravel-watch,代码行数:55,代码来源:WatchServiceProvider.php


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