Created
February 3, 2012 15:01
-
-
Save gautamk/1730574 to your computer and use it in GitHub Desktop.
Some random code from http://softwaremaniacs.org/media/soft/highlight/test.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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