grant/powerschool-plugin-xml-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

grant/powerschool-plugin-xml-builder

Composer 安装命令:

composer require grant/powerschool-plugin-xml-builder

包简介

Build a plugin XML file for PowerSchool fluently.

README 文档

README

A package to help build valid xml for a PowerSchool plugin.

Installation

composer require grantholle/powerschool-plugin-xml-builder

Usage

You can fluently build up the tags and attributes of your plugin to generate valid xml.

use GrantHolle\PowerSchool\Plugin\PluginXmlBuilder;
use GrantHolle\PowerSchool\Plugin\UiContext;

/**
 * @var string
 */
$output = (new PluginXmlBuilder)
    ->version('1.1.1')
    ->description('A simple plugin')
    ->name('Simple Plugin')
    ->publisher('Joe Montana', 'joe@nfl.com')
    ->openId('example.com', 8443)
    ->addOpenIdLink('My OpenID link', '/path', 'My OpenID title', [
        UiContext::ADMIN_HEADER,
        UiContext::STUDENT_HEADER,
    ])
    ->addLink('My link', 'http://example.com', 'My title', UiContext::GUARDIAN_HEADER)
    ->addAccessRequest('students', 'dcid')
    ->addAccessRequest('students', 'first_name', true)
    ->addAccessRequest('students', 'last_name', true)
    ->saml('mysaml', 'http://example.com/saml', 'http://example.com/', 'http://example.com/metadata')
    ->addSamlLink('SAML', 'http://example.com/saml/login', 'SAML SP', [
        UiContext::ADMIN_HEADER,
        UiContext::ADMIN_LEFT_NAV,
    ])
    ->addSamlAttribute('admin', 'firstName')
    ->addSamlAttribute('admin', 'lastName', 'altLastName', 'myvalue')
    ->addSamlAttribute('student', 'first_name', 'first')
    ->addSamlPermission('permission1', 'A sample permission', 'abc123')
    ->addSamlPermission('permission2', 'Another sample permission', 'def456')
    ->oauth()
    ->autoEnable()
    ->autoRegister()
    ->autoDeploy()
    ->cantDelete()
    // By default is "pretty" and validated
    ->create();
    // Not pretty
    // ->create(false);
    // Not pretty or validated
    // ->create(false, false);

By default, the xml will be validated against the spec. If you'd like for it to not be "pretty," pass false to create().

The above snippet will generate the following plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://plugin.powerschool.pearson.com" version="1.1.1" name="Simple Plugin" description="A simple plugin" deletable="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://plugin.powerschool.pearson.com plugin.xsd">
  <publisher name="Joe Montana">
    <contact email="joe@nfl.com"/>
  </publisher>
  <oauth/>
  <openid host="example.com" port="8443">
    <links>
      <link display-text="My OpenID link" path="/path" title="My OpenID title">
        <ui_contexts>
          <ui_context id="admin.header"/>
          <ui_context id="student.header"/>
        </ui_contexts>
      </link>
    </links>
  </openid>
  <links>
    <link display-text="My link" path="http://example.com" title="My title">
      <ui_contexts>
        <ui_context id="guardian.header"/>
      </ui_contexts>
    </link>
  </links>
  <access_request>
    <field table="students" field="dcid" access="ViewOnly"/>
    <field table="students" field="first_name" access="FullAccess"/>
    <field table="students" field="last_name" access="FullAccess"/>
  </access_request>
  <saml name="mysaml" entity-id="http://example.com/saml" base-url="http://example.com/" metadata-url="http://example.com/metadata">
    <links>
      <link display-text="SAML" path="http://example.com/saml/login" title="SAML SP">
        <ui_contexts>
          <ui_context id="admin.header"/>
          <ui_context id="admin.left_nav"/>
        </ui_contexts>
      </link>
    </links>
    <attributes>
      <user type="admin">
        <attribute name="firstName"/>
        <attribute name="lastName" attribute-name="altLastName" attribute-value="myvalue"/>
      </user>
      <user type="student">
        <attribute name="first_name" attribute-name="first"/>
      </user>
    </attributes>
    <permissions>
      <permission name="permission1" description="A sample permission" value="abc123"/>
      <permission name="permission2" description="Another sample permission" value="def456"/>
    </permissions>
  </saml>
  <autoinstall required="true">
    <autoenable required="true"/>
    <autoregister required="true"/>
    <autoredeploy/>
  </autoinstall>
</plugin>

License

MIT

grant/powerschool-plugin-xml-builder 适用场景与选型建议

grant/powerschool-plugin-xml-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 08 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「powerschool」 「powerschool plugin」 「plugin.xml」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 grant/powerschool-plugin-xml-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 grant/powerschool-plugin-xml-builder 我们能提供哪些服务?
定制开发 / 二次开发

基于 grant/powerschool-plugin-xml-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-13