[Request] Make MPWS-SDK ready for Composer

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

Post Reply
User avatar
m4rcel
Posts: 650
Joined: 15 Jun 2010, 11:12
Contact:

[Request] Make MPWS-SDK ready for Composer

Post by m4rcel »

Today I have a little request for the MPWS repository: Please make it ready to be used with Composer.

Composer is a very nice tool to resolve the dependencies of a project. You write down the packages you need (and the version, if you need a specific one), and the tool will automatically download and save all the files to your project. Additionally, an autoload.php file is generated to include all downloaded packages, so no need to e.g. load the MPWS-autoloader and TMWS-autoloader separately.

To make the repository ready for composer, only two steps are needed:

1. Add a composer.json to the root of your trunk:

The composer.json may look like the following:

Code: Select all

{
    "name": "nadeo/maniaplanet-ws-sdk",
    "description": "The Maniaplanet Web Services is the public API that everyone can use to retrieve various information about the game, the players, the rankings, etc. You can use that API to build all sorts of applications. ",
    "type": "library",
    "keywords": ["nadeo", "webservices", "sdk", "php"],
    "license": "LGPL-3.0",
    "authors": [
        {
            "name": "magnetik",
            "email": "magnetik@nadeo.com",
            "homepage": "http://www.maniaplanet.com/",
            "role": "Developer"
        },
        {
            "name": "gouxim",
            "email": "gouxim@nadeo.com",
            "homepage": "http://www.maniaplanet.com/",
            "role": "Developer"
        }
    ],
    "require": {
        "php": ">=5.3.0"
    },
    "autoload": {
        "psr-0": {
            "Maniaplanet\\": "libraries/"
        }
    }
}
I am not sure about the developers actually involved in the MPWS-SDK, so you may want to change that part of the json file.

As said, simply commit this file to your /trunk directory.

2. Add the package to Packagist:
After comitting the composer.json to the trunk, go to the website https://packagist.org/ (create an account if not already done) and submit the MPWS-SDK as a new package to this site. Packagist should automatically detect the versions of the SDK based on the tags.


There is already a copy of the MPWS-SDK registered in Packagist, but I would like to see the official repository in there ;) And if you made the MPWS SDK ready for composer, please continue with the TMWS SDK, ManiaLib and all your other projects :D
ImageImage
Image
User avatar
Jojo_44
Posts: 485
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: [Request] Make MPWS-SDK ready for Composer

Post by Jojo_44 »

+1

A lot of big php projects/frameworks are already using composer + packagist so it´s kinda standard. Btw github supports packagist so you can create a hook that everytime you push to github, packagist gets automatically updated.

regards, Jojo
Image
my english sounds very unfriendly but it isn´t ;)
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Request] Make MPWS-SDK ready for Composer

Post by oliverde8 »

This would be great, :thumbsup:
After getting used to it it is just fantastic how easy things can get when using composer.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
magnetik
Posts: 1673
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: [Request] Make MPWS-SDK ready for Composer

Post by magnetik »

ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
User avatar
Jojo_44
Posts: 485
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: [Request] Make MPWS-SDK ready for Composer

Post by Jojo_44 »

Good job :thx:
Image
my english sounds very unfriendly but it isn´t ;)
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 0 guests