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


PHP File::get方法代码示例

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


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

示例1: setMntImgAttribute

 public function setMntImgAttribute($file)
 {
     $name = $this->sanear_string(utf8_decode($this->MNT_NOMBRE));
     $this->attributes['MNT_IMG'] = 'image_' . str_replace(' ', '', $name) . '.jpg';
     $nombre = 'image_' . str_replace(' ', '', $name) . '.jpg';
     \Storage::disk('local')->put($nombre, \File::get($file));
 }
开发者ID:jfcanchignia92,项目名称:sgabrielapp,代码行数:7,代码来源:Ministerio.php

示例2: IdentitasHandle

 public function IdentitasHandle($req, $id)
 {
     // PDF tidak di update / melalui form
     // Gagal mengupload file PDF
     // Sukses Mengupload DOkumen
     $temp_iden_pesan = ['error' => ['user' => 'Peringatan : File PDF tidak di atur dengan benar !', 'sistem' => 'Terjadi kesalahan upload File PDf '], 'succes' => ['store' => 'Sukses mengupload Dokumen PDF ', 'update' => 'Sukses mengupdate Dokumen PDF ']];
     $temp_file_pesan = ['error' => '', 'succes' => ''];
     // dd($req->all());
     $file = $req->file('gambar');
     if ($file and $file->getClientMimeType() == 'application/pdf') {
         // dd($file);
         $extension = $file->getClientOriginalExtension();
         $FileIdentity = File::where('dokumen_id', $id);
         // Update
         if (count($FileIdentity->get()->toArray())) {
             $this->result['identitas']['lama'] = $FileIdentity->get()->toArray();
             //delete file
             $data_for_update = ['mime' => $file->getClientMimeType(), 'original_filename' => $file->getClientOriginalName(), 'filename' => $file->getFilename() . '.' . $extension];
             if ($FileIdentity->update($update)) {
                 $this->result['identitas']['baru'] = $FileIdentity->get()->toArray();
                 $this->{$result}['pesan'] = $temp_iden_pesan['succes']['update'];
                 // proses storage
                 if (\Storage::delete($FileIdentity->get()->toArray()[0]['filename']) && \Storage::disk('local')->put($file->getFilename() . '.' . $extension, \File::get($file))) {
                     $this->file_pesan['succes'] = $temp_file_pesan['succes'];
                     return true;
                 } else {
                     $this->file_pesan['error'] = $temp_file_pesan['error'];
                     return false;
                 }
                 return true;
             } else {
                 return false;
             }
         } else {
             // echo " new file";
             $new_dokument = new File();
             $new_dokument->dokumen_id = $id;
             $new_dokument->mime = $file->getClientMimeType();
             $new_dokument->original_filename = $file->getClientOriginalName();
             $new_dokument->filename = $file->getFilename() . '.' . $extension;
             //new identitas
             if ($new_dokument->save()) {
                 // new pdf
                 if (\Storage::disk('local')->put($file->getFilename() . '.' . $extension, \File::get($file))) {
                     return true;
                 }
                 $this->{$result}['pesan'] = $temp_iden_pesan['succes']['store'];
                 return true;
             } else {
                 $this->{$result}['pesan'] = $temp_iden_pesan['error']['sistem'];
                 return false;
             }
         }
         // }
     } else {
         $this->{$result}['pesan'] = $temp_iden_pesan['error']['user'];
         return false;
     }
 }
开发者ID:acmadi,项目名称:sp2d,代码行数:59,代码来源:FileHandle.php

示例3: setPathAttribute

 public function setPathAttribute($path)
 {
     if (!empty($path)) {
         $name = Carbon::now()->second . $path->getClientOriginalName();
         $this->attributes['path'] = $name;
         \Storage::disk('local')->put($name, \File::get($path));
     }
 }
开发者ID:nico722,项目名称:Fundacion_barraca,代码行数:8,代码来源:textos.php

示例4: countries

 public static function countries()
 {
     $countries = [];
     foreach (json_decode(\File::get(storage_path('app/countries.json')), true) as $country) {
         $countries[$country['code']] = $country['name'];
     }
     return $countries;
 }
开发者ID:adaptivemedia,项目名称:wine-cellar,代码行数:8,代码来源:Wine.php

示例5: setImgUrlAttribute

 public function setImgUrlAttribute($img_url)
 {
     if (!empty($img_url)) {
         $name = Carbon::now()->second . $img_url->getClientOriginalName();
         $this->attributes['img_url'] = $name;
         \Storage::disk('local')->put($name, \File::get($img_url));
     }
 }
开发者ID:angelsalazar,项目名称:plazaapp,代码行数:8,代码来源:Post.php

示例6: setFotoAttribute

 public function setFotoAttribute($foto)
 {
     if (!empty($foto)) {
         $this->attributes['foto'] = Carbon::now()->second . $foto->getClientOriginalName();
         $name = Carbon::now()->second . $foto->getClientOriginalName();
         \Storage::disk('local')->put($name, \File::get($foto));
     }
 }
开发者ID:Elvisley,项目名称:laravel,代码行数:8,代码来源:Pessoa.php

示例7: setImagenAttribute

 public function setImagenAttribute($imagen)
 {
     if (!empty($imagen)) {
         $this->attributes['imagen'] = \Carbon::now()->second . $imagen->getClientOriginalName();
         $filename = \Carbon::now()->second . $imagen->getClientOriginalName();
         \Storage::disk('local')->put($filename, \File::get($imagen));
         $thumb = \Image::make(\File::get($imagen));
         $ruta = public_path() . '/uploads/noticias/thumbs/';
         $thumb->resize(160, 100);
         $thumb->save($ruta . 'thumb_' . $filename);
     }
 }
开发者ID:byrogr,项目名称:admin_mundo_tuerca,代码行数:12,代码来源:Noticia.php

示例8: setImgUrlAttribute

 /**
  * @param $img_url -> nombre del archivo que quiere subir
  *
  **/
 public function setImgUrlAttribute($img_url)
 {
     /*
      * protección al actualizar un record
      * si no se quiere actualizar la imagen, no se requiere subir una imagen y guardarla en la carpeta images
      *
      * si creamos un nuevo record,
      *  AdvertisemetRequest validará que se quiere subir una imagen para crear dicho record
      */
     if (!empty($img_url)) {
         /* concatena los segundos con el nombre del archivo que se subío para evitar overides */
         $name = Carbon::now()->second . $img_url->getClientOriginalName();
         /* renombra el archivo */
         $this->attributes['img_url'] = $name;
         /* almacena la imagen en nuestra caperta images */
         /* \Storage::disk('local') =  ruta de la carpeta images */
         \Storage::disk('local')->put($name, \File::get($img_url));
     }
 }
开发者ID:jazmintinajero,项目名称:plazaapp,代码行数:23,代码来源:TestPost.php

示例9: setInfParrocoimgAttribute

 public function setInfParrocoimgAttribute($file)
 {
     $this->attributes['INF_PARROCOIMG'] = 'image_parroco.jpg';
     $nombre = 'image_parroco.jpg';
     \Storage::disk('local')->put($nombre, \File::get($file));
 }
开发者ID:jfcanchignia92,项目名称:sgabrielapp,代码行数:6,代码来源:InformacionParroquial.php

示例10: setImagenAttribute

 public function setImagenAttribute($imagen)
 {
     $this->attributes['imagen'] = Carbon::now()->hour . Carbon::now()->minute . Carbon::now()->second . $imagen->getClientOriginalName();
     $name = Carbon::now()->hour . Carbon::now()->minute . Carbon::now()->second . $imagen->getClientOriginalName();
     Storage::disk('preguntas')->put($name, \File::get($imagen));
 }
开发者ID:Adrian-Vergara,项目名称:aesap_servidor,代码行数:6,代码来源:Pregunta.php

示例11: SetMain_pictureAttribute

 public function SetMain_pictureAttribute($main_picture)
 {
     $this->attributes['main_picture'] = Carbon::now()->Second . $path->getClienteOriginalName();
     $name = Carbon::now()->Second . $path->getClienteOriginalName();
     \Storage::diSK('local')->put($name, \File::get($main_picture));
 }
开发者ID:gitsolution,项目名称:blog,代码行数:6,代码来源:cms_section.php

示例12: __construct

 public function __construct()
 {
     $this->books = Book::get();
     $this->files = File::get();
 }
开发者ID:ElliottLandsborough,项目名称:lararel-simple-library,代码行数:5,代码来源:AdminController.php

示例13: setNtImagenAttribute

 public function setNtImagenAttribute($file)
 {
     $this->attributes['NT_IMAGEN'] = 'image_' . str_replace(' ', '', date("YmdHis")) . '.jpg';
     $nombre = 'image_' . str_replace(' ', '', date("YmdHis")) . '.jpg';
     \Storage::disk('noticias')->put($nombre, \File::get($file));
 }
开发者ID:jfcanchignia92,项目名称:sgabrielapp,代码行数:6,代码来源:Noticia.php

示例14: getFit

 public function getFit($rawOptions)
 {
     $options = array_only($rawOptions, ['width', 'height']);
     if (empty($options)) {
         return $this->getFull();
     }
     $fitName = $this->hash . '-' . urlencode(\GuzzleHttp\Psr7\build_query($options)) . '.' . $this->extension;
     $fitPath = storage_path("images/fit/{$fitName}");
     if (\File::exists($fitPath)) {
         return \File::get($fitPath);
     }
     $img = ImageLib::make($this->getPath());
     $newWidth = array_get($options, 'width', null);
     $newHeight = array_get($options, 'height', null);
     if ($newWidth) {
         if ($newHeight) {
             // both width and height
             $img->fit($newWidth, $newHeight);
         } else {
             // Only Width
             $img->widen($newWidth);
         }
     } else {
         if ($newHeight) {
             // only height
             $img->heighten($newHeight);
         }
     }
     $img->save($fitPath);
     return \File::get($fitPath);
 }
开发者ID:Aliqhuart,项目名称:puzzle-wp,代码行数:31,代码来源:Image.php

示例15: copyLocalToStorage

 /**
  * Copy the local file to Storage
  */
 protected function copyLocalToStorage($localPath, $storagePath)
 {
     return Storage::put($storagePath, FileHelper::get($localPath), $this->isPublic() ? 'public' : null);
 }
开发者ID:spetross,项目名称:ugvoice,代码行数:7,代码来源:File.php


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