承接 osw3/php-cloud-manager 相关项目开发

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

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

osw3/php-cloud-manager

Composer 安装命令:

composer require osw3/php-cloud-manager

包简介

Provides cloud connection and file manipulation tools.

README 文档

README

Provides cloud connection and file manipulation tools.

How to install

composer require osw3/php-cloud-manager

Supported services

How to use

Create new connection

Prepare the DSN

$dsn = "{$driver}://{$user}:{$pass}@{$host}";

Client instance

use OSW3\CloudManager\Client;
$client = new Client($dsn);
Don't auto connect
$client = new Client($dsn, false);
$client->connect();

DSN Infos

  • dsn(): DsnService

    Bridge to DsnService.

    $client->dsn()->getDriver(); // ftp
  • getDriver(): ?string

    $client->dsn()->getDriver(); // ftp
  • getHost(): ?string

    $client->dsn()->getHost(); // site.com
  • getUser(): ?string

    $client->dsn()->getUser(); // user
  • getPass(): ?string

    $client->dsn()->getPass(); // pass
  • getAuth(): ?int

    Get the Auth mode

    $client->dsn()->getAuth();
  • getToken(): ?int

    $client->dsn()->getToken();
  • getPort(): ?int

    $client->dsn()->getPort(); // 21
  • get(): ?string

    Get the DSN string

    $client->dsn()->get(); // ftp://user:pass@site.com";

Driver Statement

  • connect(): bool

    Proceed to driver connection and return the connection state

    $client->connect();
  • disconnect(): bool

    Proceed to disconnection and return the connection status

    $client->disconnect();
  • isConnected(): bool

    return true when the driver is connected

    $client->isConnected();

Temp directory

  • setTempDirectory(string $directory): static

    Set the local server Temp directory for file manipulation.

    $client->setTempDirectory("my/temp/dir");
  • getTempDirectory(): string

    Get the local server Temp directory for file manipulation.

    $client->getTempDirectory();

Navigation

  • location(): string

    Return the current location (like PWD)

    $client->location();
  • navigateTo(string $folder): bool

    Set the pointer to a specific folder.

    $client->navigateTo("/www");
  • parent(): bool

    Set the pointer to a parent folder.

    $client->parent();
  • root(): bool

    Set the pointer to the root of the driver.

    $client->root();

Entry infos

  • infos(?string $path=null, ?string $part=null): array|string

    Retrieve the entry infos. Return an array if $part is null.

    $client->infos("/www/my-dir"); // [...]
    $client->infos("/www/my-dir", "type"); // folder
  • isFolder(string $path): bool

    True if $path is a folder type.

    $client->isFolder("/www/my-dir");
  • isDirectory(string $path): bool

    An alias of isFolder

    $client->isDirectory("/www/my-dir");
  • isFile(string $path): bool

    True if $path is a file type.

    $client->isFile("/www/my-dir");
  • isLink(string $path): bool

    True if $path is a link type.

    $client->isLink("/www/my-dir");
  • isBlock(string $path): bool

    True if $path is a block type

    $client->isBlock("/www/my-dir");
  • isCharacter(string $path): bool

    True if $path is a character type.

    $client->isCharacter("/www/my-dir");
  • isSocket(string $path): bool

    True if $path is a socket type.

    $client->isSocket("/www/my-dir");
  • isPipe(string $path): bool

    True if $path is a pipe type.

    $client->isPipe("/www/my-dir");

Permissions

  • permissions(string $path, ?int $code=null): string|bool

    Permissions getter and setter. Set permission to path if $code is not null. Get permission code if $code is null

    $client->permissions("/www/my-dir", 0777); // true
    $client->permissions("/www/my-dir"); // 0777
  • setPermission(string $path, int $code): bool

    Set permissions code to a $path

    $client->setPermission("/www/my-dir", 0777);
  • getPermission(string $path): string

    Read permissions code from a $path

    $client->getPermission("/www/my-dir"); // 0777

