Make Links with cms_join_path faster

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
pb
Forum Members
Forum Members
Posts: 27
Joined: Sun Jun 01, 2008 8:41 pm

Make Links with cms_join_path faster

Post 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.
Post Reply

Return to “Tips and Tricks”