oktawave/php-ocsclient
Composer 安装命令:
composer require oktawave/php-ocsclient
包简介
PHP library to communicate with Oktawave OCS
README 文档
README
php-ocsclient is a PHP library to communicate with Oktawave OCS.
Installation
Installing via Composer
The recommended way to install OCS Client is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php # Add OCS Client dependency to your project php composer.phar require oktawave/php-ocsclient:*
After installing, you need to require Composer's autoloader:
<?php require_once 'vendor/autoload.php';
Standalone installation
- Download the neweset release
- Include initialization script in your code that loads all required classes
<?php require_once 'path/to/ocs/ocs_init.php';
Usage
For all example cases of using client you should take a look at the example code from examples/OCSClient.php.
Authentication
To use OCS you must authenticate your account.
<?php // Create new OSC Client instance for "somebucket" bucket $OCSClient = new Oktawave_OCS_OCSClient('somebucket'); // Authenticate your OCS user $OCSClient->authenticate('account:user', 'pa$$w0rd');
Objects manipulation
<?php // Upload single object $url = $OCSClient->createObject('/path/to/file.txt', 'destination/path/file.txt'); // Download object $fileContent = $OCSClient->downloadObject('destination/path/file.txt'); // Get a list of all objects $list = $OCSClient->listObjects();
Copyright
Copyright (C) 2014 Oktawave Sp. z o.o. - oktawave.com
Released under GNU General Public License v3.0. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
统计信息
- 总下载量: 14.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2014-08-04