PHP 5.2 : Autoload/Composer not compatible!
Hi, we have php 5.2 running and wanted to check the compatibility - but had to realise that even this plugin is not compatible :D Any suggestions?
(this starts with require_once( __DIR__ . '/../vendor/autoload.php' ); which we fixed but finally we had to stop at Class 'Composer_Autoload_ClassLoader' not found in /homepages/27/d77566712/htdocs/wp-content/plugins/php-compatibility-checker/vendor/composer/autoload_real.php on line 23 as we tried to fix the new statement)
@Stephanowicz I strong recommend to upgrade PHP version. The last release of PHP 5.2 was in June 2011.
If it's impossible for some reasons then replace __DIR__ to dirname(__FILE__) in plugin's files
Well, this was the idea! :D
And therefore we wanted to run this plugin....
As I wrote, we managed to fix the __DIR__ thing but got stuck with the new command
@Stephanowicz, well. I opened autoload_real.php and see next line:
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
You can try like this:
$loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader;`
I am not sure, this is last your issue. I looked the .travis file and found that plugin don't tested in PHP 5.2.
@kumaxim Eh.. no, that will never work. Namespaces do not exist in PHP 5.2.
The xrstf/composer-php52 composer plugin can be used to generate an autoload file compatible with PHP 5.2 for this plugin. This should probably be included in the deployment process of this plugin (in contrast to an end-user trying to fix this for their individual install).
Thank You guys - finally we dared to upgrade to v7.0 and only had one older plugin not working, that we could fix quite easily.
Cheers, Stephan