We should add a hook_requirement that checks if 'Archive/Tar.php' is installed or not and prevents module activation/installation if not installed.

CommentFileSizeAuthor
#6 l10n_archive.patch2.14 KBmeba

Comments

gábor hojtsy’s picture

In Drupal 5, contributed module hook_requirements() are not called anyway, as a Drupal 6 bug report revealed. So although we can implement this, it does not have an effect until a Drupal 6 upgrade.

gábor hojtsy’s picture

What we can do is to try to fopen() the Tar.php file (fopen() allows us to check on the include path as well), and if it does not work, bail with an error. Although I think fopenning the Tar.php file every case when an archive is to be extracted is a bit overkill. Any better ideas?

hass’s picture

Maybe we could only take a look for a variable like "l10n_server_tar_libary_exists=1" and if 0 it hasn't been checked or configured yet. After it has been checked once we are fine... maybe re-check every day/week with cron. However this is not a perfect solution...

meba’s picture

Status: Active » Postponed (maintainer needs more info)

I don't think this is an overkill. Imagine you have to do much more when extracting a file. One fopen() more is just a little bit...I am willing to try writing a patch if there is a consensus on it.

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Active

Yeah, really, you are right. Let's do that :) Looking forward to a patch.

meba’s picture

Status: Active » Needs review
StatusFileSize
new2.14 KB

Rolling

brmassa’s picture

Status: Needs review » Reviewed & tested by the community

Jakub,

nice work. tested.

I might also suggest a hook_requirement() implementation.

regards,

massa

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

I've just committed a slightly modified version of this patch. I modified code comments, wrapped messages in t() (required in Drupal 5 for both drupal_set_message() and watchdog()). Also fixed the message in the extractor. It said "extracting translations" while it does "extracting translatable text", not the translations :)

Thanks for the patch!

brmassa: I'd suggest you read http://drupal.org/node/203623#comment-669093 above. I have added @todos to the code however to that effect, so we can look into this when upgrading.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.