Joomla! 2.5 checking code for deprecated classes / methods - joomla

How can I check my extensions for deprecated Joomla! API code?

This is to be done on a development machine, not on the production website!
The most basic way to check for deprecated code is to enable the System Debug Plugin and to enable the option "Log deprecated API".
After this in logs/deprecated.php you will find the entries.
Now, there will be lots of deprecated code loged and you need to identify it in your code.
A complementary option would be to use an IDE like Eclipse + PDT where you can get this info while you are coding:

Related

Ruby Version required 2.4.1 for windows

I am looking for an migration from assembla to jira, For this i need Ruby version 2.4.1(windows exe file) but i am unable to find it anywhere still now . can anyone share me the link. so, i will be able to complete my task.
Go to https://rubyinstaller.org/downloads/archives/ and download the version you want.
These are specifically for Windows users.
Looks like the v2.4.1 exe is https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z
But if you’re OK with v2.4.10 - and I’d highly recommend that you try it, it will have security and big fixes which 2.4.1 lacks and will likely be compatible with anything which requires 2.4.x - then download this exe https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.10-1/rubyinstaller-devkit-2.4.10-1-x64.exe which includes the basic gems you’ll also need.

QtCreator: Configure default build types

(Disclaimer: I'm not sure if SO is the right place to ask this. If not I'd appreciate pointing me to a better place.)
Whenever I open a new cmake project in QtCreator (basically all newer versions, let's say 4.3+) my default kit is select with the following build types:
Default
Debug
Release
Release with Debug Information
Minimum Size Release
All these options are enabled by default and I have to manually disable them (I only want Debug and Release most of the time).
Is there a way to configure this?
(I've looked through the kit configuration pages and tried to consult google/qtcreator help topics.)

Developing Firefox Addon for multiple SDK version

I see each cfx tools always produce xpi with its own minVersion and maxVersion. However, those are limited to the versions which the SDK is compatible with, e.g. SDK 1.14 only for FF 21 - 25.0a1 , SDK 1.17 only for FF 26 - 30. My questions are:
Do I need to package my extension with new SDK everytime new version comes out ?
How do I maintain and update my extension in the future? Does Addon Developer Hub provides a way to submit the same extension for multiple SDK versions ? I tried to look around but couldn't find a way to submit multiple versions.
I want to make FF 21 as the minimum version, since that's the version which has SDK built-in. My extension currently compiles with both SDK 1.14 and SDK 1.17 with only cosmetic(syntax) adjustment.
The developer hub lets you choose which versions of Firefox the add-on is compatible with. This is just a GUI for setting the minVersion and maxVersion in the install.rdf. As long as you don't use modules or methods that require Firefox 22+, it shouldn't matter which version of the SDK you use, as the version of the SDK being run is determined by the version on your user's browser.
It's hard to find module specific compatibility (you can always go to the docs for the specific module and look at the edit history), but have a look at the SDK API Lifecycle to understand which modules can be used. Some notable example are:
The new UI modules require FF29 and some of their features require FF30.
The widget module is deprecated from FF 29 onwards, being replaced by the above.
One way to handle the above for backward compatibility is to do the following:
const { version } = require('sdk/system/xul-app');
if (version < 29) var widget = require("sdk/widget").Widget({...});
else var button = require("sdk/ui/button/action")({...});
So, to be clear:
It doesn't matter which version of the SDK you use unless you want to use new modules.
No, you shouldn't make multiple versions of your add-on. If you want to use new modules for new browsers, follow the code example above.
It's true that you must use valid existing application versions but you generally don't need to repackage your addons, unless of course a change in the SDK directly affects your addons.
The reason for this is that by default the max target version is not going to be checked.
From the install manifest documentation:
strictCompatibility
A Boolean value indicating if the add-on should be enabled when the version of the application is greater than its max version. By default, the value of this property is false meaning that the compatibility checking will not be performed against the max version.
<em:strictCompatibility>true</em:strictCompatibility>
Usually, there is no need to restrict the compatibility: not all new releases will break your extension and, if it is hosted on AMO, you'll get notice several weeks in advance if a potential risk has been detected. Moreover, an extension being disabled, even for a short period, leads to a bad experience for the user. About the only time you should need to set this if your add-on does things that are likely to be broken by Firefox updates. You do not need to set this flag if your add-on has a binary component, since add-ons with binary components are always subject to strict compatibility checking (because binary components need to be rebuilt for every major application release anyway).
There is also is a recommendation for choosing version ranges.
minVersion and maxVersion should specify the range of versions of the application you have tested with. In particular you should never specify a maxVersion that is larger than the currently available version of the application since you do not know what API and UI changes are just around the corner. With compatibility updating it is not necessary to release a whole new version of the extension just to increase its maxVersion.
Technically you can use wildcards, but the documentation mentions several times that AMO verifies and possibly rejects addons with incorrect versions.

SonarQube setup for PHP/Symfony

I'm trying to setup SonarQube 4.2 for a PHP/Symfony Project but when i want to configure quality profiles i only find "PHP> Sonar Way" Rules, with the old version (on the same server ) i have PHPCS & PHPMD rules & Zend Rules, did i miss something ?
I also want to add a custom rules files, in old versions it was in $SONAR_SRC/extensions/rules/ but it don't seems to work now.
When i check the PHPCS configuration with "phpcs- i" i have the following results : The installed coding standards are PHPCS, PSR2, PSR1, MySource, Zend, Squiz, PEAR and Symfony2
(I want to use Symfony2 profile)
This does not seem to be supported anymore, since PHP CodeSniffer has been dropped.
It seems that custom rules are first tested for Java, and if successful will be added for PHP profiles as well.
PSR-2/1 profiles are about to be added in the upcoming release though: http://jira.codehaus.org/browse/SONARPHP-293
See http://sonarqube.15.x6.nabble.com/How-to-add-code-sniffer-standards-rules-in-sonarQube4-2-using-sonar-php-plugin-version-2-1-td5024257.html for a conversation on this.

How to debug magento application

I am working with Magento but i didn't find a very good way to debug my modules. For example, many time, i got a blank page with no php error and no apache error. For example, in backend, if one grid controller isn't well set, i don't have an error.
How to debug Magento module?
It sounds like you want to enable Developer mode. Add this to your .htaccess file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
You may also want to enable display errors in index.php:
ini_set('display_errors', 1);
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.
I've got a more detailed posting here:
https://gist.github.com/molotovbliss/2792c6c59410d75e5baf249b76413247
Consider also installing XDebug
This thread is old but useful.
Debugging tools and tricks are important as it saves lots of time of a developer.
Here is a compiled list My company Uses.
Use of Eclipse debugger: Magento is installed on a desktop using Eclipse debugger we apply breakpoints and other debugging tricks.
Use of Bug commerce as suggested in above post.
Use of Mage::log for error log and exception log.Also Magento Report files.
Use of Varien Object getData, debug.
Use of back trace: Mage::log(Varien_Debug::backtrace(true, true), null, 'backtrace.log')
Remote server level debugging.
var_dump PHP function to echo and exit.
If you are (want to be) a real Magento Developer, here is the best combination of IDE and plugin you must use to work on your Magento Projects.
First of all, phpStorm the best IDE you can find.
Exist a very helpful plugin called magicento that you can use auto-complete, find in path magento, create modules very quickly and without issue, other great stuff you can use with that plugin.
Of course need to install Xdebug (be carefully if you already run a project with ioncube, bc you need to make some trick there, Xdebug doens't work properly with ioncube loader).
This last item on the list is something I need to be reviewing but I think should be great to debugging porpoises, MagentoDebugger Chrome App.
Let me know if you need something else or any help installing some of the stuff.
Best,
Alejandro.
You can look in var/log/exception.log or system.log in the magento root. These are the directories for Magento excepetions and logs. Otherwise you might need to increase the php error log level.
Alan Storm created a Commerce Bug to help with some inline development issues.
Please try to use this magento debugger, it's chrome extension. http://w3site.org/magento_debugger it's realy speeds up a work. Just need to configure on the backend once and use Chrome extension.
Here easy to debug blocks, mails. Easy profile your extensions, etc.

Resources