承接 f00x/anti-bitrix 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

f00x/anti-bitrix

Composer 安装命令:

composer require f00x/anti-bitrix

包简介

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.

README 文档

README

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

Installation

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": {
    "f00x/anti-bitrix":""
}

Example use.

use f00x\AntiBitrix;
require_once '\\vendor\\autoload.php';
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
/**
$settingsBitrix = require( dirname($_SERVER["DOCUMENT_ROOT"]) . "/bitrix/.settings.php" );
*/
$settingsBitrix=array(
    /* Other bitrix param bitrix/.settings.php */
    'connections' =>
    array(
        'value' =>
        array(
            'default' =>
            array(
                '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'
        ],
        're_captcha'=>[
            'site_key'=>'key',
            'secred_key'=>'key2',
            
        ]
    ],
);

$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) {
$Proxy->addForm($Form);
$Proxy->proxyPostDataForm();
}

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

// 1 - id form in bitrix admin
if($Proxy->isSuccess(1))
{/* 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());
$SendManager->setSmtp($ConfigManager->getSmtpMailer());
$SendManager->sendMsgForm($Form)

"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"

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2018-09-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固