Recomendation

After Installing Composer In Your Project root, add Parser3 Packages Repository to global Composer config. Run this in your command line:

php composer.phar config --global repositories.parser composer https://pkg.parser.ru

Getting Started

Define Your Dependencies

Put a file named composer.json at the root of your project, containing your project dependencies:

{
    "require": {
        "vendor/package1": "1.3.2",
        "vendor/package2": "1.*",
        "vendor/package3": "^2.0.3",
        "parser/autoload": "^1.0"
    }
}

For more information about packages versions usage, see the composer documentation.

Important:

If you do not added Parser3 Packages Repository to global Composer config, you need add this to your composer.json:

"repositories": [
    {"type": "composer", "url": "https://pkg.parser.ru"}
]

Install Composer In Your Project

Run this in your command line:

curl -sS https://getcomposer.org/installer | php

or

wget -qO- https://getcomposer.org/installer | php

or download composer.phar into your project root.

Install Dependencies

Execute this in your project root.

php composer.phar install

Autoload Dependencies

If your packages specify autoloading information, you can autoload all the dependencies by adding this to your project root auto.p:


@USE
/path/to/vendor/autoload.p
            

Browse the packages we have to find more great libraries you can use in your project.

Publishing Packages

Define Your Package

Put a file named composer.json at the root of your package, containing this information:

{
    "name": "vendor/packagee",
    "description": "A short description of what your package does",
    "require": {
        "another-vendor/package": "1.*"
    },
    "autoload": {
        "psr-4": ["dir"]
    },
    "require-dev": {
        "parser/autoload": "^1.0"
    },
    "repositories": [
        {"type": "composer", "url": "https://pkg.parser.ru"}
    ]
}

This is the strictly minimal information you have to give.

For more details about package naming and the fields you can use to document your package better, see the about page.

Commit The File

You surely don't need help with that.

Publish It

Login or register on this site, then hit the submit button in the menu.

Once you entered your public repository URL in there, your package will be automatically crawled periodically. You just have to make sure you keep the composer.json file up to date.