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


PHP Storage::allFiles方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Suppression préalable des fichiers de upload par l'utilisation de la variable storage définie à l'aide de l'instruction public_path('upload') du fichier de configuration config\filesystem.php)
     $files = Storage::allFiles();
     //retroune un tableau des images de storage
     foreach ($files as $file) {
         Storage::delete($file);
     }
     //Supprimer toutes les lignes de la talble Pictures
     //        DB::table('pictures')->
     // Récupération d'un faker opétationnel
     // $faker = Faker\Factory::create();
     $products = Product::all();
     foreach ($products as $product) {
         // Stokage de l'image et récupération de l'uri
         $uri = str_random(15) . '_370x235.jpg';
         Storage::put($uri, file_get_contents('http://lorempixel.com/people/370/325/'));
         Picture::create(['product_id' => $product->id, 'uri' => $uri, 'title' => $this->faker->name]);
     }
     //        DB::table('pictures')->insert(
     //            [
     //                [
     //                    'product_id'  => '2' ,
     //                    'uri'         => $uri
     //                ],
     //            ]
     //        );
 }
开发者ID:lionel-kahan,项目名称:Star-Wars,代码行数:33,代码来源:PictureTableSeeder.php

示例2: run

 public function run()
 {
     $files = Storage::allFiles();
     foreach ($files as $file) {
         Storage::delete($file);
     }
     $test = Product::all();
     foreach ($test as $value) {
         $uri = str_random(12) . '_370x235.jpg';
         Storage::put($uri, file_get_contents('http://lorempixel.com/futurama/370/235'));
         Picture::create(['product_id' => $value->id, 'uri' => $uri, 'title' => $this->faker->name]);
     }
 }
开发者ID:olivierfinot,项目名称:ProjetLaravel,代码行数:13,代码来源:PictureTableSeeder.php

示例3: run

 public function run()
 {
     $files = Storage::allFiles();
     foreach ($files as $file) {
         Storage::delete($file);
     }
     $products = App\Product::all();
     foreach ($products as $product) {
         // pour importer de fichiers distants
         $uri = str_random(12) . '_370x235.jpg';
         Storage::put($uri, file_get_contents('http://lorempixel.com/futurama/370/235/'));
         Picture::create(['product_id' => $product->id, 'uri' => $uri, 'title' => $this->faker->name]);
     }
 }
开发者ID:bocanico,项目名称:ProjetStarWars,代码行数:14,代码来源:PictureTableSeeder.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //        Eloquent::unguard();
     DB::table('pictures')->delete();
     DB::statement("ALTER TABLE pictures AUTO_INCREMENT=1");
     $files = Storage::allFiles();
     foreach ($files as $file) {
         Storage::delete($file);
     }
     $products = Product::all();
     foreach ($products as $product) {
         $uri = str_random(12) . '_370x235.jpg';
         Storage::put($uri, file_get_contents('http://lorempixel.com/futurama/370/235'));
         Picture::create(['product_id' => $product->id, 'uri' => $uri, 'title' => $this->facker->name, 'type' => 'jpg', 'size' => 200]);
     }
 }
开发者ID:patlegris,项目名称:appStarWars,代码行数:21,代码来源:PictureTableSeeder.php

示例5: run

 public function run()
 {
     $files = Storage::allFiles();
     foreach ($files as $file) {
         Storage::delete($file);
         //sert a vider le dossier upload si on relance un refresh
         //pour éviter de stocker 15 images + 15 images ect...
     }
     $products = Product::all();
     //recupere tous les produits precedement creer dans un tableau
     foreach ($products as $product) {
         $uri = str_random(12) . '_370x235.jpg';
         //str_random fait un chaine de caractere de 12
         Storage::put($uri, file_get_contents('http://lorempixel.com/futurama/370/235/'));
         Picture::create(['product_id' => $product->id, 'uri' => $uri, 'title' => $this->faker->name]);
     }
 }
开发者ID:laetitia91800,项目名称:StarWars,代码行数:17,代码来源:PictureTableSeeder.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->insert([['name' => 'Tony', 'email' => 'tony@tony.fr', 'password' => Hash::make('Tony'), 'role' => 'administrator'], ['name' => 'Antoine', 'email' => 'antoine@antoine.fr', 'password' => Hash::make('Antoine'), 'role' => 'visitor'], ['name' => 'Romain', 'email' => 'romain@romain.fr', 'password' => Hash::make('Tony'), 'role' => 'visitor'], ['name' => 'yini', 'email' => 'ynin@ynin.fr', 'password' => Hash::make('Yini'), 'role' => 'visitor']]);
     factory(App\Customer::class, 4)->create();
     // avatars
     DB::table('avatars')->delete();
     DB::statement("ALTER TABLE avatars AUTO_INCREMENT=1");
     $files = Storage::allFiles(env('UPLOADS_AVATARS', 'uploads'));
     foreach ($files as $file) {
         Storage::delete($file);
     }
     $users = User::all();
     foreach ($users as $user) {
         $uri = str_random(12) . '_216x256.jpg';
         $fileName = file_get_contents('http://lorempixel.com/216/256/animals');
         $pathDirectory = env('UPLOADS_AVATARS', 'avatars') . DIRECTORY_SEPARATOR . $uri;
         Storage::put($pathDirectory, $fileName);
         $mime = mime_content_type(storage_path('app') . DIRECTORY_SEPARATOR . $pathDirectory);
         Avatar::create(['user_id' => $user->id, 'uri' => $uri, 'title' => $this->facker->name, 'mime' => $mime]);
     }
 }
开发者ID:Antoine07,项目名称:appStarwars,代码行数:26,代码来源:UserTableSeeder.php

示例7: base_path

| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = (require_once __DIR__ . '/application/bootstrap/app.php');
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make('Illuminate\\Contracts\\Http\\Kernel');
$response = $kernel->handle($request = Illuminate\Http\Request::capture());
#SYNTROPY: 2016-02-06: Die and Dump Settings
#dd(App::make('Settings'));
#$storagePath  = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix();
#$storagePath = base_path();
#$storagePath  = Storage::disk('cryptoffice');
#dd($storagePath);
$files = Storage::allFiles('application/storage/uploads/');
#$files = Storage::allFiles($storagePath);
dd($files);
$response->send();
$kernel->terminate($request, $response);
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:31,代码来源:index.php


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