3

We started Joomla extensions development from Version 2.5. During those days, we went through many training materials and able to complete the extension. Later as many releases evolved, and whenever we hit a problem on any method or functionality (due to deprecation/removed) we managed to search in the internet (Joomla official site or stackexchange or any other) and able to find its equivalent.

Our components are now working in 3.9 version and we are pretty sure many of the functions which we are using in our extension are deprecated.

Is there a common place where we can identity which functions are deprecated in X release and what is their equivalent in the newer release?

3

You may find using the proper/current classes will also help you in getting your code base up to current levels and ready for Joomla 4, which in turn might highlight some old functions that you need to look at.

I followed the instructions on https://groups.google.com/forum/#!topic/joomla-dev-general/el58Gh_6wUg to generate the file of deprecated classes and then keep it handy when PHPStorm tells me the current class is or will be deprecated.

Instruction to generate the file: If you have the CMS repo checked out locally, run the build/stubGenerator.php script and stub classes for everything that was renamed at 3.8 will be created.

A sample of the file generated:

<?php
/**
 * @deprecated 5.0 Use Joomla\Registry\Registry instead.
 */
 class JRegistry extends Joomla\Registry\Registry {}

/**
 * @deprecated 4.0 Use Joomla\Registry\AbstractRegistryFormat instead.
 */
 abstract class JRegistryFormat extends Joomla\Registry\AbstractRegistryFormat {}

/**
 * @deprecated 5.0 Use Joomla\Registry\Format\Ini instead.
 */
 class JRegistryFormatIni extends Joomla\Registry\Format\Ini {}
....

The file is created from the PHPDoc comments in the core code and the API documentation identifies deprecated functions from the same comments so there maybe an equivalent utility available that looks at the methods/functions to provide a list.

| improve this answer | |
  • Thanks. Created the stubs.php and I am to see the deprecated functions in Eclipse itself. I got many other queries now :-) will ask on seperate threads. Thanks. – Malaiselvan Apr 23 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.