egnyte-php/egnyte
Composer 安装命令:
composer require egnyte-php/egnyte
包简介
Manage Egnyte uploads with the Egnyte public API
README 文档
README
Egnyte PHP Client
Updates
- moved to EgnytePhp namespace
- added linting
- php 8.0+
- @todo Chunked Upload
- @todo TestCases
Prelim
-
Sign up for a developer key at (develpers.egnyte.com)[https://develpers.egnyte.com]
-
Key should be "internal app"
-
provide the API Subdomain of your egnyte account
-
-
Make sure you have credentials for the web UI. This login is called the "resource owner" credentials.
-
Wait for your API key to be approved (usually less than 24 hours).
Important: It's important at this point to have the following values:
$key = API Key
$secret = API Secret
$username = Resource Owner Username
$password = Resource Owner Password
Usage
$api_subdomain = 'something-something'; // ==> becomes something-something.egnyte.com $oauth = new \Oauth($key, $secret, OAUTH_SIG_METHOD_HMACSHA256, OAUTH_AUTH_TYPE_FORM); $tokenArray = $oauth->getRequestToken($api_subdomain ".egnyte.com/puboauth/token", [ "username" => $username, "password" => $password, "grant_type" => "password" ]); $client = new \EgnytePhp\Egnyte\Client( $api_subdomain, $tokenArray['access_token']); $fileClient = new \EgnytePhp\Egnyte\Model\File( $client ); // OR $fileClient = new \EgnytePhp\Egnyte\Model\File( null, 'domain', 'oauth token' ); $response = $fileClient->upload('/Shared/Documents/test.txt', 'test file upload' );
统计信息
- 总下载量: 415
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-22