dosomething/mb-toolbox

此包已被废弃,不再维护。没有建议的替代包。

Quicksilver系统组成组件之间共享功能的库:https://github.com/DoSomething/message-broker。其中一些功能是DoSomething.org特有的。


README

Message Broker系统中许多生产者和消费者应用提供的通用功能的类和相关方法集合。

####class MB_Toolbox 方法

  • isDSAffiliate($targetCountyCode)
  • createDrupalUser($user)
  • getPasswordResetURL($uid)
  • getDSMemberCount()
  • subscriptionsLinkGenerator($targetEmail)
  • curlPOST($curlUrl, $post)
  • curlPOSTauth($curlUrl, $post)
  • curlDELETE($curlUrl)
  • curlDELETEauth($curlUrl)
  • authenticate()

####class MB_Toolbox_cURL 方法

  • curlGET($curlUrl, $isAuth = FALSE)
  • curlGETauth($curlUrl)
  • curlGETImage($imageUrl)
  • authenticate()

####class MB_Toolbox_BaseConsumer

@param string $targetMBconfig
The Message Broker object used to interface the RabbitMQ server exchanges and related queues.
$targetMBconfig = 'messageBroker'

方法

  • consumeQueue($payload)
  • throttle($maxMessageRate) 抽象受保护
  • setter($message)
  • canProcess()
  • process()

####class MB_MailChimp($settings)

@param array $settings
Settings from external services - Mailchimp

方法

  • submitBatchToMailChimp($composedBatch)
  • submitToMailChimp($composedItem)

####class MB_Configuration

@param array $source
  The source of configuration settings. This can be from a file or an endpoint.
@param array $applicationSettings
  General application settings for use by all classes in application.

方法

  • exchangeSettings($targetExchange)

####class MB_Configuration

@param array $settings
  Configuration settings defined by the application script accessing the library.

方法

  • private __construct()
  • static getInstance()
  • setProperty($key, $value)
  • getProperty($key)
  • constructRabbitConfig($targetExchange, $targetQueues = NULL)
  • exchangeSettings($targetExchange)
  • gatherSettings($targetSetting)

####Gulp支持直接使用路径到gulp ./node_modules/.bin/gulp 或添加到系统配置(.bash_profile)别名gulp='./node_modules/.bin/gulp'

###代码风格检查

  • gulp lint

###代码风格检查

  • gulp test

参见 gulpfile.js 进行配置。

PHP CodeSniffer

  • php ./vendor/bin/phpcs --standard=./ruleset.xml --colors -s src tests 按文件列出所有代码违规。

  • php ./vendor/bin/phpcbf --standard=./ruleset.xml --colors src tests 自动处理文件以符合编码标准。