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:
- Download the SDK files
- Extract them to your project directory
- 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:
- Getting Started - Learn how to initialize and use the SDK
- Authentication - Set up player authentication
- 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 installorcomposer update
"Package not found" error
- Verify your internet connection
- Check if you have access to the Moitribe repository
- Ensure your
composer.jsonis 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:
- Check the Error Handling Guide
- Verify your PHP version meets the requirements
- Ensure Composer is properly installed and updated
- Contact Moitribe support for repository access issues