Tinkerwell: Tinker with your local/remote PHP & Magento 2 Code

Tinkerwell: Tinker with your local/remote PHP & Magento 2 Code

I was always looking for a quick playground for testing/debugging any PHP application esp. for Magento 2. Luckily, I got to know about Tinkerwell App in some twitter feed and thought of giving a try. [email protected] + Magento 2 is a great combo. It allows me to SSH into the server and execute code on …

Read more

Sending JSON data to the remote server

Sending JSON data to the remote server

JSON: JavaScript Object Notation. JSON is syntax for storing and exchanging text information. Much like XML. JSON is smaller than XML, and faster and easier to parse. You may need to post JSON data to the server for different purposes. If you are wondering about ‘How to send JSON data to the remote server?’ then …

Read more

Using get_defined_vars() for debugging local scope variables

Suppose say, you want to debug variables in some observer method. You can either log each variable or simply dump it. But when you have many variables, debugging each variable can be an overhead task. For this purpose we can use PHP’s inbuilt function: get_defined_vars() How to use it? //put this line at the top …

Read more

is_file() vs file_exists()

Introduction If you do not know how to use is_file() and file_exists() properly, then you will end up pulling out your hair. Here we will talk about a scenario which will clarify the usage of is_file() vs file_exists(). Case: We are trying to show the gallery images from a table which has the field: ‘imagepath’ …

Read more