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


PHP Storage::lastModified方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Storage::lastModified方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::lastModified方法的具体用法?PHP Storage::lastModified怎么用?PHP Storage::lastModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Storage的用法示例。


在下文中一共展示了Storage::lastModified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: membersMapNorway

 /**
  * Norwegian map with municipalities where Alternativet is represented highlighted
  */
 public function membersMapNorway()
 {
     $data = "";
     if (!Storage::exists('members-norway-map.svg') || Storage::lastModified('members-norway-map.svg') <= time() - 60 * 60 * 24) {
         $svg = simplexml_load_file(base_path() . '/resources/svg/Norway_municipalities_2012_blank.svg');
         // Determine which municipalities there are members in
         $result = DB::select(DB::raw("\n              select postal_areas.municipality_code, count(*) as count\n              from users\n              left join postal_areas\n              on (users.postal_code = postal_areas.postal_code)\n              group by municipality_code"));
         $municipalities = [];
         foreach ($result as $row) {
             if ($row->municipality_code) {
                 $municipalities[] = $row->municipality_code;
             }
         }
         foreach ($svg->g as $county) {
             foreach ($county->path as $path) {
                 if (in_array($path['id'], $municipalities)) {
                     // There are members in this municipality
                     $path['style'] = 'fill:#0f0;fill-opacity:1;stroke:none';
                 } else {
                     $path['style'] = 'fill:#777;fill-opacity:1;stroke:none';
                 }
             }
         }
         $data = $svg->asXML();
         Storage::put('members-norway-map.svg', $data);
     }
     if (empty($data)) {
         $data = Storage::get('members-norway-map.svg');
     }
     return response($data)->header('Content-Type', 'image/svg+xml');
 }
开发者ID:partialternativet,项目名称:api,代码行数:34,代码来源:GraphicsController.php


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