stormcode/swotphp
Composer 安装命令:
composer require stormcode/swotphp
包简介
Identify email addresses or domains names that belong to colleges or universities.
关键字:
README 文档
README
This is a port of the popular Ruby Gem, "Swot". As such, please do NOT make data contributions to this repository. Contribute any new academic domain names to the Ruby version of this package at https://github.com/leereilly/swot. Please follow the contribution guidelines noted on Lee's repository.
I will be pulling changes to upstream domain data.
If you have a product or service and offer academic discounts, there's a good chance there's some manual component to the approval process. Perhaps
.eduemail addresses are automatically approved because, for the most part at least, they're associated with American post-secondary educational institutions. Perhaps.ac.ukemail addresses are automatically approved because they're guaranteed to belong to British universities and colleges. Unfortunately, not every country has an education-specific TLD (Top Level Domain) and plenty of schools use.comor.net.
Swot is a community-driven or crowdsourced library for verifying that domain names and email addresses are tied to a legitimate university of college - more specifically, an academic institution providing higher education in tertiary, quaternary or any other kind of post-secondary education in any country in the world.
Installation
Install through Composer.
"require": { "stormcode/swotphp": "1.0" }
Usage
The easiest way to get started with SwotPHP is to use a facade to access functionality. However, the base implementation is present as a plain ol' PHP object in case developers want control over the construction themselves. The implementation has an injected dependency on PHP Domain Parser, an implementation of a URL parser backed by the Public Suffix List.
Framework-specific facades / service providers may be added later. The native facade is a good example of how the object should be instantiated.
Native
require_once('vendor/autoload.php'); use SwotPHP\Facades\Native\Swot;
Verify Email Addresses
Swot::isAcademic('lreilly@stanford.edu') # true Swot::isAcademic('lreilly@strath.ac.uk') # true Swot::isAcademic('lreilly@soft-eng.strath.ac.uk') # true Swot::isAcademic('pedro@ugr.es') # true Swot::isAcademic('lee@uottawa.ca') # true Swot::isAcademic('lee@leerilly.net') # false
Verify Domain Names
Swot::isAcademic('harvard.edu') # true Swot::isAcademic('www.harvard.edu') # true Swot::isAcademic('http://www.harvard.edu') # true Swot::isAcademic('http://www.github.com') # false Swot::isAcademic('http://www.rangers.co.uk') # false
Find School Names
Swot::schoolName('lreilly@cs.strath.ac.uk') -> "University of Strathclyde" Swot::schoolName('http://www.stanford.edu') -> "Stanford University"
Known Issues
- Lack of automated data import from Ruby gem's domain list.
- There are architectural issues with the package resultant from differences in PHP and Ruby-isms. When I get time, there are two areas I'd like to focus on:
- Consolidate some of how the internal API flows while maintaining public interface.
- Implement a different mode of accessing the public suffix registry. Currently, the package is possibly abusing an excellent URL parser and I'd like to investigate the possibility of a separate component dedicated to modeling the Public Suffix registry's ruleset and algorithms.
stormcode/swotphp 适用场景与选型建议
stormcode/swotphp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.62k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stormcode/swotphp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stormcode/swotphp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stormcode/swotphp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy URL rewrites in your Laravel application
A Laravel helper to detect if the current route/path is active.
Provides a service and twig extension for getting short urls like http://your.host/~short
SURL - Laravel Short Url
CakePHP Bitly Plugin
Updates the slug of a page automatically and logically when renaming a page or moving it around.
统计信息
- 总下载量: 21.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-15