PHPackages                             codeinc/object-storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. codeinc/object-storage

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

codeinc/object-storage
======================

Object storage

1.4.0(8y ago)05MITPHPPHP &gt;=7.0

Since Dec 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CodeIncHQ/ObjectStorage)[ Packagist](https://packagist.org/packages/codeinc/object-storage)[ Docs](https://github.com/CodeIncHQ/ObjectStorage)[ RSS](/packages/codeinc-object-storage/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (19)Used By (0)

PHP object storage library
==========================

[](#php-object-storage-library)

This library, written in PHP 7, provides an abstraction layer for various cloud and local object storage plateforms including:

- OpenStack Swift
- BackBlaze B2
- SFTP
- Local file system

Usage
-----

[](#usage)

### Initializing containers

[](#initializing-containers)

```
use CodeInc\ObjectStorage;

// SFTP container with private key authentication
$sftpDirectory = ObjectStorage\Sftp\SftpDirectory::factoryPubKey(
    "/remote/path/to/files",
    "hostname.local",
    "remote-user",
    "path/to/public-key.pub",
    "path/to/private-key",
    "optional-key-passphrase"
    22 // optional port number
);

// SFTP container with user/password authentication
$sftpDirectory = ObjectStorage\Sftp\SftpDirectory::factoryPassword(
    "hostname.local",
    "remote-user",
    "remote-password",
    22 // optional port number
);

// Local file system container
$localDirectory = ObjectStorage\Local\LocalDirectory::factory(
    "/path/to/files"
);

// Swift container
$swiftContainer = ObjectStorage\Swift\SwiftContainer::factory(
    "container-name",
    "container-swift-region",
    "https://open-stack-auth-url.com",
    "open-stack-user",
    "open-stack-password",
    "open-stack-tenant-id",
    "open-stack-tenant-name"
);

// B2 container
$b2Bucket = ObjectStorage\BackBlazeB2\B2Bucket::factory(
    "container-or-bucket-name",
    "b2-account-id",
    "b2-application-key"
);
```

### Creating a file

[](#creating-a-file)

```
use CodeInc\ObjectStorage;

// from an existing file
$object = new ObjectStorage\Utils\InlineObject("test.jpg");
$object->setFileContent("/path/to/test.jpg");

// from a string
$object = new ObjectStorage\Utils\InlineObject("test.txt");
$object->setStringContent("C'est un test au format texte !");
```

### Uploading an object

[](#uploading-an-object)

```
// uploading an object
$container->uploadObject($object, 'optional-new-object-name.txt');

// transfering an object from a container to another
$destinationContainer->uploadObject(
    $sourceContainer->getObject('test.jpg')
);
```

### Listing objects

[](#listing-objects)

```
foreach ($container as $file) {
    var_dump($file->getName());
}
```

`$file` is an object implementing the interface `StoreObjectInterface`.

### Getting an object

[](#getting-an-object)

```
header('Content-Type: image/jpeg');
echo $container->getObject('test.jpg')->getContent();
```

`getObject()` returns an object implementing the interface `StoreObjectInterface`.

### Deleting an object

[](#deleting-an-object)

```
// from a container
$container->deleteObject("test.jpg");

// from an object
$object = $container->getObject('test.jpg');
if ($object instanceof StoreObjectDeleteInterface) {
    $object->delete();
}
```

For objects implementing the `StoreObjectDeleteInterface` you can call the `delete()` method directory on the object.

Installation
------------

[](#installation)

This library is available through [Packagist](https://packagist.org/packages/codeinc/object-storage) and can be installed using [Composer](https://getcomposer.org/):

```
composer require codeinc/object-storage
```

License
-------

[](#license)

The library is published under the MIT license (see [`LICENSE`](LICENSE) file).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity67

Established project with proven stability

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 ~5 days

Recently: every ~20 days

Total

18

Last Release

3031d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce6d7fd91f537008e6af8eef5f5529e994cf74be8d78ee7b9d9ecac476ba1444?d=identicon)[joanfabregat](/maintainers/joanfabregat)

![](https://www.gravatar.com/avatar/8f72f949d7f70e400c02c225685f1934dec6219689f25edec38b4037df166d58?d=identicon)[codeinc](/maintainers/codeinc)

### Embed Badge

![Health badge](/badges/codeinc-object-storage/health.svg)

```
[![Health](https://phpackages.com/badges/codeinc-object-storage/health.svg)](https://phpackages.com/packages/codeinc-object-storage)
```

###  Alternatives

[league/flysystem-rackspace

Flysystem adapter for Rackspace

382.3M31](/packages/league-flysystem-rackspace)

PHPackages © 2026

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