Skip to main content

Installation

This guide will help you install the Moitribe PHP SDK in your project using Composer.

Requirements

  • PHP 7.2 or higher (compatible with PHP 8.x)
  • Composer (latest version recommended)
  • Valid Moitribe Game ID and Channel ID

Installation via Composer

1. Add the SDK to your project

Run the following command in your project directory:

composer require veniso/moitribe-sdk

2. Include the autoloader

Add the following line to your application's entry point:

require_once 'vendor/autoload.php';

3. Configure Composer (if needed)

If you're using a custom Composer repository, make sure your composer.json includes the Moitribe repository:

{
"repositories": [
{
"type": "composer",
"url": "https://svn.devnik.veniso.net/openRepo"
}
],
"require": {
"veniso/moitribe-sdk": "^0.1"
}
}

Manual Installation

If you prefer not to use Composer, you can manually include the SDK:

  1. Download the SDK files
  2. Extract them to your project directory
  3. Include the main SDK file in your application:
require_once 'path/to/moitribe-sdk/modules/classes/MoitribeApi.php';

Verification

To verify the installation, create a simple test script:

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

use Veniso\Moitribe\Sdk\modules\classes\MoitribeApi;

try {
// This will throw an exception if the SDK is not properly installed
$reflection = new ReflectionClass('Veniso\Moitribe\Sdk\modules\classes\MoitribeApi');
echo "Moitribe SDK installed successfully!\n";
echo "Version: " . MoitribeApi::class . "\n";
} catch (Exception $e) {
echo "Installation failed: " . $e->getMessage() . "\n";
}

Next Steps

After successful installation:

  1. Getting Started - Learn how to initialize and use the SDK
  2. Authentication - Set up player authentication
  3. Tournaments - Implement tournament features

Troubleshooting

Common Issues

"Class not found" error

  • Ensure you've included the Composer autoloader
  • Check that the vendor directory exists
  • Run composer install or composer update

"Package not found" error

  • Verify your internet connection
  • Check if you have access to the Moitribe repository
  • Ensure your composer.json is correctly configured

Permission issues

  • Make sure your web server can access the vendor directory
  • Check file permissions in your project directory

Getting Help

If you encounter issues during installation:

  1. Check the Error Handling Guide
  2. Verify your PHP version meets the requirements
  3. Ensure Composer is properly installed and updated
  4. Contact Moitribe support for repository access issues