PacketFence - BTS - PacketFence
View Issue Details
0001001PacketFencerefactoringpublic2010-06-01 03:292011-01-26 15:42
obilodeau 
obilodeau 
normalminorN/A
closedfixed 
 
2.0.0 
e5d3aeb36b6ea84309beaab5d1a881bcdcd0bb4d
0001001: constants are not inherited in our <xxx>/custom.pm modules
Another flaw of perl constants is that they are not inherited when a class is extended using 'use base (...)'.

This is problematic when we are extending our radius module since we need to remember to re-create the constants in the sub-module.

We can probably fix that with an our Readonly constant instead of the constant pragma.
No tags attached.
has duplicate 0001012closed obilodeau move radius constants in pf::config 
Issue History
2010-06-01 03:29obilodeauNew Issue
2010-06-01 03:29obilodeauStatusnew => assigned
2010-06-01 03:29obilodeauAssigned To => obilodeau
2010-06-01 03:55obilodeauNote Added: 0001571
2010-09-08 16:07obilodeauNote Added: 0001649
2010-09-13 16:35obilodeauNote Added: 0001656
2010-09-14 14:59obilodeaumtn revision => e5d3aeb36b6ea84309beaab5d1a881bcdcd0bb4d
2010-09-14 14:59obilodeauNote Added: 0001657
2010-09-14 14:59obilodeauStatusassigned => resolved
2010-09-14 14:59obilodeauFixed in Version => trunk
2010-09-14 14:59obilodeauResolutionopen => fixed
2010-10-28 12:57obilodeauRelationship addedhas duplicate 0001012
2010-12-15 11:37obilodeauFixed in Versiontrunk => 2.0.0
2011-01-26 15:42obilodeauStatusresolved => closed

Notes
(0001571)
obilodeau   
2010-06-01 03:55   
ok, turns out that a simple
Readonly::Scalar our $CONST => 666;
isn't going to be accessible in sub classes.

However, using $this->{CONST} will work as expected.

see http://docstore.mik.ua/orelly/perl3/prog/ch12_07.htm [^] for more details
(0001649)
obilodeau   
2010-09-08 16:07   
After thinking about it, I'll fix this one with using the <module>/constants.pm approach used by SNMP modules.

Do this for pf::vlan and pf::radius in trunk branch.

Add tests: critic, pf and pod.

I'll need to doublecheck what is our RPM file going to do about that (if constants aren't going to be upgraded, I'll need to keep UPGRADE up to date)
(0001656)
obilodeau   
2010-09-13 16:35   
partial fix (for pf::vlan::custom) in revno af6b0ba2312e5d380222742e9fc99ae4025739bf

Since pf::vlan defines no constants, no need for a specific vlan/constants.pm yet. So I only imported all deps from pf::vlan into pf::vlan::custom to avoid people facing compilation problems when redefining subs using upstream code.
(0001657)
obilodeau   
2010-09-14 14:59   
New file pf::radius::constants used by both pf::radius and pf::radius::custom. Closes this request.