Using PHP with WebSocket

Is it possible to use PHP with WebSocket? Let's figure out
16 October 2017   2375

Unfortuantelly, PHP is not designed to work with WebSocket. You can connect it, but your code will be full of while (true) and fsock_open . And you have to have access to the shell to run the WS-server with php-cgi. 

You need to choose a language that supports threads / asynchronous communication. Now on the top is Node.js. In addition, better use dedicated libraries to support older browsers, etc. If you want to create one-to-all communication (eg chat, broadcast messaging), go one step further and use one of the Bayeuximplementations, for example: Faye.

The mod_proxy_wstunnel extension adds an extra layer to the WS server. Depending on the configuration, it can support DDoS, queue, load-balancing, local port swapping, and https support. But better use this for nginx.

Websockets are events, and PHP is poorly managed with it.

PhpStorm Got New Version

Popular PHP IDE received version 2018.3 with a lot of new features and updates
23 November 2018   369

JetBrains, specializing in the creation of IDE, announced the release of the final version of PhpStorm 2018.3. This cross-platform product is developed on the basis of the IntelliJ IDEA platform and is intended for development in the PHP scripting language.

The updated development environment works with PHP 7.3. Developers have improved support for DQL (Doctrine Query Language), a query language focused on the project's object model. DQL compiles requests for receiving or modifying data using user-created class names and fields. The IDE version for early access simply highlighted the lines of the code with the requests; in the final, full navigation and editing was implemented.

For PHPDoc, the concept of intersection (Intersection Types) was added, allowing variables to belong to several types at the same time. Improved some refactoring tools. HTTP requests can now be generated using run. The debugger was provided with the ability to search for variables.

When working with PHPUnit, you can automatically generate the setUp and tearDown methods used when running tests. This solution will speed up the work with the code.

JetBrains specialists have expanded the possibilities for working with the GitHub repositories. In PhpStorm 2018.3 a tool has been added for the management of pull request that allows you to view and sort them. Fixed IDE work with submodules: now when cloning a project, they are saved correctly.

The new development environment contains tools for automatically correcting the code and bringing it to industry standards, such as PSR-2. For this, the developers have included the PHP CS Fixer utility in PhpStorm 2018.3. Settings even allow you to define your own standards for the code.

Improved IDE interface itself. Implemented new search features, added new color schemes. Todo, an operator that generates a task list, like the example of similar tools in JavaScript, TypeScript, SQL, CSS, and HTML can now include several lines.

To work with databases, the developers reworked the code supporting these modules and included NoSQL DBMS Apache Cassandra and relational PostgreSQL into the system.

The previous version of IDE was released in July 2018. Then the developers added custom postfix fill patterns and reworked the structured search and replace.

Get more info at official blog.