當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。