PHP code example of voral / bitrix-module-tool

1. Go to this page and download the library: Download voral/bitrix-module-tool library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

voral / bitrix-module-tool example snippets


use Vasoft\VersionIncrement\Config;
use Vasoft\VersionIncrement\Events\EventType;
use Voral\BitrixModuleTool\ModuleListener;

$config = new Config();

$eventBus = $config->getEventBus();
$listener = new ModuleListener(
    $config,
    'vendor.module',
    

use Vasoft\VersionIncrement\Config;
use Vasoft\VersionIncrement\Events\EventType;
use Voral\BitrixModuleTool\ModuleListener;

$config = new Config();

$eventBus = $config->getEventBus();
$listener = new ModuleListener(
    $config,
    'vendor.module',
    'last_version',
    'marketplace',
    '8.3.0',
    [
        'main' => '24.100.100',
        'sale' => '24.0.100',
    ],
    ['build','docs','test'],
    ['ru','en','fr']
    __DIR__ . '/updates/update_

use Vasoft\VersionIncrement\Config;
use Vasoft\VersionIncrement\Events\EventType;
use Voral\BitrixModuleTool\ModuleListener;
use Voral\BitrixModuleTool\Exception\ExtensionException;

ExtensionException::$errorCodeDelta = 100;
$config = new Config();

$eventBus = $config->getEventBus();
$listener = new ModuleListener($config, 'vendor.module');
$eventBus->addListener(EventType::BEFORE_VERSION_SET, $listener);
// прочие настройки

return $config;


$arModuleVersion = [
    'VERSION' => '1.0.0',
    'VERSION_DATE' => '2023-01-01'
];
bash
php ./vendor/bin/vs-version-increment --no-commit