Hello
Here is the actual php code I'm trying to convert to nodejs:
if(in_array($name, $this->m_names))
{
$this->m_rules[$name][] = $rule;
return $GLOBALS[$name];
}
$cmd = "\$$name = new GTCM_GNP(\$dat_file, \$server, \$port);";
eval($cmd);
if(!$$name)
{
$err_msg = "Cannot register, GTCM_GNP constructor failure.";
catch(throw(__FILE__, __LINE__, "register", 1, $err_msg));
return FALSE;
}
$this->m_cnt++;
$this->m_names[] = $name;
$this->m_rules[$name] = array($rule);
return $$name;
}
function lookUp($gvn_name)
{
foreach($this->m_rules as $name => $rule)
foreach($rule as $r)
if(ereg($r, $gvn_name))
return $name;
return null;
}
/* Usage: $dir->unregister("db1"); */
function unregister($name)
{
if(!in_array($name, $this->m_names))
return;
$rule = $this->m_rules[$name];
$this->m_rules = array_diff($this->m_rules, array($rule));
$this->m_names = array_diff($this->m_names, array($name));
$this->m_cnt--;
}
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.