PHPackages                             nao-pon/copy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nao-pon/copy

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nao-pon/copy
============

Copy PHP library

1.1.5(11y ago)056MITPHPPHP &gt;=5.3.0

Since Jan 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nao-pon/php-client-library)[ Packagist](https://packagist.org/packages/nao-pon/copy)[ Docs](https://github.com/copy-app/php-client-library)[ RSS](/packages/nao-pon-copy/feed)WikiDiscussions pilot Synced 1mo ago

READMEChangelogDependencies (4)Versions (19)Used By (0)

Copy PHP API
============

[](#copy-php-api)

[![Build Status](https://camo.githubusercontent.com/d2e566f0d5e21308b2fce23e09ff858fb5d5292f42563d5cddafed0f9e97d509/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f70792d6170702f7068702d636c69656e742d6c6962726172792f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/copy-app/php-client-library/build-status/master)[![Latest Stable Version](https://camo.githubusercontent.com/6e5051068f1326a25a63851af5a498091d2dd76dd272b65bb4e64c5c57564cab/68747470733a2f2f706f7365722e707567782e6f72672f6261727261637564612f636f70792f762f737461626c652e737667)](https://packagist.org/packages/barracuda/copy)[![Total Downloads](https://camo.githubusercontent.com/a4a3d40febb141801fb41838b0b2f07631cec593b0377b4bf60c2e6e2f5638b7/68747470733a2f2f706f7365722e707567782e6f72672f6261727261637564612f636f70792f646f776e6c6f6164732e737667)](https://packagist.org/packages/barracuda/copy)[![License](https://camo.githubusercontent.com/add66c9544087b82ba8ba4ad80acd71f833ad5301406f6020d292db0c6822f4d/68747470733a2f2f706f7365722e707567782e6f72672f6261727261637564612f636f70792f6c6963656e73652e737667)](https://packagist.org/packages/barracuda/copy)[![Code Coverage](https://camo.githubusercontent.com/f4a3a7ac08a686c8103de04dde37524871a850ffb64f7dfda885732e4d462efe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f70792d6170702f7068702d636c69656e742d6c6962726172792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/copy-app/php-client-library/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a88dd4c43312e70ec4c9ae90b51e36634ef6adfa954604da6135042464127f51/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f70792d6170702f7068702d636c69656e742d6c6962726172792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/copy-app/php-client-library/?branch=master)

A php library for communicating with the copy cloud api

This library demos the binary part api, an efficient way to de-dupe and send/receive data with the Copy cloud, and the JSONRPC api used by the Copy agent, and Copy mobile devices, for doing advanced things with Copy.

This demo works with the OAUTH api, which you will need to setup at the Copy developer portal ().

Please check out our [changelog](https://github.com/copy-app/php-client-library/wiki/ChangeLog) to see what has changed between versions.

### The Basics

[](#the-basics)

Connect to the cloud
--------------------

[](#connect-to-the-cloud)

```
// create a cloud api connection to Copy
$copy = new \Barracuda\Copy\API($consumerKey, $consumerSecret, $accessToken, $tokenSecret);
```

List items
----------

[](#list-items)

```
// list items in the root
$items = $copy->listPath('/');
```

Uploading a file
----------------

[](#uploading-a-file)

```
// open a file to upload
$fh = fopen('/tmp/file', 'rb');

// upload the file in 1MB chunks
$parts = array();
while ($data = fread($fh, 1024 * 1024)) {
    $part = $copy->sendData($data);
    array_push($parts, $part);
}

// close the file
fclose($fh);

// finalize the file
$copy->createFile('/copy-file-path', $parts);
```

Downloading a file
------------------

[](#downloading-a-file)

```
// obtain a list of files and parts
$files = $copy->listPath('/copy-file-path', array("include_parts" => true));

// process each file
foreach ($files as $file) {
	$data = '';

	// enumerate the parts in the latest revision
    foreach ($file->revisions[0]->parts as $part) {
        $data .= $copy->getPart($part->fingerprint, $part->size);
    }
}
```

Delete a file
-------------

[](#delete-a-file)

```
$copy->removeFile('/copy-file-path');
```

Rename an object
----------------

[](#rename-an-object)

```
$copy->rename('/source-copy-file-path', '/destination-copy-file-path');
```

### Installing via Composer

[](#installing-via-composer)

The recommended way to install the Copy PHP API is through [Composer](http://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php

# Add Copy API as a dependency
php composer.phar require barracuda/copy
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

### Running the tests

[](#running-the-tests)

First install the dependencies for the library using Composer. See above for how to install Composer.

```
composer install
```

Then add connection info for your Copy account as environment variables:

```
export CONSUMER_KEY=
export CONSUMER_SECRET=
export ACCESS_TOKEN=
export ACCESS_TOKEN_SECRET=
```

### License

[](#license)

This library is MIT licensed, so feel free to use it anyway you see fit.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 65.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~46 days

Total

8

Last Release

4092d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94d2c640ddb10d36693b1bb9a24f91cd77a8efe98ff144c09bc5ecadfa606f12?d=identicon)[nao-pon](/maintainers/nao-pon)

---

Top Contributors

[![ablyler](https://avatars.githubusercontent.com/u/137642?v=4)](https://github.com/ablyler "ablyler (61 commits)")[![nao-pon](https://avatars.githubusercontent.com/u/1412630?v=4)](https://github.com/nao-pon "nao-pon (21 commits)")[![hasinhayder](https://avatars.githubusercontent.com/u/490779?v=4)](https://github.com/hasinhayder "hasinhayder (5 commits)")[![dangerbell](https://avatars.githubusercontent.com/u/241762?v=4)](https://github.com/dangerbell "dangerbell (2 commits)")[![sebastianfeldmann](https://avatars.githubusercontent.com/u/9250358?v=4)](https://github.com/sebastianfeldmann "sebastianfeldmann (2 commits)")[![dbergey](https://avatars.githubusercontent.com/u/14341?v=4)](https://github.com/dbergey "dbergey (1 commits)")[![marphi](https://avatars.githubusercontent.com/u/57309?v=4)](https://github.com/marphi "marphi (1 commits)")

---

Tags

copy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nao-pon-copy/health.svg)

```
[![Health](https://phpackages.com/badges/nao-pon-copy/health.svg)](https://phpackages.com/packages/nao-pon-copy)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[unisolutions/silverstripe-copybutton

Adds copy button to the GridField.

1736.4k](/packages/unisolutions-silverstripe-copybutton)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
