In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
475 [In-Portal CMS] Optimization task always 2009-12-23 02:24 2012-07-25 05:33
alex  
!COMMUNITY  
normal  
closed 5.0.2-B1  
fixed  
 
none 5.2.0-B1  
http://groups.google.com/group/in-portal-dev/browse_thread/thread/21f5102cb136107e?hl=en
2
0000475: Inappropriate "eval" usage in kBase::makeClass method
Method kBase::makeClass is calling ref_call_user_func_array no matter if he has only class name or class name + constructor arguments passed. This slows downs the things a little bit. I propose to use code, mentioned above, that was called from kFactory class to optimize things.

if ( func_num_args() == 1 ) {
    $class = new $real_class();
}
else {
    $func_args = func_get_args();
    $pseudo_class = array_shift($func_args);
    $class =& ref_call_user_func_array( Array ($real_class,'makeClass'), $func_args );
}

-------------------------

Also kDBLIst class constructor during filter creation calls makeClass 13 times, but there are only two class types it creates, so we could create two classes and just clone them to create other fiters. Here is problematic code:

$filters = $this->getFilterStructure();

foreach ($filters as $filter_params) {
    $filter =& $this->$filter_params['type'];
    $filter[ $filter_params['class'] ] =& $this->Application->makeClass('kMultipleFilter', $filter_params['join_using']);
}
Issue History
2012-07-25 05:33 alex Note Added: 0005082
2012-07-25 05:33 alex Status resolved => closed
2011-10-22 05:37 alex Estimate Points => 2
2011-09-27 05:06 alex Status reviewed and tested => resolved
2011-09-27 05:06 alex Fixed in Version => 5.2.0-B1
2011-09-27 05:06 alex Resolution open => fixed
2011-09-27 05:05 alex Note Added: 0003922
2011-09-27 05:05 alex Status needs testing => reviewed and tested
2011-09-27 05:05 alex Note Added: 0003921
2011-09-27 05:05 alex Assigned To => !COMMUNITY
2011-09-27 05:05 alex Developer => alex
2011-09-27 05:05 alex Status active => needs testing
2011-09-24 05:14 alex Note Added: 0003893
2011-09-23 21:54 Dmitry Target Version Icebox => 5.2.0
2009-12-23 02:24 alex Target Version => Icebox
2009-12-23 02:24 alex New Issue
2009-12-23 02:24 alex Reference => http://groups.google.com/group/in-portal-dev/browse_thread/thread/21f5102cb136107e?hl=en

Notes
(0003893)
alex   
2011-09-24 05:14   
This maybe is already done. Needs to be checked.
(0003921)
alex   
2011-09-27 05:05   
This was already done during mass refactoring in 5.2.0
(0003922)
alex   
2011-09-27 05:05   
Will test later on.
(0005082)
alex   
2012-07-25 05:33   
Since 5.2.0 version was released.