• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Filesystem\FilesystemManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Illuminate\Filesystem\FilesystemManager的典型用法代码示例。如果您正苦于以下问题:PHP FilesystemManager类的具体用法?PHP FilesystemManager怎么用?PHP FilesystemManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: extend

 /**
  * Register a custom driver creator Closure.
  *
  * @param string $driver
  * @param \Closure $callback
  * @return $this 
  * @static 
  */
 public static function extend($driver, $callback)
 {
     return \Illuminate\Filesystem\FilesystemManager::extend($driver, $callback);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php


示例2: getTimestamp

 /**
  * {@inheritdoc}
  */
 public function getTimestamp($key)
 {
     if ($this->filesystem->exists($key) === false) {
         return 0;
     }
     return $this->filesystem->lastModified($key);
 }
开发者ID:torann,项目名称:snazzy-twig,代码行数:10,代码来源:Filesystem.php


示例3: getUrl

 /**
  * {@inheritdoc}
  */
 public function getUrl()
 {
     if (!$this->isPubliclyAccessible()) {
         throw MediaUrlException::cloudMediaNotPubliclyAccessible($this->media->disk);
     }
     return $this->filesystem->disk($this->media->disk)->url($this->media->getDiskPath());
 }
开发者ID:plank,项目名称:laravel-mediable,代码行数:10,代码来源:S3UrlGenerator.php


示例4: __construct

 public function __construct()
 {
     $this->manager = app('filesystem');
     $this->storage_local = $this->manager->disk('local');
     $this->storage_cloud = $this->manager->disk(config('filesystems.cloud'));
     $this->storage_tmp = $this->manager->disk('tmp');
     $this->setStorage();
 }
开发者ID:bhutanio,项目名称:laravel-utilities,代码行数:8,代码来源:Filer.php


示例5: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle(Config $config, Storage $storage)
 {
     $conn = $config->get('laravel-db-commands.backup_db_conn');
     $db = $config->get("database.connections.{$conn}");
     $dump_dest = $config->get('laravel-db-commands.backup_dump_destination');
     $backup_disk_name = $config->get('laravel-db-commands.backup_disk');
     $backup_disk = $storage->disk($backup_disk_name);
     $backup_name = $db['database'] . '-' . time() . '.sql.gz';
     $tmp_file = "{$dump_dest}/{$backup_name}";
     $this->dumpMysqlDatabase($db, $tmp_file);
     $this->uploadDumpToDisk($backup_disk, $backup_name, $tmp_file);
 }
开发者ID:nobodyiscertain,项目名称:laravel-db-commands,代码行数:17,代码来源:DbBackup.php


示例6: handle

 /**
  * Handle the hook.
  *
  * @param  \Docit\Core\Project $project
  * @return void
  */
 public function handle(Project $project)
 {
     if (!$project->config('enable_filesystem_hook')) {
         $project->setFiles(new LocalFilesystem());
     }
     $disk = $project->config('default_filesystem_disk');
     $settings = $project->config('filesystem_hook_settings');
     if (!isset($settings[$disk])) {
         return;
     }
     $files = $this->fsm->disk($disk);
     if (isset($files)) {
         $project->setFiles($files);
         $project->setPath($project->getName());
     }
 }
开发者ID:docit,项目名称:filesystem-hook,代码行数:22,代码来源:ProjectHook.php


示例7: listFiles

 /**
  * Generate a list of all files in the specified directory.
  * @param  atring  $disk
  * @param  string  $directory
  * @param  bool $recursive
  * @return array
  */
 protected function listFiles($disk, $directory = '', $recursive = true)
 {
     if ($recursive) {
         return $this->filesystem->disk($disk)->allFiles($directory);
     } else {
         return $this->filesystem->disk($disk)->files($directory);
     }
 }
开发者ID:plank,项目名称:laravel-mediable,代码行数:15,代码来源:ImportMediaCommand.php


示例8: move

 /**
  * Move the file to a new location on disk.
  *
  * Will invoke the `save()` method on the model after the associated file has been moved to prevent synchronization errors
  * @param  \Plank\Mediable\Media $media
  * @param  string                $directory directory relative to disk root
  * @param  string                $name      filename. Do not include extension
  * @return void
  * @throws \Plank\Mediable\Exceptions\MediaMoveException If attempting to change the file extension or a file with the same name already exists at the destination
  */
 public function move(Media $media, $directory, $filename = null)
 {
     $storage = $this->filesystem->disk($media->disk);
     if ($filename) {
         $filename = $this->removeExtensionFromFilename($filename, $media->extension);
     } else {
         $filename = $media->filename;
     }
     $directory = trim($directory, '/');
     $target_path = $directory . '/' . $filename . '.' . $media->extension;
     if ($storage->has($target_path)) {
         throw MediaMoveException::destinationExists($target_path);
     }
     $storage->move($media->getDiskPath(), $target_path);
     $media->filename = $filename;
     $media->directory = $directory;
     $media->save();
 }
开发者ID:plank,项目名称:laravel-mediable,代码行数:28,代码来源:MediaMover.php


示例9: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle(Config $config, Storage $storage)
 {
     $conn = $config->get('laravel-db-commands.backup_db_conn');
     $db = $config->get("database.connections.{$conn}");
     $dump_dest = $config->get('laravel-db-commands.backup_dump_destination');
     $backup_disk = $config->get('laravel-db-commands.backup_disk');
     $db_host = $db['host'];
     $db_name = $db['database'];
     $db_user = $db['username'];
     $db_pass = $db['password'];
     $backup_name = $db_name . '-' . time() . '.sql.gz';
     $tmp_file = "{$dump_dest}/{$backup_name}";
     $this->info("Generating Backup File");
     $output = shell_exec("mysqldump -h {$db_host} -u {$db_user} -p{$db_pass} {$db_name} | gzip > {$tmp_file}");
     $this->info($output);
     $this->info("Uploading database to S3");
     $s3 = $storage->disk($backup_disk);
     $s3->put($backup_name, file_get_contents($tmp_file));
 }
开发者ID:EHLOVader,项目名称:laravel-db-commands,代码行数:24,代码来源:DbBackup.php


示例10: createLocalDriver

 public function createLocalDriver(array $config)
 {
     $permissions = isset($config['permissions']) ? $config['permissions'] : [];
     $links = Arr::get($config, 'links') === 'skip' ? DistributedAdapter::SKIP_LINKS : DistributedAdapter::DISALLOW_LINKS;
     if (array_key_exists('distributed', $config)) {
         if ($config['distributed']) {
             return $this->adapt($this->createDistributedFilesystem(new DistributedAdapter($config['root'], LOCK_EX, $links, $permissions), $config));
         }
     }
     return parent::createLocalDriver($config);
 }
开发者ID:garrinar,项目名称:laravel,代码行数:11,代码来源:Manager.php


示例11: exists

 /**
  * {@inheritdoc}
  */
 public function exists($name)
 {
     return $this->filesystem->exists($this->getTemplatePath($name));
 }
开发者ID:torann,项目名称:snazzy-twig,代码行数:7,代码来源:Filesystem.php


示例12: getDisk

 /**
  * returns disk filesystem
  *
  * @param string $name disk name
  * @return \Illuminate\Contracts\Filesystem\Filesystem
  */
 protected function getDisk($name)
 {
     return $this->filesystem->disk($name);
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:10,代码来源:FilesystemHandler.php


示例13: createRackspaceDriver

 /**
  * {@inheritdoc}
  */
 public function createRackspaceDriver(array $config)
 {
     if ($this->skipOverride()) {
         $adapter = parent::createRackspaceDriver($config);
     } else {
         $adapter = $this->adapt($this->createFlysystem(parent::createRackspaceDriver($config)->getAdapter(), $config));
     }
     return $adapter;
 }
开发者ID:danhunsaker,项目名称:laravel-flysystem-service,代码行数:12,代码来源:FlysystemManager.php


示例14: delete

 /**
  * Remover todos os convites.
  * @return bool
  */
 public function delete()
 {
     $this->storage->disk()->deleteDirectory('/invites');
     return true;
 }
开发者ID:bugotech,项目名称:invite,代码行数:9,代码来源:InviteManage.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Foundation\AliasLoader类代码示例发布时间:2022-05-23
下一篇:
PHP Filesystem\Filesystem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap