Cluries‘ Tw2other is a PHP program that allows you to broadcast your Twitter tweets to popular Chinese social networks, such as 人人网 and 新浪微博. However, as in version 1.0, the author decided to completely rewrite the codes of previous versions, and it’s in an incomplete state at the moment. If you try to run the install.php, you will get the following error:
Class ‘Template’ not found in /tw2other/modules/init/func.inc.php on line 76
I have looked into the problem. As a result, I found that the problem is caused by spl_autoload function, which didn’t load the required class Template as expected. The following code in modules/init/Loader.php doesn’t work for me:
1 2 3 |
set_include_path ( $dir ); spl_autoload_extensions('.php'); spl_autoload($clazz); |
which works after I changed to:
1 2 3 4 5 6 |
$file = "$dir/$clazz.php"; if (!file_exists($file)) { return false; } include $file; |
I also found another problem in library/renrenoauth.php. Here are my two patches if you want to make the Tw2other beta 1.0 work. Just download them and replace the original.