Page 1 of 1

Make Links with cms_join_path faster

Posted: Mon Jun 09, 2008 7:41 am
by pb
Since version 0.14 never changed but the most used function is function cms_join_path in misc.functions.php.

This version  is nearly 20% faster.

Code: Select all

function cms_join_path()
{ 		  
  foreach (func_get_args() as $k =>$a)
     
    if ($k>0) 
       $path .= DIRECTORY_SEPARATOR.$a;
    else
       $path = $a;    
    
  return $path;
}
It is not the big bang but the function is in use nearly 100 times by calling the page home and so the result is some ms better.