How to use phan/phan for backwards compatibility (PHP 5.6 -> 7.2) - compatibility

I'm planning to move my PHP project from PHP 5.6 to PHP 7.2. I wanted to use phan\phan to that end but it checks every programming mistakes under the sun.
Could someone show me how to just run the backward_compatibility_checks filter (or suggest some other actively maintained/non-deprecated tools to do this)
Thanks in advance

Related

Is php 7.2 mandatory for wordpress?

I was told that a current wordpress version requires php 7.2 or newer. Is that true? Or to put it another way: to what extent is it mandatory to use php 7.2 for Wordpress? Are there any safety reasons? Isn't php 7.0 enough? Wordpress reads that they require php 7.2. > Wordpress Recommendations
No, the article you linked clearly states the following:
We recommend your host supports:
PHP 7.2 or greater
If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.2.4+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.
As you can see, WordPress will work even with PHP 5.2 and PHP 5.3, etc., but it is recommended to use recent versions instead.

Test an app created in django 1.4 for compatibility with django 1.7

I have an existing application developed in django 1.4. I want it to upgrade to django 1.7.
I can make the changes if some modules are deprecated since i don't need the backward compatibility. For this i need more information on which part of my application needs to be modified. So a testing tool that scans my application, and tells what needs to modified would be much better.
Is there any tools as such? If so, please guide me through it.
Thanks.
----Edit----
There is no such software available :(
Read thru the release notes and change your code if necessary.
{% url viewname %}
in 1.4 has become since 1.5
{% url 'viewname' %}
And no need for south application since its built in now since 1.7
And "commit_on_success()" has become "atomic()" since 1.5 i think.
I dont think, there is a tool which upgrades your code for you. I would say, just upgrade your django, run your lokal page and fix all deprecation/old-code errors.. this is how i find out what has been changed ;)

Does anyone know how to fix the lag that exists in STS 3.1 when switching to JSP's?

We are seeing a lag of about 5-7 seconds when switching to JSP's in the latest release of STS, version 3.1.0. Has anyone else experienced this and know how to fix it (other than not using the JSP editor which is not a preferable option)? We are considering rolling back to an older release as this is such an irritation.
Also posted to Spring Forums: http://forum.springsource.org/showthread.php?131299-STS-3-1-JSP-editor-lag
Edit: Confirmed, STS 3.1 - e3.8 does not have the JSP lag!
Make sure that you are using the Eclipse 3.8 version of STS. The 4.2 version of Eclipse is known to have some performance issues, especially when switching editors.

How to upgrade drupal modules?

In my case I'm upgrading the memcache module,though there's a README.txt but it seems not operable :
1. Install the memcached binaries on your server. See http://www.lullabot.com/articles/how_install_memcache_debian_etch
2. Install the PECL memcache extension for PHP. This must be version 2.2.1 or higher or you will experience errors.
3. Put your site into offline mode.
4. Download and install the memcache module.
5. If you have previously been running the memcache module, run update.php.
6. Apply the DRUPAL-5-x-cache-serialize.patch from the patches folder that
comes with the module. Version specific, so use DRUPAL-5-6-cache-serialize.patch
if you are running Drupal 5.6.
7. Start at least one instance of memcached on your server.
8. Edit settings.php to configure the servers, clusters and bins that memcache
is supposed to use.
9. Edit settings.php to include either memcache.inc or memcache.db.inc. For
example, $conf['cache_inc'] ='sites/all/modules/memcache/memcache.db.inc';
10. Bring your site back online.
Especially step4, does it mean just unpack the module and replace all stuff in original directory?
My current memcache version is 5.x-1.9 and there's 5.x-1.10 available,but I don't see it available at admin/logs/updates
Step 4 means that you remove the old module directory completely and only then unzip the new module code. You don't want any remnants of the old code.
Also note, that
Not all module developers think the same about dot releases: sometimes 1.2 and 1.3 are major rewrites or come with completely new features, themeable-functions, pages or APIs.
Not all upgrades are compatible with others. Sometimes you cannot update module B to 1.4, because of its dependency with A, A seems not compatible with 1.4 (yet). Drupal does not support dependencies on versions.
Major releases imply (but do not guarantee) incompatibility, or even complete rewrites: Upgrading from 5.x-1.4 to 5.x-2.1 might force major rewrites of custom code, including your theme.
Security updates often are dependent on earlier releases: 6.x-1.2 might introduce new features (that you do not want, or wish to ignore), 6.x-1.3, can be a security-release that requires (some of the) the changes in 6.x-1.2 to be available. You must then either fiddle around with patches, or go trough that feature release anyway.

upgrading drupal 4.7 to 5.2

When I was upgrding my webite from drupal 4.7 to 5.2, I am facing an issue -
Fatal error: Call to undefined function node_get_base() in ../question.module.
Can any one help me to solve it...
Thanks in advance
The root of your problem is that you have some code in the file question.module calling a deprecated function (node_get_base()). Drupal 5.2 does not implement anymore that function so you get the error...
I assume that the question.module you are using is this one, which does exist for Drupal 5 series. If I am right, then I suspect you have missed to follow the upgrade instructions for updating your site which state:
5) Disable all custom and contributed modules.
[..]
11) Ensure that the versions of all custom and contributed modules match the new Drupal version to which you have updated. For a major update, such as from 5.x to 6.x, modules from previous versions will not be compatible and updated versions will be required.
12) Re-enable custom and contributed modules and re-run update.php to update custom and contributed database tables.
These instructions are in the UPGRADE.txt file in the Drupal root folder.
Hope this helps!
When upgrading Drupal to a new release, you more or less in some respects have to build the site over again. The thing is, that because the Drupal API changes to much in the new releases, each module will need to be replaced with a new one. In most cases this is just a matter of downloading a new version of the module and running update.php.
You should, however, go through each of your modules and find out what's needed to make the upgrade. Sometimes the upgrade path can be a bit tricky and you need a few attempts to get it right without corrupting any data in the process.
Another thing is, that when upgrading, going for the drupal 5 version of the same module might not always be the best choice. Especially when talking about Drupal 5, there are a lot of more or less unmaintained modules. So the best choice might be to find a different module that can do what you want, or even fulfill more of your needs.
It's always a hard decision and your theme will also need to be upgraded to Drupal 5. In short there is a lot of work evolved when doing a major upgrade. Most of it, is making some good choices about, which modules to use and how to migrate your data.
All that aside, following the upgrade guide in UPGRADE.txt like mac suggests is a very good place to start, and doing all of this leg work, would probably have avoided all this.

Resources