php加密验证
Last month, we introduced a new effort called Sourcehunt – a category of post intended to direct attention to less popular open source projects that show promise and need exposure.
上个月,我们推出了一项名为Sourcehunt 的新工作 -这是一类帖子,旨在将注意力转移到表现出希望和需求的不太受欢迎的开源项目上。
We’ve called for new submissions and accumulated an impressive list.
我们呼吁提交新的意见书,并积累了令人印象深刻的清单。
![Sourcehunt logo](https://i-blog.csdnimg.cn/blog_migrate/cce51699aba873830285ccc277e3d9ae.webp?x-image-process=image/format,png)
AsgardCMS [103★] (AsgardCMS [103 ★])
Asgard is an open source, multi-language modular CMS platform. Despite a rather uninspiring name and design, its big selling point is being based on Laravel 5.1 (the LTS version) rather than 5.0 like similar projects.
Asgard是一个开源的多语言模块化CMS平台。 尽管名称和设计不太令人鼓舞,但它的最大卖点是基于Laravel 5.1(LTS版本),而不是类似项目的5.0。
The CMS has been alive for a while now, but unfortunately failed to amass a decent following. To help, besides being mentioned in Sourcehunt, we’ll also have a more in-depth look at it soon, attempting to recreate some non-trivial site examples to see how it stacks up against competition.
CMS已经存活了一段时间,但不幸的是未能吸引到足够的追随者。 为了提供帮助,除了在Sourcehunt中提到的那样,我们还将很快对其进行更深入的研究,尝试重新创建一些不平凡的站点示例,以查看其如何与竞争相提并论。
memio / spec-gen [21★] (memio/spec-gen [21 ★])
The code generation library Memio, which we’ve covered before, has a spinoff project called spec-gen a code generation extension for the PhpSpec testing framework.
我们之前已经介绍过的代码生成库Memio有一个名为spec-gen的衍生项目,这是PhpSpec测试框架的代码生成扩展。
PhpSpec can generate class stubs for you if you’re testing something that doesn’t exist yet (in true TDD fashion), and this plugin makes it a bit more powerful. Granted, it’s a specific use case which would explain the project’s low adoption rate – but we feel like it deserves more eyes. With the PHP community waking up to testing more and more, we’re sure this will see some takers among you!
如果您正在测试尚不存在的东西(以真正的TDD方式),则PhpSpec可以为您生成类存根 ,并且此插件使其功能更强大。 当然,这是一个特定的用例,可以解释该项目的低采用率-但我们认为它值得更多关注。 随着PHP社区逐渐开始进行越来越多的测试 ,我们相信这一定会吸引到您!
雷声/简码[59★] (thunderer/shortcode [59 ★])
If you ever used WordPress for more than just publishing default posts, you’ll be familiar with shortcodes. thunderer/shortcode is a package aiming to bring them into the rest of the PHP world.
如果您不仅使用WordPress来发布默认帖子,还应该熟悉shortcodes 。 thunderer / shortcode是一个软件包,旨在将它们带入PHP世界的其余部分。
Now you can add custom “civilian-friendly” shortcodes into your own CMS / app / templating engine and have the designers and content writers get right to work without having to deal with method calls and mustache ({{ }}
) surroundings.
现在,您可以在您自己的CMS / app /模板引擎中添加自定义的“平民友好型”简码,让设计人员和内容作者无需处理方法调用和胡须( {{ }}
)周围的环境就可以正常工作。
Granted, this library doesn’t do much a simple extension to a template engine couldn’t do – but it’s engine/library-agnostic and can be plugged into any other content parser easily, which certainly is an advantage.
当然,该库并没有对模板引擎做不到的简单扩展-但它与引擎/库无关,并且可以轻松地插入任何其他内容解析器,这无疑是一个优势。
闪烁框架[276★] (Blink framework [276 ★])
The Blink framework is “a micro web framework for building long-running and high performance services [… and] is also an application server that can serve requests directly in PHP, without php-fpm or Apache’s mod_php[… It uses] the Swoole extension as the underlying networking library.“
Blink框架是“ 用于构建长期运行的高性能服务的微型Web框架[…,]也是一个应用服务器,可以直接在PHP中为请求提供服务,而无需php-fpm或Apache的mod_php […它使用] Swoole扩展作为基础网络库。 “
Translation: Blink is another solution in the form of long-running PHP servers written in PHP (think ReactPHP, AppServer…), but this time with an embedded framework and battle tested on some high traffic Chinese sites. The Swoole extension they reference is a C extension for PHP which allows for long-running apps, effectively preventing the complete recompilation and memory purge of a PHP app after a response is served. This opens new doors to danger, but that’s where immutability can help – a discussion for another time. Further clarifications can be found in this Reddit thread.
翻译:Blink是使用PHP编写的长期运行PHP服务器形式的另一种解决方案(认为ReactPHP,AppServer…),但是这次具有嵌入式框架,并且在一些高流量的中文站点上进行了测试。 他们引用的Swoole扩展是PHP的C扩展,它允许长时间运行的应用程序,有效地防止了响应响应后PHP应用程序的完全重新编译和内存清除。 这为面临危险打开了新的大门,但是不变性可以在这里提供帮助-进行另一次讨论。 可以在此Reddit线程中找到进一步的说明。
Rest assured, a tutorial introducing the Blink framework is coming up – but in the meanwhile, why not give it a spin so you can help up peer review it?
放心,即将推出一个介绍Blink框架的教程-但与此同时,为什么不尝试一下,以便您可以帮助同行评审呢 ?
特工[662★] (Agent [662 ★])
Agent helps you find out information about a User Agent. No more manual parsing of UA strings to find out whether the visitor is on mobile, desktop, Firefox or Safari – Agent takes care of all this with a very user friendly interface.
代理可帮助您找到有关用户代理的信息。 不再需要手动解析UA字符串来了解访问者是在移动设备,台式机,Firefox还是Safari上,Agent通过非常用户友好的界面来处理所有这些操作。
It’s a simple tool, but one that will find a home in many a project. While already very popular (it kind of exploded on Reddit), it could still use some contributions.
这是一个简单的工具,但可以在许多项目中找到家。 虽然已经很流行了(它在Reddit上爆炸了),但它仍然可以使用一些贡献。
PHP Humanizer [915★] (PHP Humanizer [915 ★])
Humanizer makes values that are readable only for developers more civilian-friendly. See this example:
Humanizer使仅对开发人员可读的值对平民更加友好。 请参阅以下示例:
use Coduo\PHPHumanizer\String;
echo String::humanize('field_name'); // "Field Name"
echo String::humanize('user_id'); // "User"
echo String::humanize('field_name', false); // "field name"
More examples in their README, but you get the gist – it’s a fun tool that’s admittedly more popular than one might expect, but given the two issues they need help with and several pull requests that need reviewing, it’s safe to assume the project is looking for more contributors.
自述文件中有更多示例,但您懂的要点-这是一个有趣的工具,虽然比人们期望的要受欢迎,但是鉴于他们需要帮助的两个问题以及需要复审的一些拉取请求,因此可以安全地假设该项目正在寻找为更多贡献者。
粒子/验证器[79★] (Particle/Validator [79 ★])
An extremely simple implementation of common validation practices, Particle/Validator was recently tagged as version 2.0 and is looking for early adopters and contributors. Validating is as simple as:
粒子/验证器是通用验证实践的一种非常简单的实现,最近被标记为2.0版,正在寻找早期采用者和贡献者。 验证很简单:
$v = new Validator;
$v->required('user.first_name')->lengthBetween(2, 50)->alpha();
$v->required('user.last_name')->lengthBetween(2, 50)->alpha();
$v->required('newsletter')->bool();
$result = $v->validate([
'user' => [
'first_name' => 'John',
'last_name' => 'D',
],
'newsletter' => true,
]);
$result->isValid(); // bool(false).
$result->getMessages();
/**
* array(1) {
* ["user.last_name"]=> array(1) {
* ["Length::TOO_SHORT"]=> string(53) "last_name is too short and must be 2 characters long."
* }
* }
*/
It’s a high-code-quality full-test-coverage library that’s looking to make its mark on the PHP world, and with the framework and library agnostic approach it’s taking, we feel like it deserves more than a good shot.
这是一个高代码质量的完整测试覆盖率的库,正试图在PHP世界中留下自己的印记,并且采用了框架和库不可知论的方法,我们认为它值得拥有一个好镜头。
pascaldevink / shortuuid [119★] (pascaldevink/shortuuid [119 ★])
shortuuid is a simple php library that generates concise, unambiguous, URL-safe UUIDs.
shortuuid是一个简单的php库,可生成简洁,明确,URL安全的UUID。
There are many arguments against sequential IDs in URLs, especially in API design, so hiding them with unique URL-friendly strings only makes sense.
URL中有很多反对顺序ID的参数 ,尤其是在API设计中,因此用唯一的URL友好的字符串将它们隐藏起来才有意义。
The library goes out of its way to be very simple to use, and highly unambiguous as far as similar characters are concerned so that, for example, similar-looking characters such as l, 1, I, O and 0 are completely omitted and cannot be mistyped.
该库使用起来非常简单,并且就相似字符而言非常明确,因此,例如,看起来相似的字符(例如l,1,I,O和0)将被完全省略并且不能输入错误。
文克拉/攀爬[218★] (vinkla/climb [218 ★])
How do you check for new versions of your Composer packages? Run composer update
and hope for the best? Do dry runs?
您如何检查Composer软件包的新版本? 运行composer update
并希望最好吗? 空跑吗?
Climb scans your project and lists newer versions of dependencies than what your composer.json
allows – simple as that:
Climb会扫描您的项目,并列出比composer.json
允许的版本更高的依赖关系-如此简单:
alt-three/logger 1.0.2 → 1.1.0
graham-campbell/exceptions 5.0.0 → 5.1.0
jenssegers/optimus 0.1.4 → 0.2.0
vinkla/hashids 1.1.0 → 2.2.0
标记/细分服务[218★] (flashtag/subsplit-service [218 ★])
Ever wondered how those big projects like Zend or Symfony separate their components out into read-only sub repositories? For example, the Symfony Yaml component is a read only component repo, but can also be found in the main framework.
有没有想过像Zend或Symfony这样的大型项目如何将其组件分离到只读子存储库中? 例如, Symfony Yaml组件是只读组件存储库,但也可以在主框架中找到。
Some teams have hacked together solutions that automate this, but Flashtag’s subsplit-service takes it to the next level by hooking into github’s webhooks or being triggered by cronjobs. Usage is quite straightforward when you’re the tool’s target audience, and we’re planning an in-depth look at the tool and a comparison with alternatives real soon. Stay tuned!
一些团队已经破解了自动化该解决方案的解决方案 ,但是Flashtag的subsplit-service通过挂接到github的webhooks或被cronjobs触发将其提升到一个新的水平。 当您是该工具的目标受众时,用法非常简单,并且我们正计划对该工具进行深入研究,并与实际的替代产品进行比较。 敬请关注!
Payum [503★] (Payum [503 ★])
Payum is one of those packages that starts out innocent enough, but then everyone starts using it because it just rockets past the often too-specific, too-locale-bound, too slow competition.
Payum是一开始就足够无辜的软件包之一,但是后来所有人都开始使用它,因为它只是飞越了通常过于特定,过于局限性 ,过于缓慢的竞争。
It’s a payment processor for Paypal, Stripe, Omnipay, and many more services, easily integrated with any library and framework, featuring a consistent and well tested API and rather extensive docs.
它是用于Paypal,Stripe,Omnipay和许多其他服务的付款处理器,可以轻松地与任何库和框架集成,并具有一致且经过良好测试的API和相当广泛的文档。
Payum recently reached version 1.0.0, and could use your help in test driving it and contributing by handling some issues and PRs. If you can’t help with code, we encourage you to help with documentation as English is (rather obviously) not the team’s native language.
Payum最近达到了1.0.0版本,可以使用您的帮助进行测试驱动并通过处理一些问题和PR做出贡献。 如果您不能帮助代码,我们鼓励您帮助文档,因为英语(显然)不是团队的母语。
伯纳德[389★] (bernard [389 ★])
Bernard is to job queue engines what HTTPlug is to HTTP clients in PHP.
Bernard致力于作业队列引擎,而HTTPlug就是PHP中的HTTP客户端。
It abstracts the specific implementations and makes it possible to use various background job engines for all your PHP queueing needs.
它抽象了特定的实现,并可以使用各种后台作业引擎来满足您所有PHP排队需求。
Bernard is far from a new project, but development has been picked up in the past few days again and the library got a second wind. Due to its potential, we felt it necessary to direct some attention to it – can you contribute?
伯纳德(Bernard)距离新项目还很遥远,但是在过去几天里开发工作又重新开始了,图书馆受到了第二次欢迎。 鉴于其潜力,我们认为有必要对此加以注意–您能贡献力量吗?
模范/卤石[125★] (paragonie/halite [125 ★])
Halite is a high-level cryptography interface that relies on libsodium for all of its underlying cryptography operations.
Halite 是一个高级加密接口,其所有基础加密操作都依赖于libsodium。
Halite depends on the excellent libsodium (so it and its PHP extension counterpart are prerequisites) and provides symmetric and asymmetric encryption and authentication. For example, here’s how one would encrypt/decrypt a file:
Halite依赖于出色的libsodium(因此,它和它PHP扩展副本是先决条件),并提供对称和非对称的加密和身份验证。 例如,以下是加密/解密文件的方式:
<?php
use \ParagonIE\Halite\File;
// Encrypt a file with symmetric-key cryptography
File::encrypt($inputFile, $outputFile, $encryption_key);
// Decrypt a file with symmetric-key cryptography
File::decrypt($inputFile, $outputFile, $encryption_key);
// Encrypt a file with asymmetric-key cryptography
File::seal($inputFile, $outputFile, $enc_public);
// Decrypt a file with asymmetric-key cryptography
File::unseal($inputFile, $outputFile, $enc_secret);
// Get the checksum of a file
$checksum = File::checksum($filename);
// Get the cryptographic signature of a file's checksum
$signature = File::sign($filename, $sign_secret);
// Verify the authenticity of a digitally signed file
$valid = File::verify($filename, $sign_public, $signature);
This may be a bit unclear unless you’re very security conscious, so we’re preparing a proper tutorial on Halite for you in the coming weeks, one dealing with a real use case. We think you’ll like it.
除非您非常注重安全性,否则这可能有点不清楚,因此我们将在接下来的几周内为您准备有关Halite的适当教程,其中涉及一个实际用例。 我们认为您会喜欢的。
That’s it for this month’s Sourcehunt! If you’re struggling with finding projects to contribute to, please re-read the list above and see if anything strikes your fancy. Let us know if you do send a PR or two, and we’ll feature them in the next Sourcehunt when we report on the activity!
这就是本月的Sourcehunt! 如果您正在努力寻找可为之贡献的项目,请重新阅读上面的列表,看看是否有您喜欢的东西。 让我们知道您是否发送一个或两个PR,我们在报告活动时将在下一个Sourcehunt中介绍它们!
To suggest projects you’d like to see on this list next month, just shout out tweets with hashtags #sourcehunt and #php – here’s the link to the combination. Naturally, if you’d like to sourcehunt a project written in another language, alter accordingly.
为了建议您希望在下个月在此列表中看到的项目,只需使用#sourcehunt和#php标签大喊大叫 -这是该组合的链接 。 自然,如果您想寻找其他语言编写的项目,请进行相应的更改。
翻译自: https://www.sitepoint.com/sourcehunt-php-contribute-to-crypto-validation-payments/
php加密验证