/** * This class implements the Singleton pattern. There is only ever * one instance of the this class and it is accessed only via the * ClassName::instance() method. * * @return object * @access public * @since 5/26/05 * @static */ public static function instance() { if (!isset(self::$instance)) { self::$instance = new Segue1UrlResolver(); } return self::$instance; }
/** * Execute * * @return mixed * @access public * @since 4/3/08 */ public function execute() { // Add in RequestContext data from URLs that were converted to Segue2 format, // but retain Segue1 parameters $get = array('action' => 'site'); $segue1Identifiers = array('site', 'section', 'page', 'story'); foreach ($segue1Identifiers as $key) { if (!isset($get[$key]) && RequestContext::value($key)) { $get[$key] = RequestContext::value($key); } } $resolver = Segue1UrlResolver::instance(); $resolver->resolveGetArray($get); // If the resolver didn't forward us, try just going to the site listed. if (isset($get['site'])) { RequestContext::sendTo(MYURL . "/sites/" . $get['site']); } else { throw new NullArgumentException("Could no resolve URL, no site specified."); } }