当前位置:网站首页>What are the killer super powerful frameworks or libraries or applications for PHP?
What are the killer super powerful frameworks or libraries or applications for PHP?
2022-08-02 03:58:00 【phpreturn】
PHP发展了这么多年,There are many interesting projects.Let's get rid of those pesky CRUDs,Let's learn about these interesting projects together.
1:php-ai/php-ml,一个高级的PHP的机器学习库
php-ml是一个使用PHP实现的机器学习库,包含算法、神经网络、交叉验证、预处理、Feature extraction and other commonly used functional solutions in the field of artificial intelligence.
The official also provides many cases,比如:
- Detect language classification
- MNIST 识别手写字体(The standard introduction to artificial intelligence programs)
- 垃圾邮件过滤
- 文章分类
- 预测葡萄酒质量
php-mlhas a well-documented,and has a wealth of blog posts.But this is already the domain of artificial intelligence,Your knowledge structure may not be available for a while.
Simply use the following:
require_once __DIR__ . '/vendor/autoload.php';
use Phpml\Classification\KNearestNeighbors;
$samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4, 1], [4, 2]];
$labels = ['a', 'a', 'a', 'b', 'b', 'b'];
$classifier = new KNearestNeighbors();
$classifier->train($samples, $labels);
$classifier->predict([3, 2]);
// return 'b'
2:rindow/rindow-neuralnetworks,一个高级的PHP的神经网络库
This is also an artificial intelligence project,是一个高级的PHP的神经网络库,可以使用PHPImplement a powerful machine learning project.
它有以下特点:
- 可以轻易地实现DNN、CNN、RNN 和 Attention 机器学习模型
- 和Python的Keras 很相似,Relevant experience can be leveraged
- Provides processing of machine vision and natural language in machine learning
- Processing performance istensorflow CPU 的两倍
- No special operating environment required,Can run in any computer environment
- Comes with interesting sample programs
and there are associated computational extensions,用于提高性能.还有对于GPU的扩展,可以利用GPU的计算能力,进一步提高性能,But it is still in testing stage at present.
3:rubix/ml,一个高级的PHPMachine Learning and Deep Learning Libraries for
是的, Here introduces a againPHPThe artificial intelligence library.
He has these characteristics:
- Development-friendly interface method calls
- 40Multiple supervised or unsupervised learning methods
- 支持 ETL、Preprocessing and Cross Validation
compared to the above two,It provides the most tutorials and example projects Tutorials and sample projects ,Among the more interesting ones are divorce predictions、DOTA2win rate prediction etc., And provide a communication channel for the telegram group.
4:nlp-tools/nlp-tools,A semi-advanced natural language processing library for beginners
This is a library dedicated to dealing with the field of natural language processing in artificial intelligence,The method he provides will be lower-level than the previous ones,but still elegant to use.
It has built-in multiple classification models,clustering method,分词器,Datasets, etc. Almost all the tools and data needed for this pickup.
Compared with several projects introduced earlier,It is specially designed to deal with the field of natural language,and very friendly to beginners.有丰富的文档,The built-in tools and complete data.
Here is a demonstration of the word segmentation effect:
include('vendor/autoload.php');
use NlpTools\Tokenizers\WhitespaceAndPunctuationTokenizer;
$text = "Please allow me to introduce myself
I'm a man of wealth and taste";
$tok = new WhitespaceAndPunctuationTokenizer();
print_r($tok->tokenize($text));
// Array
// (
// [0] => Please
// [1] => allow
// [2] => me
// [3] => to
// [4] => introduce
// [5] => myself
// [6] => I
// [7] => '
// [8] => m
// [9] => a
// [10] => man
// [11] => of
// [12] => wealth
// [13] => and
// [14] => taste
// )
5:workerman/gateway-worker,A distributed long-link service framework
GatewayWorker基于Workerman开发的一个项目框架,用于快速开发TCP长连接应用,例如app推送服务端、即时IM服务端、游戏服务端、物联网、智能家居等等.
compared to other such programs,It offers several unparalleled advantages:
- 内置进程守护,Stable operation with simple command line,Don't need to realize the background or process to protect themselves
- Built-in distributed design,without modifying any code,实现分布式部署
- Perfect long link operation,Including binding to the connectionUID、Bind the group to the connection、维护SESSION等
- Provides the usage of standard in-system push messages,提供了一个client,可以随时向gatewaysend messages over the network
gatewayworkerAlmost all pain points in long link development are solved,非常好用.要注意的是,He is a framework designed for long links,如果是短连接(UDP)则需要其他方案.
It starts like this,无需更多操作,Robust completion process daemon、平滑重启.
启动
以debug(调试)方式启动
php start.php start
以daemon(守护进程)方式启动
php start.php start -d
停止
php start.php stop
重启
php start.php restart
平滑重启
php start.php reload
查看状态
php start.php status
6:robmorgan/phinx,A database migration tool
What is a database migration tool?,You can first understand this,is a database import tool.
Generally if we need to import the database,You need to go to the previous database export firstsql文件,then import to another sitesql文件.Seems like it's justified,There is no better way,Even better is to make a one-click installation script.
Actually there is a better solution,Just use database migration toolphinx,在安装数据库时,Don't need to export and importsql文件,而是直接使用phinx提供的方法,设计好表结构,然后通过phinxcommand import.
这样有很多好处:
- More elegant installation,Managed with system code,无需导出sql文件
- Support database upgrade relegation,Can follow the system upgrade,Automatically compare data table changes,不用担心数据丢失
- Support multiple databases,在phinxThe designed table structure can be installed directly into theMysql、PostgreSQL、SQLite、SQL Server
phinxIs absolutely modern program installation solutions,You are worth the effort to use it.
Its basic usage is like this:
<?php
use Phinx\Migration\AbstractMigration;
class CreateUserLoginsTable extends AbstractMigration
{
public function change()
{
// 创建表结构
$table = $this->table('user_logins');
$table->addColumn('user_id', 'integer')
->addColumn('created', 'datetime')
->create();
}
}
7:league/flysystem,一个PHPThe universal file storage operation library
flysystem是一个PHP的文件操作库,such as file reading、写入、Directory listing, etc..与众不同的是,他是“万能的”.In fact, it is an exaggeration to say that it is omnipotent.,But he officially supports the following systems:
- 本地存储
- FTP存储
- SFTP存储
- 内存存储
- 亚马逊云存储
- 谷歌云存储
- WebDAV存储
In community ecology,Also supports some of the systems we often come into contact with:
- 阿里云存储
- 七牛云存储
- Dropbox存储
- 腾讯云存储
- 华为云存储
等等,如果你需要,You can also customize the driver.
就像下面的代码一样,Operations on files are universally compatible,If you need to switch storage systems,Just change the driver.
// 设置驱动
$adapter = new League\Flysystem\Local\LocalFilesystemAdapter($rootPath);
$filesystem = new League\Flysystem\Filesystem($adapter);
// 操作文件、目录
$filesystem->write($path, $contents);
$filesystem->read($path);
$filesystem->delete($path);
$filesystem->listContents($path, $recursive);
$filesystem->fileExists($path);
$filesystem->has($path);
$filesystem->lastModified($path);
.....
8:PHP-CPP,一个C++的PHP扩展开发框架
Compared to the previous projects introduced,PHP-CPP并不是一个PHPextension or library,它是一个C++的框架,用来开发PHP扩展.
众所周知,PHPextension development is difficult,你一搜PHP的扩展开发,Everyone tells you that scaryZend API,like meeting Voldemort,people dare not mention it.
PHP-CPPTo solve the such confusionZend API的问题,Actually he solved a lot of problems,use him to developPHP扩展,写起C++Code comes like writingPHP一样,毕竟PHPThe syntax also refers toC风格.
就像下面这样,Just a few lines to complete aPHP扩展.
#include <phpcpp.h>
#include <iostream>
void myFunction()
{
Php::out << "example output" << std::endl;
}
extern "C" {
PHPCPP_EXPORT void *get_module() {
static Php::Extension extension("my_extension", "1.0");
extension.add<myFunction>("myFunction");
return extension;
}
}
PHP-CPPRich documentation and annotations are also provided,Teach you how to register functions、调用函数、匿名函数、类和对象、Parse and Construct、魔术方法等.
9:PHP-FPM,a strong stableHTTP服务框架
A lot of people always ignore thisPHP-FPM,even despise him.
实际上,PHP-FPMis a big killer,
- 稳定的运行
- 丰富的扩展
- Advanced performance plan,
在Webstill shining.
边栏推荐
猜你喜欢
随机推荐
攻防世界—MISC 新手区1-12
js预编译 GO 和AO
IO流、 编码表、 字符流、 字符缓冲流
4. PHP array and array sorting
PHP Foundation March Press Announcement Released
解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址
PHP 给图片添加全图水印
2.PHP变量、输出、EOF、条件语句
MySql高级 -- 约束
每日五道面试题总结 22/7/20
vim编辑模式
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
Eric靶机渗透测试通关全教程
轮播图详解(完整代码在最后)
你的本地创建的项目库还在手动创建远端代码仓库再推送吗,该用它了
每日五道面试题总结 22/7/19
Stable and easy-to-use short connection generation platform, supporting API batch generation
2. PHP variables, output, EOF, conditional statements
(8) requests, os, sys, re, _thread
13. JS output content and syntax