定制 medzoner/coinhive-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

medzoner/coinhive-bundle

Composer 安装命令:

composer require medzoner/coinhive-bundle

包简介

This bundle provides Coinhive services. It does'nt depend of coinhive.com

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

This bundle provides Coinhive services. It does'nt depend of coinhive.com

Installation

Step 1: Use composer and enable Bundle

To install CoinhiveBundle with Composer just type in your terminal:

php composer.phar require medzoner/coinhive-bundle

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Medzoner\Bundle\CoinhiveBundle(),
    // ...
);

Step2: Configure the bundle's

Add the following to your config file:

# app/config/config.yml

coinhive:
    config:
        site_key: '%coinhive.site_key%'

Step3a: Use captcha in form

Add the following to your formType file:

<?php

use CoinhiveBundle\Validator\IsTrue;

    //....

    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('coinhive-captcha-token', CoinHiveCaptchaType::class, [
                'mapped'      => false,
                'constraints' => [
                    new IsTrue()
                ]
            ])
        ;
    }
    
    //...

Step3b: Use miner on your site

Add the following to your twig files:

{{ coinhive_miner() }}

Demo

https://medzoner.com/contact

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固