code/filesystem/locator/factory.php
public function createLocator($path, array $config = array())
    {
        $scheme = parse_url($path, PHP_URL_SCHEME);

        //If no scheme is specified fall back to file:// locator
        $name = !empty($scheme) ? $scheme : 'file';

        //If a windows drive letter is passed use file:// locator
        if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
        {
            if(preg_match('#^[a-z]{1}$#i', $name)) {
                $name = 'file';
            }
        }

        //Locator not supported
        if(!in_array($name, $this->getLocators()))
        {
            throw new \RuntimeException(sprintf(
                'Unable to find the filesystem locator "%s" - did you forget to register it ?', $name
            ));
        }

        //Create the locator
        $identifier = $this->getLocator($name);
        $locator    = $this->getObject($identifier, $config);

        if(!$locator instanceof FilesystemLocatorInterface)
        {
            throw new \UnexpectedValueException(
                'Locator: '.get_class($locator).' does not implement FilesystemLocatorInterface'
            );
        }

        return $locator;
    }
public function createLocator($path, array $config = array())
    {
        $scheme = parse_url($path, PHP_URL_SCHEME);

        //If no scheme is specified fall back to file:// locator
        $name = !empty($scheme) ? $scheme : 'file';

        //If a windows drive letter is passed use file:// locator
        if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
        {
            if(preg_match('#^[a-z]{1}$#i', $name)) {
                $name = 'file';
            }
        }

        //Locator not supported
        if(!in_array($name, $this->getLocators()))
        {
            throw new \RuntimeException(sprintf(
                'Unable to find the filesystem locator "%s" - did you forget to register it ?', $name
            ));
        }

        //Create the locator
        $identifier = $this->getLocator($name);
        $locator    = $this->getObject($identifier, $config);

        if(!$locator instanceof FilesystemLocatorInterface)
        {
            throw new \UnexpectedValueException(
                'Locator: '.get_class($locator).' does not implement FilesystemLocatorInterface'
            );
        }

        return $locator;
    }
public function createLocator ( $ path , array $ config = array ( ) ) { $ scheme = parse_url ( $ path , PHP_URL_SCHEME ) ; //If no scheme is specified fall back to file:// locator $ name = ! empty ( $ scheme ) ? $ scheme : 'file' ; //If a windows drive letter is passed use file:// locator if ( strtoupper ( substr ( PHP_OS , 0 , 3 ) ) === 'WIN' ) { if ( preg_match ( '#^[a-z]{1}$#i' , $ name ) ) { $ name = 'file' ; } } //Locator not supported if ( ! in_array ( $ name , $ this -> getLocators ( ) ) ) { throw new \ RuntimeException ( sprintf ( 'Unable to find the filesystem locator "%s" - did you forget to register it ?' , $ name ) ) ; } //Create the locator $ identifier = $ this -> getLocator ( $ name ) ; $ locator = $ this -> getObject ( $ identifier , $ config ) ; if ( ! $ locator instanceof FilesystemLocatorInterface ) { throw new \ UnexpectedValueException ( 'Locator: ' . get_class ( $ locator ) . ' does not implement FilesystemLocatorInterface' ) ; } return $ locator ; }
Create a locator

Note that only URLs delimited by "://"" and ":" are supported, ":/" while technically valid URLs, are not.
If no locator is registered for the specific scheme a exception will be thrown.

@param  string $path    The locator path
@param  array  $config  An optional associative array of configuration options
@throws \InvalidArgumentException If the path is not valid
@throws \RuntimeException         If the locator isn't registered
@throws \UnexpectedValueException If the locator object doesn't implement the FilesystemLocatorInterface
@return FilesystemLocatorInterface
Create a locator