Folder API

  • browse(?string $directory=null): array

    Return the content of a directory, like the Unix PWD command. Return the current pointer location content if the $directory parameter is null.

    $client->browse("/www/my-dir"); // [...]
  • createFolder(string $directory, int $permissions=0700, bool $navigateTo = true): bool

    Create a directory and set the pointer into the new location id $navigateTo is true.

    $client->createFolder("/www/my-dir/my-sub-dir");
  • deleteFolder(?string $directory, bool $recursive=true): bool

    Delete a directory and its contains.

    $client->deleteFolder("/www/my-dir/my-sub-dir");
  • duplicateFolder(string $source, string $destination): bool

    Duplicate a directory on the Client

    $client->duplicateFolder("/www/my-dir", "/www/my-other-dirt");
  • copyFolder(string $source, string $destination): bool

    Alias for duplicateFolder.

  • moveFolder(string $source, string $destination, bool $override=false): bool

    Move a folder (cut + paste)

    $client->moveFolder("C://my-dir", "/www/my-dir");
  • uploadFolder(string $source, string $destination, bool $override=false): bool

    Send a directory from your server to the remote Client

    $client->uploadFolder("C://my-dir", "/www/my-dir");
  • downloadFolder(string $source, string $destination, bool $override=false): bool

    Get a directory from a Client to your server

    $client->downloadFolder("/www/my-dir", "C://my-dir");

Files API

  • createFile(string $filename, string $content="", bool $binary=false): bool

    Create a file from Stream to the Client.

    $client->createFile("/www/my-dir/my-file.txt", "Hi!\This is my file.");
  • deleteFile(?string $filename): bool

    Delete a file from a Client.

    $client->deleteFile("/www/my-dir/my-file.txt");
  • duplicateFile(string $source, string $destination): bool

    Duplicate a file on the Client

    $client->duplicateFile("/www/my-dir/my-file.txt", "/www/my-other-dir/my-file.txt");
  • copyFile(string $source, string $destination): bool

    Alias for duplicateFile.

  • moveFile(string $source, string $destination, bool $override=false): bool

    Move a file

    $client->moveFile("C://my-dir/my-file.txt", "/www/my-dir/my-file.txt");
  • uploadFile(string $source, string $destination, bool $override=false): bool

    Send a file from your server to the remote Client

    $client->uploadFile("C://my-dir/my-file.txt", "/www/my-dir/my-file.txt");
  • downloadFile(string $source, string $destination, bool $override=false): bool

    Get a file from a Client to your server

    $client->downloadFile("/www/my-dir/my-file.txt", "C://my-dir/my-file.txt");

Folder & Files API (Hybrid aliases of previous API)

  • delete(?string $path, bool $recursive=true): bool;

    Delete a directory or a file

    $client->delete("/www/my-dir/my-file.txt");
    $client->delete("/www/my-dir");
  • duplicate(string $source, string $destination): bool;

    Duplicate a directory or a file

    $client->duplicate("/www/my-dir/my-file.txt", "/www/my-sub-dir/my-file.txt");
    $client->duplicate("/www/my-dir", "/www/my-sub-dir");
  • copy(string $source, string $destination): bool;

    Alias of duplicate

  • move(string $source, string $destination): bool;

    Duplicate a directory or a file and delete the $source.

    $client->move("/www/my-dir/my-file.txt", "/www/my-sub-dir/my-file.txt");
    $client->move("/www/my-dir", "/www/my-sub-dir");
  • rename(string $source, string $destination): bool;

    Alias of move

  • upload(string $source, string $destination, bool $override=false): bool;

    Send a directory or a file from your server to the Client

    $client->upload("C://my-dir", "/www/my-dir");
    $client->upload("C://my-dir/my-file.txt", "/www/my-dir/my-file.txt");
  • download(string $source, string $destination, bool $override=false): bool;

    Get a directory or a file from the Client to your server

    $client->download("/www/my-dir", "C://my-dir");
    $client->download("/www/my-dir/my-file.txt", "C://my-dir/my-file.txt");

osw3/php-cloud-manager 适用场景与选型建议

osw3/php-cloud-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 osw3/php-cloud-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 osw3/php-cloud-manager 我们能提供哪些服务?
定制开发 / 二次开发

基于 osw3/php-cloud-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-18