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


PHP Storage::extend方法代码示例

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


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

示例1: boot

 public function boot()
 {
     \Storage::extend('qiniu', function ($app, $config) {
         if (isset($config['domains'])) {
             $domains = $config['domains'];
         } else {
             $domains = ['default' => $config['domain'], 'https' => null, 'custom' => null];
         }
         $qiniu_adapter = new QiniuAdapter($config['access_key'], $config['secret_key'], $config['bucket'], $domains, $config['notify_url'] ? $config['notify_url'] : null);
         $file_system = new Filesystem($qiniu_adapter);
         $file_system->addPlugin(new PrivateDownloadUrl());
         $file_system->addPlugin(new DownloadUrl());
         $file_system->addPlugin(new ImageInfo());
         $file_system->addPlugin(new ImageExif());
         $file_system->addPlugin(new ImagePreviewUrl());
         $file_system->addPlugin(new PersistentFop());
         $file_system->addPlugin(new PersistentStatus());
         $file_system->addPlugin(new UploadToken());
         $file_system->addPlugin(new PrivateImagePreviewUrl());
         $file_system->addPlugin(new VerifyCallback());
         $file_system->addPlugin(new Fetch());
         $file_system->addPlugin(new Qetag());
         return $file_system;
     });
 }
开发者ID:zgldh,项目名称:qiniu-laravel-storage,代码行数:25,代码来源:QiniuFilesystemServiceProvider.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     $this->app->make('config')->set('filesystems.disks.media', ['driver' => 'media']);
     \Storage::extend('media', function (Application $app, $config) {
         return new Media();
     });
 }
开发者ID:rabbitcms,项目名称:filemanager,代码行数:13,代码来源:FileManagerServiceProvider.php

示例3: boot

 public function boot()
 {
     \Storage::extend('ucloud-ufile', function ($app, $config) {
         $ufileAdapter = new UcloudUfileAdapter($config['bucket'], $config['public_key'], $config['secret_key'], $config['suffix'], $config['prefix']);
         $fs = new Filesystem($ufileAdapter);
         return $fs;
     });
 }
开发者ID:xujif,项目名称:ucloud-ufile-storage,代码行数:8,代码来源:UfileServiceProvider.php

示例4: mockStorage

 protected function mockStorage()
 {
     Storage::extend('mock', function () {
         return \Mockery::mock(\Illuminate\Contracts\Filesystem\Filesystem::class);
     });
     Config::set('filesystems.disks.mock', ['driver' => 'mock']);
     Config::set('filesystems.default', 'mock');
     return Storage::disk();
 }
开发者ID:mcknight0219,项目名称:shopus,代码行数:9,代码来源:TestCase.php

示例5: boot

 public function boot()
 {
     \Storage::extend('qiniu', function ($app, $config) {
         $qiniu_adapter = new QiniuAdapter($config['access_key'], $config['secret_key'], $config['bucket'], $config['domain']);
         $file_system = new Filesystem($qiniu_adapter);
         $file_system->addPlugin(new PrivateDownloadUrl());
         $file_system->addPlugin(new DownloadUrl());
         $file_system->addPlugin(new ImageInfo());
         $file_system->addPlugin(new ImageExif());
         $file_system->addPlugin(new ImagePreviewUrl());
         $file_system->addPlugin(new PersistentFop());
         $file_system->addPlugin(new PersistentStatus());
         $file_system->addPlugin(new UploadToken());
         return $file_system;
     });
 }
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:16,代码来源:QiniuFilesystemServiceProvider.php

示例6: boot

 public function boot()
 {
     class_alias('Illuminate\\Support\\Facades\\Storage', 'Storage');
     //for Lumen5.2
     \Storage::extend('qiniu', function ($app, $config) {
         $qiniu_adapter = new QiniuAdapter($config['access_key'], $config['secret_key'], $config['bucket'], $config['domain'], $config['pipeline'], $config['notify_url']);
         $file_system = new Filesystem($qiniu_adapter);
         $file_system->addPlugin(new PrivateDownloadUrl());
         $file_system->addPlugin(new DownloadUrl());
         $file_system->addPlugin(new ImageInfo());
         $file_system->addPlugin(new ImageExif());
         $file_system->addPlugin(new ImagePreviewUrl());
         $file_system->addPlugin(new PersistentFop());
         $file_system->addPlugin(new PersistentStatus());
         $file_system->addPlugin(new UploadToken());
         $file_system->addPlugin(new PutFile());
         $file_system->addPlugin(new Put());
         return $file_system;
     });
 }
开发者ID:abcsun,项目名称:qiniu-laravel-storage,代码行数:20,代码来源:QiniuFilesystemServiceProvider.php


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