Use your own PHP library via composer

1. Create your library, with a composer.json as below, and commit it to github (for example,


    "name": "umbalaconmeogia/yii2-batsg"

2. To use yii2-batst in a project (installing via composer), create composer.json as below in the project and run composer install.

composer install


    "repositories": [
            "type": "vcs",
            "url": ""
    "require": {
	    "umbalaconmeogia/yii2-batsg": "dev-master"

Now, your library (yii2-batsg) is used in another project.

3. In the step 2 above, you should add the repository url of yii2-batsg into composer.json. To eliminate this work, publish yii2-batsg to Packagist
Go to . Follow its very simple steps to register your github repository.

4. To update only your library (yii2-batsg) in your project, run composer in your project

composer update umbalaconmeogia/yii2-batsg

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: