A set of classes for easy operation. With the database and Bitrix settings.In case the bitrix code does not work for you =) See the examples in the file. See the readme.md file for examples.

01.00.07 2018-10-09 13:52 UTC

This package is auto-updated.

Last update: 2020-02-09 18:49:45 UTC


Current Package. This is a set of classes that realizes an alternative to standard work.


Composer (recommended)

Use Composer to install this library from Packagist: f00x/anti-bitrix

Run the following command from your project directory to add the dependency:

composer require f00x/anti-bitrix 

Alternatively, add the dependency directly to your composer.json file:

"require": {

Example use.

use f00x\AntiBitrix;
require_once '\\vendor\\autoload.php';
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
$settingsBitrix = require( dirname($_SERVER["DOCUMENT_ROOT"]) . "/bitrix/.settings.php" );
    /* Other bitrix param bitrix/.settings.php */
    'connections' =>
        'value' =>
            'default' =>
                'className' => '\\Bitrix\\Main\\DB\\MysqliConnection',
                'host' => 'hostDB',
                'database' => 'test',
                'login' => 'root',
                'password' => 'password',
                'options' => 2.0,
        'readonly' => true,
    'anti_bitrix' => [
        'smtp' => [
            'host' => 'smtp.example.com',
            'port' => '465',
            'username' => 'from',
            'password' => 'password',
            'encryption' => 'ssl',
            'is_ntlm' => false,
            'from' => 'from@example.com'

$ConfigManager = new AntiBitrix\ConfigManager($settingsBitrix);
$Proxy = new AntiBitrix\ProxyForm($ConfigManager);

$FormManager = new AntiBitrix\FormManager($ConfigManager->getMysqlPDOConnect());
// 1 - id form in bitrix admin
$Form = $FormManager->getFormObject('1');
if ($Form instanceof Form) {

Learn about the successful completion of the form and CAPTCHA can be so.

// 1 - id form in bitrix admin
{/* print message and other */

Send Email

basic use case

This package also allows -Create letters by template. -To do dispatch on data and object of dispatch

$SendManager = new SmtpMessageManager($ConfigManager->getMysqlPDOConnect());

"Template" and "Sending" are taken from the database based on the key (table b_form column MAIL_EVENT_TYPE)

Step cofig bitrix form send email

  1. create form and fill "Event IDs:"->"event1:" (table b_form column MAIL_EVENT_TYPE)
  2. create "Email event types" item (set MAIL_EVENT_TYPE value)
  3. create "E-Mail templates" item
  4. create "Newsletter categories" item

Custom use

Create custom class by "MessageManagerInterface" A basic example in the source code of a class "SmtpMessageManager"