A_WordPress_Router

Class A_WordPress_Router.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php  
  1. class A_WordPress_Router extends Mixin 
  2. function get_url($uri = '/', $with_qs = TRUE, $site_url = FALSE) 
  3. static $cache = array(); 
  4. $key = implode('|', array($uri, $with_qs, $site_url)); 
  5. if (isset($cache[$key])) { 
  6. return $cache[$key]; 
  7. } else { 
  8. $retval = $this->call_parent('get_url', $uri, $with_qs, $site_url); 
  9. // Determine whether the url is a directory or file on the filesystem 
  10. // If so, then we do NOT need /index.php as part of the url 
  11. $base_url = $this->object->get_base_url(); 
  12. $filename = str_replace($base_url, C_Fs::get_instance()->get_document_root(), $retval); 
  13. if ($retval && @file_exists($filename) && $retval != $base_url) { 
  14. // Remove index.php from the url 
  15. $retval = $this->object->remove_url_segment('/index.php', $retval); 
  16. // Static urls don't end with a slash 
  17. $retval = untrailingslashit($retval); 
  18. $cache[$key] = $retval; 
  19. return $retval;