The simplehtmldom PHP lib has its funcs unprefixed..

The most probable reason for name collisions is when someone would use another copy of the same library ..

Either before this module is installed or aftrer.

Currently the module checks for function's existance but sth is not right since this seems not to work...

EDIT: It seems that there is a stupid bug in the module causing this... The function_name var is empty...

Comments

rsvelko’s picture

Category: bug » task
Priority: Normal » Minor

I will clean this up someday, maybe :) Until then - all other modules that need simplehtmldom - Please, just use this module! Or make me use your module and trash this one - if you've got sth better.

xurizaemon’s picture

Category: task » bug
Priority: Minor » Normal
Status: Active » Needs work
if (!class_exists('simple_html_dom_node') ) {
  require_once('simplehtmldom/simple_html_dom.php');
}

No need to define a $function_name variable if you're only using it once. Just check for the existence of the Simple_HTML_DOM class and you're gold.

That doesn't resolve the issue of the function names being unprefixed. As you're embedding the library in your module, 3rd Party Modules in Drupal CVS suggests it's OK to rename those functions to prefix them to Drupal coding standards.

If you're not doing that then it seems (to me) more sensible to just use sites/all/libraries and require_once() as required.

Konstantin Komelin’s picture

Konstantin Komelin’s picture

Status: Fixed » Closed (duplicate)