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


PHP Filesystem::getAdapter方法代码示例

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


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

示例1: delete

 /**
  * @param array $fileList
  */
 public function delete(array $fileList)
 {
     foreach ($fileList as $file) {
         $this->logger->notice('Deleting ' . $file . ' in s3 bucket ' . $this->filesystem->getAdapter()->getBucket());
         try {
             $this->filesystem->delete($file);
         } catch (\Exception $e) {
             $this->logger->error('Exception while deleting ' . $file . ': ' . $e->getMessage());
         }
     }
 }
开发者ID:TomAdam,项目名称:db-backup,代码行数:14,代码来源:S3StorageAdapter.php

示例2: getIcon

 /**
  * Find the icon based on the used Adapter
  *
  * @return string
  */
 protected function getIcon()
 {
     try {
         $adapter = $this->fs->getAdapter();
     } catch (\Exception $e) {
         $adapter = null;
     }
     if ($adapter instanceof AbstractFtpAdapter) {
         $icon = 'volume_icon_ftp.png';
     } elseif ($adapter instanceof DropboxAdapter) {
         $icon = 'volume_icon_dropbox.png';
     } else {
         $icon = 'volume_icon_local.png';
     }
     $parentUrl = defined('ELFINDER_IMG_PARENT_URL') ? rtrim(ELFINDER_IMG_PARENT_URL, '/') . '/' : '';
     return $parentUrl . 'img/' . $icon;
 }
开发者ID:manyoubaby123,项目名称:imshop,代码行数:22,代码来源:FlysystemDriver.php

示例3: setProtectedFilesystem

 /**
  * Assign filesystem to use for non-public files
  *
  * @param Filesystem $filesystem
  * @return $this
  */
 public function setProtectedFilesystem(Filesystem $filesystem)
 {
     if (!$filesystem->getAdapter() instanceof ProtectedAdapter) {
         throw new InvalidArgumentException("Configured adapter must implement ProtectedAdapter");
     }
     $this->protectedFilesystem = $filesystem;
     return $this;
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:14,代码来源:FlysystemAssetStore.php

示例4: makeZip

 /**
  * @param Filesystem $filesystem
  */
 public static function makeZip(Filesystem $filesystem)
 {
     $zip = $filesystem->getAdapter();
     if (is_a($zip, 'ZipArchiveAdapter')) {
         $zip->getArchive()->close();
     }
 }
开发者ID:padosoft,项目名称:tessera-sanitaria,代码行数:10,代码来源:IOHelper.php

示例5: archive_backup

function archive_backup($config, $files)
{
    info(__FUNCTION__ . ' start...<br />');
    $fs = new Filesystem(new ZipArchiveAdapter($config['archive']['target']));
    foreach ($files as $remote => $file) {
        // info(sprintf('put: %s to %s<br />', $file, $remote));
        try {
            $fp = fopen($file, 'r+');
            $fs->putStream($remote, $fp);
            fclose($fp);
        } catch (Exception $e) {
            info('<span class="color:red">error: ' . $e->getMessage() . '</span>');
            info('<span class="color:red">file: ' . $file . '</span>');
        }
    }
    $fs->getAdapter()->getArchive()->close();
    info(__FUNCTION__ . ' finished...<br />');
}
开发者ID:recca0120,项目名称:backup,代码行数:18,代码来源:function.php

示例6: let

 function let(InvalidItemsCollector $collector, CsvWriter $writer, Filesystem $filesystem, LocalAdapter $adapter)
 {
     $filesystem->getAdapter()->willReturn($adapter);
     $adapter->getPathPrefix()->willReturn(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'archivist/');
     $this->beConstructedWith($collector, $writer, $filesystem, '/root');
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:6,代码来源:InvalidItemsCsvArchiverSpec.php

示例7: getPathPrefix

 /**
  * Get base path.
  *
  * @return string
  */
 public function getPathPrefix()
 {
     return $this->filesystem->getAdapter()->getPathPrefix();
 }
开发者ID:da-vinci-studio,项目名称:file-bundle,代码行数:9,代码来源:Local.php

示例8: flushZipArchive

 /**
  * Close and reopen a zip archive, forcing writing to disk
  *
  * @param \League\Flysystem\Filesystem $filesystem
  */
 protected static function flushZipArchive(Filesystem $filesystem)
 {
     $_adapter = $filesystem->getAdapter();
     if ($_adapter instanceof ZipArchiveAdapter) {
         $_filename = $_adapter->getArchive()->filename;
         $_adapter->getArchive()->close();
         $_adapter->openArchive($_filename);
     }
 }
开发者ID:rajeshpillai,项目名称:dfe-common,代码行数:14,代码来源:Archivist.php

示例9: size

 /**
  * {@inheritdoc}
  */
 public function size(Filesystem $filesystem)
 {
     /** @var ReadonlyAdapter $firstAdapter */
     $firstAdapter = $filesystem->getAdapter();
     /** @var ZipArchiveAdapter $adapter */
     $adapter = $firstAdapter->getAdapter();
     return filesize($adapter->getArchive()->filename);
 }
开发者ID:nanbando,项目名称:core,代码行数:11,代码来源:LocalStorage.php

示例10: let

 function let(ZipFilesystemFactory $factory, Filesystem $filesystem, LocalAdapter $adapter, JobRegistry $jobRegistry)
 {
     $filesystem->getAdapter()->willReturn($adapter);
     $adapter->getPathPrefix()->willReturn(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'archivist');
     $this->beConstructedWith($factory, $filesystem, $jobRegistry);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:6,代码来源:ArchivableFileWriterArchiverSpec.php

示例11: getDirectory

 /**
  * @return string
  */
 public function getDirectory()
 {
     /** @var AbstractAdapter $adapter */
     $adapter = $this->filesystem->getAdapter();
     return $adapter->getPathPrefix();
 }
开发者ID:exts,项目名称:configured,代码行数:9,代码来源:PHPLeague.php

示例12: testGetAdapter

 public function testGetAdapter()
 {
     $this->assertEquals($this->adapter, $this->filesystem->getAdapter());
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:4,代码来源:FilesystemTests.php


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