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


PHP Storage::extend方法代码示例

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


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

示例1: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('bos', function ($app, $config) {
         $client = new BosClient($config);
         return new Filesystem(new BosAdapter($client, $config));
     });
 }
开发者ID:7keys,项目名称:qtools,代码行数:12,代码来源:BosServiceProvider.php

示例2: boot

 public function boot()
 {
     Storage::extend('dropbox', function ($app, $config) {
         $client = new DropboxClient($config['accessToken'], $config['appSecret']);
         return new Filesystem(new DropboxAdapter($client));
     });
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:7,代码来源:DropboxFilesystemServiceProvider.php

示例3: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('cloudinary', function ($app, $config) {
         $client = new CloudinaryClient(['cloud_name' => $config['name'], 'api_key' => $config['key'], 'api_secret' => $config['secret']]);
         return new Filesystem(new CloudinaryAdapter($client));
     });
 }
开发者ID:nordsoftware,项目名称:lumen-cloudinary,代码行数:12,代码来源:CloudinaryServiceProvider.php

示例4: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('s3', function ($app, $config) {
         $client = S3Client::factory(['key' => env('AWS_KEY'), 'secret' => env('AWS_SECRET'), 'region' => env('AWS_REGION')]);
         $adapter = new AwsS3Adapter($client, env('AWS_BUCKET'));
         return new Filesystem($adapter);
     });
 }
开发者ID:younginnovations,项目名称:resourcecontracts-country-subsite,代码行数:13,代码来源:AppServiceProvider.php

示例5: boot

 /**
  * Perform post-registration booting of services.
  */
 public function boot()
 {
     /**
      * php artisan vendor:publish --provider="bernardomacedo\DBTranslator\DBTranslatorServiceProvider"
      */
     $this->publishes([__DIR__ . '/../resources/config/laravel-db-translator.php' => config_path('db-translator.php')], 'config');
     $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'dbtranslator');
     $this->publishes([__DIR__ . '/../resources/lang' => base_path('resources/lang/vendor/dbtranslator')], 'lang');
     if (!class_exists('CreateTranslationsTable')) {
         // Publish the migration
         $timestamp = date('Y_m_d_His', time());
         $this->publishes([__DIR__ . '/../resources/migrations/create_translations_tables.php.stub' => $this->app->basePath() . '/database/migrations/' . $timestamp . '_create_translations_tables.php'], 'migrations');
     }
     /**
      * Create an helper file for using at blade like {{ intl() }}
      */
     require_once __DIR__ . '/Helpers/intl.php';
     Storage::extend('translations', function () {
         $client = ['driver' => 'local', 'root' => base_path('resources/vendor/dbtranslator')];
         return new Filesystem($client);
     });
 }
开发者ID:bernardomacedo,项目名称:laravel-db-translator,代码行数:25,代码来源:DBTranslatorServiceProvider.php

示例6: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('sftp', function ($app, $config) {
         return new Filesystem(new SftpAdapter(['host' => $config['host'], 'port' => $config['port'], 'username' => $config['username'], 'password' => $config['password'], 'privateKey' => $config['privateKey'], 'root' => $config['root'], 'timeout' => $config['timeout']]));
     });
 }
开发者ID:jailtonsc,项目名称:sftp-laravel,代码行数:11,代码来源:SFTPServiceProvider.php

示例7: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('dag', function ($app, $config) {
         return new Filesystem(new DagAdapter($config));
     });
 }
开发者ID:fileio,项目名称:dag-client,代码行数:11,代码来源:GioServiceProvider.php

示例8: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     Storage::extend('gae', function ($app, $config) {
         return new Flysystem(new GaeFilesystemAdapter($config['root']));
     });
 }
开发者ID:wasay,项目名称:GaeSupportL5,代码行数:11,代码来源:GaeSupportServiceProvider.php


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