Cannot use object of type PEAR_Error as array
While trying to improve the new website of CryptoNet by integrating some feeds and xml sitemap, my Ubuntu terminal raised following error while trying to install the sfSitemap2Plugin:
>> plugin installing plugin "sfSitemap2Plugin"
Fatal error: Cannot use object of type PEAR_Error as array in /usr/share/php/symfony_1.1/lib/plugin/sfPearRestPlugin.class.php on line 92
Now we will try to solve this! There are two possible reasons:
- symfony has a problem to raise an error
- the plugin is not compatible with this version of symfony (ie 1.1.1, instead of 1.1.0)
First check the dependencies in the package.xml file of the plugin. Just download the pear package from the plugin page, and extract it to your desktop. Open package.xml. In my case the max version of Symfony had to be 1.1.0, and since I'm using 1.1.1 that could be the problem causing this fatal error message.
Next step is to change these requirements and archive the whole package. Change the Symfony dependency to:
<dependencies>
<required>
<php>
<min>5.1.0</min>
</php>
<pearinstaller>
<min>1.4.1</min>
</pearinstaller>
<package>
<name>symfony</name>
<channel>pear.symfony-project.com</channel>
<min>0.8.1</min>
<max>1.2.0</max>
<exclude>1.2.0</exclude>
</package>
</required>
</dependencies>
Save the file, and make an archive of the package.xml AND the plugin folder (in my case sfSitemap2Plugin-0.0.2). You can archive it to .tar for example. Rename it to .tgz afterwards.
Final step we have to do is install the plugin, with the path to your self-made archive. Get back to your terminal and execute following command (of course you need to change the path according to yours):
symfony_1.1 plugin:install /home/../sfSitemap2Plugin-0.0.2/sfSitemap2Plugin-0.0.2.tgz
In my case I use symfony_1.1 for my Symfony 1.1 commands. Don't forget to change this if you used to using "symfony".
Thanks to Johny_the_french for this solution.
Symfony plugins page provides better overview
The plugin section on the Symfony framework website has been improved...a lot! The problem was, after Symfony 1.1 was released, users couldn't see if a plugin was suitable for Sf 1.1, or only for 1.0.x.
I recently created a Symfony 1.1 project for the new CryptoNet website, for which I needed a couple of plugins to experiment with, such as SIFR and TextReplacement. The plugins weren't ready to install them with the refactored plugin system of Symfony, but I managed to install them manually.
With the reorganised section on the official website, you are able to get a list of all plugins, only those for Sf 1.0.x or 1.1 or 1.2. A nice extra feature is that developers can claim their plugins, so other users can search for all the plugins created by a certain developer.
On the right side in de plugin section one block in particular is sweet, to view the recently updated plugins:
A nice stats block is inserted. At the time of writing, these were the totals:
- 212 plugins
- 106 developers
- 3651 users
Nice improvement guys! I will take a deeper look into the plugins available for 1.1, and make a decision to upgrade or keep working with 1.0.x for a brand new version of X-Power.be.
What do you think of the new layout and function on the plugin page?
Upgrade Symfony plugins
Door een probleem in het 'PEAR channel' van het hele Symfony project, werd bij het installeren van een plugin steeds de oudste versie genomen, in plaats van de laatste. Eventuele bugs en foutieve code zijn vervolgens aanwezig, en kunnen de ontwikkelaar weer wat kostbare tijd laten verliezen.
Dit probleem is opgelost, en je kan op makkelijke wijze de geïnstalleerde Symfony plugins vervangen door hun meest recente versie. Bekijk je lijst met plugins met het volgende commando:
php symfony plugin-upgrade symfony/myPluginNamePlugin
Upgrade elke plugin individueel door het volgende commando aan te roepen:
php symfony plugin-list
Vergeet dus niet je Symfony plugins te upgraden! Er wordt bijna dagelijks gewerkt aan verschillende bestaande en nieuwe uitbreidingen. Er zijn ongeveer een 210 nieuwe plugins in ontwikkeling om de wensen van de webontwikkelaar tegemoet te komen. Gaande van een ORM vervanging tot een integratie met Facebook.

