The great thing about the Internet and open source is that everyone else has seen your problems and everyone else has given you the solutions you want. But so many open source products, exactly how to choose and screen whether it is suitable for their own projects, here recommend some common libraries and development tools in their own development, each class will only recommend one, to avoid the pain of your choice.

The framework

Laravel is the first PHP development framework, described on its website as “A PHP framework for Web Artists”. The underlying code of the Laravel framework is up-to-date and uses the latest technology. And it has a high learning threshold, but it is a good tool to urge personal progress. Elegant routing, a powerful IOC container, extensible service providers, queues, caching, notifications, events, broadcasting — everything you might need to develop a large application — full-text search engines, payment solutions, social logins — Laravel is basically a revolutionary framework for PHP.

Network communication

Compared with traditional Web applications, network communication is more like the bottom layer and requires higher basic knowledge of developers. Swoole is an asynchronous network communication engine. According to his official website:

Enables PHP developers to write high-performance asynchronous concurrent TCP, UDP, Unix Socket, HTTP, WebSocket services. Swoole can be widely used in the Internet, mobile communications, enterprise software, cloud computing, online gaming, Internet of Things (IOT), Internet of vehicles, smart home and other fields.

Although it requires developers to understand the knowledge of operating system, network and process, it is actually very easy to get started. It is very easy to develop a WebSocket server through Swoole, and there is an opportunity to write an implementation of wechat scanning code login based on Swoole.

Package management

With the introduction of namespaces in PHP, Composer is the most advanced dependency management solution in the ecosystem. Compared to using require to include files prior to version 5.3, it does increase the cost of learning, but the efficiency is unlimited. Imagine the traditional approach of importing source code packages by downloading a stack of required files; With Composer, you can do it with a single command, and it also solves the problem of late upgrades.

Code deployment

There are so many code deployment and continuous integration tools on the web, Jenkins, Travis CI, WALL-E deployment, and so on. One of the common problems is the cost of learning. It’s hard to know how to get started. One of the recommended deployment tools for PHP-based development is Deployer, which has the advantages of being easy to use, rollback support, atomic publishing, and support. And the amount of source code is not much, do not understand the place can be very convenient to read the source code to debug.

Network request

Web requests may not be used much in development, but writing them yourself is tedious. Guzzle is a network request library that has a very concise syntax and very stable code over the years. It supports not only common GET, POST, PUT, and DELETE requests, but also requests such as OPTIONS, HEADER, and PATCH. In addition, it supports parallel invocation. In addition, it supports retry mechanism through middleware.

The process to protect

In modern Web reference development, queue or CLI-run applications are often used, and the service is interrupted once the process hangs, so it is necessary to have a process daemon to pull the process back up. Supervisor, a Python based tool library, is recommended here. Supervisor centrally manages processes through simple INI style configuration files, monitors the survival status of processes through operating system signals, and supports simple event notification protocols. Compatible with all operating systems except Windows.

The queue

Queues are often used for time-consuming tasks, such as sending email messages, downloading reports, processing pictures, etc. There are many open source queue software on the market at present, such as Kafka, ActiveMQ, RabbitMQ, Redis, etc. You can go to http://queues.io to have a look. In fact, for a regular Web application, these heavyweights are generally not needed, so I recommend Beanstalkd queue, which is also recommended in the Laravel framework.

The log

Logging system is crucial for a Web application. In addition, the amount of logs is generally large, and there are many types. Here, I recommend the use of ELK, the centralized log architecture. You can check out my previous article:

Acquisition tools

In fact, the most suitable language to do crawler is Python, of course, with PHP development is also a lot of tools. QueryList is a collection tool based on PHP development. It is a simple, flexible and powerful PHP collection tool, which makes collection easier. The syntax is basically the same as jQuery.

// Collect all images of a page$data = QueryList::get('http://cms.querylist.cc/bizhi/453.html')->find('img')->attrs('src'); Print_r ($data->all());
Copy the code

WeChat development

Wechat created a new era, and then apps based on wechat basically dominated traditional WAP apps. The development kit of wechat public number is EasyWeChat, which is an unofficial open source tool library, but basically covers all aspects of wechat development, including public number, enterprise wechat, wechat pay, open platform and small program. The new version 4.0 is also a VERSION of LTS, but some concepts in the new version are not clearly described, and the use method is much more complicated than the old version. It is suggested to use version 3.0 if only public account development.

The above covers almost all aspects of a normal application development, although it may not be enough for a large distributed application. Finally to a wave of small benefits, to the public number backstage send “oneuI”, give a set of beautiful background template.

Welcome to close my personal public number: left hand code