承接 artemeon/stream-context 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

artemeon/stream-context

最新稳定版本:1.0.1

Composer 安装命令:

composer require artemeon/stream-context

包简介

Library to create a stream context

README 文档

README

PHP-Interface for the internal PHP stream context's

Description

Contains several PHP stream context objects to provide an easier interface for the internal wrapper based PHP contexts options. Provides a FileStream configuration object, this allows us to transparent change the streams without to change the client class.

Getting Started

Dependencies

  • We use the https://phpseclib.com/ to user SFTP based on custom StreamWrapper provided by this library.
  • In most PHP distributions SFTP support is not compiles in.

Installing

"require": { "artemeon/stream-context": "^0.1.0" } 

Usage

Basic usage wit all PHP stream aware functions

$directory = dir("sftp://ftp.example.com/file.txt", SftpStreamContext::forPasswordAuthentication('password', 'user')->createStreamContext()); 

Usage with the FileObjectFactory and the FileStream object

$fileObject = FileObjectFactory::create(FileStream::fromUrl('sftp://test.de/basefolder', SftpStreamContext::forPrivateKeyAuthentication('Aefs566456DG_fgdf'))); $fileObject = FileObjectFactory::create(FileStream::fromUrl('http://test.de/basefolder', HttpStreamContext::forPostUrlencoded(['type' => 'internal']))); 

Set several Context and FileStream options

$httpContext = HttpStreamContext::forGet(); $httpContext->setTimeout(5.0); $fileStream = FileStream::fromUrl('http://test.de/basefolder/import.csv', $httpContext); $fileStream->setMode('r+'); $fileStream->enforceFileExtension('csv'); $file = FileObjectFactory::create($fileStream); 

Version History

  • 0.1.0 Initial release

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 62.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固