Category: How I solved it

Async Task without Queue or E-loop PHP

Most react-PHP code I’ve seen in the open that is not extension-based (doesn’t extend the PHP core language) uses some kind Event-Loop, something similar to how many technologies or languages(I.e. JavaScript) implement concurrency that doesn’t support threads.

And historically on single-core CPU’s threads practically transformed into loops underneath. But the main idea is that in many languages, an async behavior is very easily achieved, maybe you need a keyword, maybe you need a special class, but in general, it is simple.

Now if you want the easiest way to do something asynchronous in PHP it will be a little costly, you can do that by spawning a new PHP process directly from PHP. View full article

Example of Language System in an Ionic 3 Application

When you want to create a language system and add multiple languages to your Ionic APP you have various designs available, but in a simple APP, there are 2 major ones.

The first design is where the UI design and APP functionality remain the same for both languages, in this case, you can use some javascript objects for every component you have.
This design is suited when you want to have consistency and implies a bit less work.

The second option is to clone each of your components for every language and make an appropriate file structure.
This design works well when you want to have different functionality and UI depending on the language. View full article

Set of commands for a quick Laravel install on RedHat 7.3

If you want to install Laravel on a RedHat 7.3 OS, you will have to use PHP 7.0.* as this is a Laravel minimum requirement, so this is the set of commands that I used in order to configure the needed software for Laravel. ( you can also download the set of commands as a text file below).

Also, I would like to mention that I generally prefer Nginx over Apache, and HTTPS obviously, but this is just a quick setup.

Commands:

#--- AutoStart network interface
nmtui
 
#--- Open FireWall 80
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
 
#--- Check the updated rules with:(optional)
firewall-cmd --list-all
 
#--- Delete PHP 5.4
yum list php
yum remove php.x86_64
View full article

PHP 7.0.24 Curl Bug on Windows

As you probably know running PHP on Windows is a bad idea as you can get into a plethora of problems even for a simple development setup but, when you want to test a quick script or you just want to write maybe a solution to an algorithmic problem found on some type of programmer improvement site that accepts solutions in PHP you can use of course some prebuild windows binaries from windows.php.net.

Anyway, the main gist of this mini-post is that I found a recurring bug with the CURL library, the bug has been reported before and it consists in the fact that the library will not load(even if you set up correctly php.ini) View full article