Link Search Menu Expand Document

Installation

There are various ways to install MadelineProto:

Simple

<?php
if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
require_once 'madeline.php';

This code will automatically download, auto-update and include MadelineProto.

Warning: NEVER use this install method in production.
The madeline.php install script is as an alpha/beta-level distribution channel for MadelineProto with frequent breaking changes distributed with automatic updates.
If you require a stable, semantically versioned install of MadelineProto with no automatic updates, please install MadelineProto using composer ».

For this reason, madeline.php is not compatible with pre-existing composer installs, please install MadelineProto using composer if you already have a composer project.

Phar file

Head over to the GitHub releases section and download the madeline81.phar from the latest release, and include it in your project:

require_once 'madeline81.phar';

Warning: madeline81.phar is not compatible with pre-existing composer installs, please install MadelineProto using composer if you already have a composer project.

Composer from existing project

Simply require the package (composer v2+ is required):

composer require "danog/madelineproto:^8"

Composer from scratch

composer.json:

{
    "name": "yourname/yourproject",
    "description": "Project description",
    "type": "project",
    "require": {
        "danog/madelineproto": "^8"
    },
    "license": "AGPL-3.0-only",
    "authors": [
        {
            "name": "Daniil Gentili",
            "email": "daniil@daniil.it"
        }
    ],
    "autoload": {
        "psr-0": {
            "Your\\Project\\": "src/"
        }
    }
}

Then run (composer v2+ is required):

composer update

Put the following code in your PHP file:

<?php
require_once 'vendor/autoload.php';

Next section