Joomla provides an auto-update feature that allows website administrators to update their installed extensions with one click. This feature requires developers to support it in their extensions. I included support for the updater in a few of my extensions, and recently I received a report from two of my customers that they could not get to update my extension. Every time they attempted to update, the would get an “Invalid extension update” error. Unfortunately, I was not able to replicate the error on any of my test servers, but I was able to figure it out after I was allowed to use one of my customers server for testing purposes. Fixing this error turned out to be very easy, and understanding why one could get the error and how to avoid it is very valuable. Continue reading “How to Fix Joomla’s “Invalid extension update””
How to Install Phing on MAMP (Mac OS X Catalina)
My PHP test server is a MAMP installation. I recently decided to upgrade my Mac OS X to Catalina, and upgraded my MAMP installation to version 5.7. This allowed me to test my code on PHP 7.4.2, and since I use Phing, I needed to reinstall it on the new PHP 7.4.2 instance. I encountered an interesting error (or technically, a notice) that I found to be very annoying, and misleading. I want to share the fix with you, and go through the steps of installing Phing together. Continue reading “How to Install Phing on MAMP (Mac OS X Catalina)”
PHP Class Name Resolution using ::class
With PHP 7+ being rolled out on many web hosting servers these days, there is an increased push to using Namespacing in PHP coding. This is also very evident in the PHP Standard Recommendations (PSR-0 [deprecated] and PSR-4 [active]) for Auto-loading defined by the PHP Framework Interop Group (PHP-FIG) that everyone seems to be following these days. One of the things that can be observed with the increase in Namespace using is the need to remember or query the fully qualified name of a class or object. This can be tricky at first glance, but evidently, since PHP 5.5, a very useful feature was added to easily get the fully qualified name of a class. This can come in very handy especially if you are creating your own PHP library or implementing a design pattern like a Factory pattern. This feature is called “Class Name Resolution” and it can be achieved by suffixing “::class” at the end of a class name, like this: ClassName::class. To demonstrate the value of this feature, I will show some example code, and also mention some useful functions that do the similar function for objects. Continue reading “PHP Class Name Resolution using ::class”
Using Javascript to get an element’s style
There are different ways to get the style of an HTML element using Javascript. The typical way that developers use to access styles of an element is the HTMLElement.style property. It is the simplest way to access style properties. However, the HTMLElement.style property has a limitation that can affect your code if you do no account for it. The HTMLElement.style property only accesses inline styles of an element, that is, styles that are specified in the style attribute of the element’s tag on the webpage. This creates a problem for most situations where the style is specified in a separate stylesheet CSS file or in a CSS style declaration in the head of the webpage. Fortunately, there is a simple way to deal with this in Javascript. Continue reading “Using Javascript to get an element’s style”
How to install Phing on WAMP Server 64 bit
I have been doing my Joomla extension development on my Macbook Pro for the last 8 years, and my setup involves some very simple tools. On my Mac, I used MAMP and BBEdit. My workflow involves using Git for version control, MAMP for testing my extension on Joomla, and Phing for building the extension. Recently, I have decided to migrate some of the work to a Windows 10 laptop, and I decided to go with WAMP Server 3.1.6 64 bit as my server testing environment.
So after installing WAMP Server on my Windows machine, I needed to setup Phing. I wanted to share my process of setting it up because I encountered some problems along the way that took quite a bit of searching to figure out. So, I hope that my steps below will help someone to have a smooth installation of Phing on their Windows machine. Continue reading “How to install Phing on WAMP Server 64 bit”