glibe/storageconnect-ovh
Composer 安装命令:
composer require glibe/storageconnect-ovh
包简介
Librairie pour interagir avec un object storage. Utilise l'api swift avec authentification v2 pour fonctionner avec OVH
README 文档
README
Install
composer require glibe/storageconnect-ovh
Utilisation
Les éléments de connexion à openstack sont obligatoires. Les élèments de connexion à l'API d'OVH sont optionnels. Ils sont utilisés uniquement dans le cas d'une création de container.
La création des credentials pour utiliser l'api d'ovh se fait à cette url : https://api.ovh.com/createToken/index.cgi?GET=/&PUT=/&POST=/&DELETE=/
La librairie utilise l'authentification v3 d'openstack.
$credentials = [ 'authUrl' => "https://auth.cloud.ovh.net/v3", 'region' => "GRA", 'username' => "your-username", 'password' => "your-password", 'tenantName' => "your-tenant-name", ]; $ovhCredentials = [ 'application_key' => "XXXXXXXX", 'application_secret' => "XXXXXXXX", 'api_endpoint' => "XXXXXXXX", // ovh-eu for europe 'consumer_key' => "XXXXXXXX" ]; $obj = new Glibe\StorageConnetOvh($credentials,$ovhCredentials);
Récupération infos d'une ressource
$obj->getObject('<container-name>','<object-name>');
Création d'une ressource
$obj->createObject('<container-name>','<object-name>','<path-to-the-new-file>','<folder-base>);
Exemple
Pour créer un fichier qui aura pour référence /img/png/hello.png dans le container "cdn", la commande de création sera la suivante :
$obj->createObject('cdn','hello.png','<path-to-the-new-file>','img/png');
Création d'une container
####### Statut possible : public / private
En public cela fait container un hébergement statique. Les ressources seront alors accessiblent par une url publique. (Voir site ovh pour plus d'explication.) Par défaut le statut est à private.
####### Ovh project ID L'identifiant unique de votre projet public cloud chez OVH. Disponible sous le nom de votre proejt dans votre interface client. Si non définit, le premier projet disponible sera utilisé.
$obj->createContainer('<container-name>','<statut> (default: private)','<ovh_project_id> (default: first available)');
Exemple
$obj->createContainer('testContainer','public','90b0b09604e74e4e8ade65xxxxxxxxx');
Accès à un container
Renvoie une instance du container souhaité
$obj->getContainer('<container-name>');
Supprimer un objet
$obj->deleteObject('<container-name>','<filename>');
Exemple
Pour supprimer le fichier /img/png/hello.png dans le container "cdn", la commande de suppression sera la suivante :
$obj->deleteObject('cdn','/img/png/hello.png');
glibe/storageconnect-ovh 适用场景与选型建议
glibe/storageconnect-ovh 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.24k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 06 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Openstack」 「swift」 「object storage」 「ovh」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 glibe/storageconnect-ovh 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 glibe/storageconnect-ovh 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 glibe/storageconnect-ovh 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
An HTTP client with automatic authentication for an OpenStack Identity Service API a.k.a. Keystone
Rackspace package containing Rackspace/OpenStack components for the DreamFactory(tm) core.
Parse a generic mail stream, and convert it to a SwiftMailer Message
Runn Me! Value Objects Library
The port of python-cloudfiles library to work with OpenStack Object Storage
统计信息
- 总下载量: 1.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-13