public function setScheme($scheme)
    {
        $this->scheme = null;
        if (empty($scheme) || null === $scheme) {
            return $this;
        }
        $scheme = preg_replace('/[^a-zA-Z0-9\.\:\-]/', '', $scheme);
        $scheme = strtolower($scheme);
        $scheme = rtrim($scheme, ':/');
        $scheme = trim($scheme, ':/');
        $scheme = str_replace('::', ':', $scheme);
        if (strlen($scheme) != 0) {
            if ($this->isRelative()) {
                /* Explained: */
                /* @see Sensimity_Helper_UriTest::testRelativeAbsoluteUrls */
                $exp = explode('/', ltrim($this->getPath(), '/'));
                $this->setHost($exp[0]);
                unset($exp[0]);
                $this->setPath(null);
                $path = implode('/', $exp);
                if (strlen($path) > 0) {
                    //Only create the "/" if theres a path
                    $this->setPath('/' . $path);
                }
                $this->setAbsolute();
            }
            $this->scheme = $scheme;
        }
        return $this;
    }
public function setScheme($scheme)
    {
        $this->scheme = null;
        if (empty($scheme) || null === $scheme) {
            return $this;
        }
        $scheme = preg_replace('/[^a-zA-Z0-9\.\:\-]/', '', $scheme);
        $scheme = strtolower($scheme);
        $scheme = rtrim($scheme, ':/');
        $scheme = trim($scheme, ':/');
        $scheme = str_replace('::', ':', $scheme);
        if (strlen($scheme) != 0) {
            if ($this->isRelative()) {
                /* Explained: */
                /* @see Sensimity_Helper_UriTest::testRelativeAbsoluteUrls */
                $exp = explode('/', ltrim($this->getPath(), '/'));
                $this->setHost($exp[0]);
                unset($exp[0]);
                $this->setPath(null);
                $path = implode('/', $exp);
                if (strlen($path) > 0) {
                    //Only create the "/" if theres a path
                    $this->setPath('/' . $path);
                }
                $this->setAbsolute();
            }
            $this->scheme = $scheme;
        }
        return $this;
    }
public function setScheme ( $ scheme ) { $ this -> scheme = null ; if ( empty ( $ scheme ) || null === $ scheme ) { return $ this ; } $ scheme = preg_replace ( '/[^a-zA-Z0-9\.\:\-]/' , '' , $ scheme ) ; $ scheme = strtolower ( $ scheme ) ; $ scheme = rtrim ( $ scheme , ':/' ) ; $ scheme = trim ( $ scheme , ':/' ) ; $ scheme = str_replace ( '::' , ':' , $ scheme ) ; if ( strlen ( $ scheme ) != 0 ) { if ( $ this -> isRelative ( ) ) { /* Explained: */ /* @see Sensimity_Helper_UriTest::testRelativeAbsoluteUrls */ $ exp = explode ( '/' , ltrim ( $ this -> getPath ( ) , '/' ) ) ; $ this -> setHost ( $ exp [ 0 ] ) ; unset ( $ exp [ 0 ] ) ; $ this -> setPath ( null ) ; $ path = implode ( '/' , $ exp ) ; if ( strlen ( $ path ) > 0 ) { //Only create the "/" if theres a path $ this -> setPath ( '/' . $ path ) ; } $ this -> setAbsolute ( ) ; } $ this -> scheme = $ scheme ; } return $ this ; }
Set the scheme. If its empty, it will be set to null.

Must be a string. Can only contain "a-z A-Z 0-9 . : -".
Will be forced to lowercase.
Appended : or // will be removed.
@see Sensimity_Helper_UriTest::provideSetScheme

@param string $scheme
@return self
Set the scheme . If its empty it will be set to null .