PHPackages                             micjohnson/weed-php-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. micjohnson/weed-php-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

micjohnson/weed-php-bundle
==========================

Weed-FS integration for your Symfony 2 application using WeedPhp

1271PHP

Since Jan 12Pushed 13y ago1 watchersCompare

[ Source](https://github.com/micjohnson/weed-php-bundle)[ Packagist](https://packagist.org/packages/micjohnson/weed-php-bundle)[ RSS](/packages/micjohnson-weed-php-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

weed-php-bundle
===============

[](#weed-php-bundle)

[Weed-FS](http://code.google.com/p/weed-fs/) integration for your Symfony 2 application using [WeedPhp](https://github.com/micjohnson/weed-php)

About Weed-FS
=============

[](#about-weed-fs)

Weed-FS Homepage: [weedfs](http://code.google.com/p/weed-fs/)

Weed-FS is a simple and highly scalable distributed file system. There are two objectives:

1. to store billions of files!
2. to serve the files fast!

Instead of supporting full POSIX file system semantics, Weed-FS choose to implement only a key~file mapping. Similar to the word "NoSQL", you can call it as "NoFS".

Instead of managing all file metadata in a central master, Weed-FS choose to manages file volumes in the central master, and let volume servers manage files and the metadata. This relieves concurrency pressure from the central master and spreads file metadata into volume servers' memories, allowing faster file access with just one disk read operation!

Weed-FS models after Facebook's [Haystack design paper.](http://www.usenix.org/event/osdi10/tech/full_papers/Beaver.pdf)

Weed-FS costs only 40 bytes disk storage for each file's metadata. It is so simple with O(1) disk read that you are welcome to challenge the performance with your actual use cases.

Testing
=======

[](#testing)

TODO

Status
======

[](#status)

Ready for testing / in development

Documentation
=============

[](#documentation)

This bundle is meant to be tested only, it will be updated rapidly.

This guide assumes:

- You have Weed-FS 0.26+ master/volume(s) running (link above)
- You are using Doctrine

### Step 1: Install using composer

[](#step-1-install-using-composer)

Add to your composer.json

```
"require": {
    "micjohnson/weed-php-bundle": "dev-master"
}

```

Install through composer.phar

```
php composer.phar update micjohnson/weed-php-bundle

```

### Step 2: Add to AppKernel.php

[](#step-2-add-to-appkernelphp)

Enable the bundle in the kernel

```
    public function registerBundles()
    {
        $bundles = array(
            // ...
			new Micjohnson\WeedPhpBundle\MicjohnsonWeedPhpBundle(),
        );
    }

```

### Step 3: Configure the address and port of your master weed-fs server

[](#step-3-configure-the-address-and-port-of-your-master-weed-fs-server)

Note: This defaults to localhost:9333, you only need to override it if its not default.

```
// app/config/parameters.yml
parameters:
    weed_php.master.address: "localhost:9333"

```

### Step 4: Extend the base Image Entity

[](#step-4-extend-the-base-image-entity)

If you are doing images, you might want a single table for all files

```
