Skip to content

Instantly share code, notes, and snippets.

@gautamk
Created February 3, 2012 15:01
Show Gist options
  • Save gautamk/1730574 to your computer and use it in GitHub Desktop.
Save gautamk/1730574 to your computer and use it in GitHub Desktop.
<?php
require_once 'Zend.php';
require_once 'Zend/Uri/Exception.php';
require_once 'Zend/Uri/Http.php';
require_once 'Zend/Uri/Mailto.php';
abstract class Zend_Uri
{
/**
* Return a string representation of this URI.
*
* @see getUri()
* @return string
*/
public function __toString()
{
return $this->getUri();
}
static public function factory($uri = 'http')
{
$uri = explode(':', $uri, 2);
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) ? $uri[1] : '';
// Security check: $scheme is used to load a class file,
// so only alphanumerics are allowed.
if (!ctype_alnum($scheme)) {
throw new Zend_Uri_Exception('Illegal scheme');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment