su-sws / erus
此软件包已被废弃,不再维护。未建议替代软件包。
Drupal功能。
7.1.2-alpha2
2018-06-26 22:38 UTC
Requires
- composer/installers: ^1.2
This package is auto-updated.
Last update: 2020-08-29 20:44:45 UTC
README
外部仓库更新状态。
用于连接到外部仓库服务(如github或bitbucket)以获取自定义工作更新状态信息。
安装和配置
默认情况下,ERUS将拾取任何在模块或功能.info文件中使用了项目状态URL选项的模块。
project status url = 'http://www.example.com'
ERUS模块将尝试从更新状态URL获取信息,以检查外部服务。ERUS自带github.com插件。您只需要为存储在github上的功能添加github项目页面的路径即可。例如,对于ERUS:
project status url = 'https://github.com/SU-SWS/erus'
无论您的模块和功能托管在哪里,您都可以为它们添加特定的配置设置。将以下内容添加到使用外部仓库服务的项目.info文件中。
erus[plugin] = plugin_name
erus[account] = remote-account-name
erus[project] = *optional_project_name*
例如:https://github.com/SU-SWS/stanford_person
erus[plugin] = github.com
erus[account] = SU-SWS
erus[project] = stanford_person
插件
GitHub
一个用于连接GitHub发布功能的插件。有关更多信息,请参阅插件文档。
API
请参阅erus.api.php
/**
* Define your own plugins
* /
hook_erus_plugin_info()
/**
* Alter existing plugin information
*/
hook_erus_plugin_info_alter()
示例插件
/**
* Example Erus Plugin
*/
class erusExample extends erusPlugin {
/**
* - Optional Method -
*
* Creates a configuration form at:
* admin/config/administration/erus/[-plugin_name-]
*
* A default submit handler is provided that saves all the form values
* into the variables table for you at variable_get('erus_[plugin_name]');
*
* @return [array] [config form]
*/
public function get_configuration_form() {
$form = array();
// Your form items here.
return $form;
}
/**
* - Required Method -
*
* The meat of your plugin goes in here. It is passed in update data for a
* module that has been validated to use this plugin. Add your logic here.
*
* @param [array] $data Update Data
* @return [array]
*/
public function process($data) {
// Do your stuff here.
// ...
// A guzzle client is available to you.
$client = $this->get_client();
// Get the configuration form settings
return $data;
}
}
Drush
警告 此模块将破坏您的 'drush up' 命令,除非所有使用的插件都提供有效的md5校验和,并且下载文件解压缩后的名称与模块完全相同。
如果您的 'drush up' 无法验证md5校验和或用无效名称替换模块目录,您可以使用包含的package-handler来修复这些问题。
eg: drush up --package-handler=erus_wget
通过提供 --package-handler 选项,您将能够继续使用 drush up。
此模块还包括上述功能的包装器。只需使用 drush eup 命令即可完成相同的工作。
eg: drush eup
待办事项
- 开发版本
- 非Drupal命名约定版本
- 许多错误修复和代码清理。
- 配置位置多个(info & 插件)