ruckus/ruckusing-migrations — pull request #30 by nuxwin (2012-09-28 01:35:48+00:00)
Title: Composer support

Ok, integration of composer is ready. Also, to make you able to test it, I've registered the package on the [packagist](http://packagist.org/packages/nuxwin/ruckusing-migrations "packagist")
site by using my vendor.

Now let me explain how it work exactly. Let imagine I have a project MyProjet with the following structure:
```
MyProject/
htdocs
library
config
...
```

And then, I want uses your ruckusing library to manage my database migrations.

**Without composer**

To deploy my project with your library, I'll have to fetch it from your repository and push it into my project. So the result of this is that I'll have to maintain your library (updates and so on...) in my own repository... You can surely answer that I can use git submodule feature but think about released versions that are downloadable without dealing with git.

**With composer**

Composer is a package dependencies manager. It allow to declare dependencies (3rd libraries and so on...) and to automatically fetch them when installing the project. In the case of the MyProject , I'll have only to add a root composer.json file that describes its dependencies such as your ruckusing library.

MyProject/composer.json:

```json
{
"name":"nuxwin/my-project",
"description":"A project using composer for dependencies management",
"authors":[
{
"name":"Laurent Declercq",
"email":"l.declercq@nuxwin.com",
"role":"Project lead / Developer"
}
],
"license":"GPL-2.0+",
"minimum-stability": "dev",
"require":{
"PHP":">=5.3.3",
"ruckusing/ruckusing-migrations": "dev-master"
}
}
```

After doing that, To install my project I'll only have to do (for example on Linux):

```
# cd /var/www/
# wget http://download.i-hms.net/MyProject.tar.gz
# tar -xzf MyProject.tar.gz
# cd MyProject
# php composer.phar install
```

And that all. By doing that, all the dependencies will be installed in a subdirectory (vendor by default).

Note: In the above example, I presume that the composer.phar is part of the archive but in most case, you will have to download it before by doing:

```
# curl -s http://getcomposer.org/installer | php
```
or
```
# wget http://getcomposer.org/composer.phar
```

**So what you have to do now?**

1. Merge my pull request
2. Go on the packagist site
3. Register a new account for you own packages
4. Submit your package by entering it url (It's the git url of your repository)
5. Setup packagist git hook to make automatic update of the package when you commit on your repository (all is explained on the packagist site)

---

If you want test with the the package I've pushed on Packagist, you can do (Linux):

```
$ mkdir ~/test-project
$ cd test-project
$ curl -s http://getcomposer.org/installer | php
```

Create a composer.json file in the test-project directory with the following content:
```json
{
"minimum-stability": "dev",
"require":{
"PHP":">=5.3.3",
"nuxwin/ruckusing-migrations": "dev-master"
}
}
```

and then, do:

```
$ php composer.phar install
```

That all.

Thanks for interest.