Fatal error when including a external PEAR class-file!
Posted: Thu Sep 29, 2005 2:34 am
Hello Garvin, hello s9y-team,
As you poperly know, I'm just writing this backup-plugin, which provides automatic backup-functions for backupping the whole s9y file-structure, the database or only some database-tables.
This plugin needs some include_once("Archive/Tar.php"); to pack the sql-backup into .tar.gz.
This all works quiet well with serendipity-0.8.4, but I've updated to 0.9-alpha5 today and since this update the plugin complains the following, when including "Archive/Tar.php":
Fatal error: Cannot redeclare class pear in /usr/share/php/PEAR.php on line 73
This seems to be caused by the require_once() functions, which you are using to include the pear classes in the bundled-libs directory, because require_once results in a fatal error, when it fails.
Maybe you should replace these require_once() to include_once(). Then there should be no problem anymore with already declared pear classes.
I'll try this with my s9y and will report the succes or even the failure.
[edit]
Hmm... it seems that only a few plugins uses require_once to include files from the bundled-libs directory...
Well, I'll try to replace them anyway...
[/edit]
As you poperly know, I'm just writing this backup-plugin, which provides automatic backup-functions for backupping the whole s9y file-structure, the database or only some database-tables.
This plugin needs some include_once("Archive/Tar.php"); to pack the sql-backup into .tar.gz.
This all works quiet well with serendipity-0.8.4, but I've updated to 0.9-alpha5 today and since this update the plugin complains the following, when including "Archive/Tar.php":
Fatal error: Cannot redeclare class pear in /usr/share/php/PEAR.php on line 73
This seems to be caused by the require_once() functions, which you are using to include the pear classes in the bundled-libs directory, because require_once results in a fatal error, when it fails.
Maybe you should replace these require_once() to include_once(). Then there should be no problem anymore with already declared pear classes.
I'll try this with my s9y and will report the succes or even the failure.
[edit]
Hmm... it seems that only a few plugins uses require_once to include files from the bundled-libs directory...
Well, I'll try to replace them anyway...
[/edit]