public function resolve($name)
    {
    	if (preg_match('#\.\.[\\\/]#', $name)) {
            throw new Exception\DomainException(
                'Requested asset may not include parent directory traversal ("../", "..\\" notation)'
            );
        }
        
    	// Check if we have paths
        if (!count($this->paths)) {
            //$this->lastLookupFailure = static::FAILURE_NO_PATHS;
            return null;
        }
        
        // TODO: Check cache!!!
        
        $files = array();
        foreach ($this->paths as $path) {
            $file = new SplFileInfo($path . $name);
            if ($file->isReadable()) {
                // Found! Return it.
                if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') {
                    // Do not try to expand phar paths (realpath + phars == fail)
                    $filePath = $path . $name;
                    if (!file_exists($filePath)) {
                        break;
                    }
                }
                
                $files[] = $filePath;
            }
        }

        $count = count($files);
        if ($count > 1) {
        	$canAppend = $this->canAppend($name);
        	if ($canAppend) {
        		$content = '';
        		foreach ($files as $file) {
        			$fileContent = file_get_contents($file);
        			if ($fileContents) {
        				$content .= $fileContent;
        			}
        		}
        		return $content;
        	} else {
        		// TODO: Create an exception
        		throw new \Exception("Too many assets found.");
        	}
        } elseif($count === 1) {
        	$content = file_get_contents($files[0]);
        	if ($content) {
        		return $content;
        	}
        }
        
        return null;
    }
public function resolve($name)
    {
    	if (preg_match('#\.\.[\\\/]#', $name)) {
            throw new Exception\DomainException(
                'Requested asset may not include parent directory traversal ("../", "..\\" notation)'
            );
        }
        
    	// Check if we have paths
        if (!count($this->paths)) {
            //$this->lastLookupFailure = static::FAILURE_NO_PATHS;
            return null;
        }
        
        // TODO: Check cache!!!
        
        $files = array();
        foreach ($this->paths as $path) {
            $file = new SplFileInfo($path . $name);
            if ($file->isReadable()) {
                // Found! Return it.
                if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') {
                    // Do not try to expand phar paths (realpath + phars == fail)
                    $filePath = $path . $name;
                    if (!file_exists($filePath)) {
                        break;
                    }
                }
                
                $files[] = $filePath;
            }
        }

        $count = count($files);
        if ($count > 1) {
        	$canAppend = $this->canAppend($name);
        	if ($canAppend) {
        		$content = '';
        		foreach ($files as $file) {
        			$fileContent = file_get_contents($file);
        			if ($fileContents) {
        				$content .= $fileContent;
        			}
        		}
        		return $content;
        	} else {
        		// TODO: Create an exception
        		throw new \Exception("Too many assets found.");
        	}
        } elseif($count === 1) {
        	$content = file_get_contents($files[0]);
        	if ($content) {
        		return $content;
        	}
        }
        
        return null;
    }
public function resolve ( $ name ) { if ( preg_match ( '#\.\.[\\\/]#' , $ name ) ) { throw new Exception \ DomainException ( 'Requested asset may not include parent directory traversal ("../", "..\\" notation)' ) ; } // Check if we have paths if ( ! count ( $ this -> paths ) ) { //$this->lastLookupFailure = static::FAILURE_NO_PATHS; return null ; } // TODO: Check cache!!! $ files = array ( ) ; foreach ( $ this -> paths as $ path ) { $ file = new SplFileInfo ( $ path . $ name ) ; if ( $ file -> isReadable ( ) ) { // Found! Return it. if ( ( $ filePath = $ file -> getRealPath ( ) ) === false && substr ( $ path , 0 , 7 ) === 'phar://' ) { // Do not try to expand phar paths (realpath + phars == fail) $ filePath = $ path . $ name ; if ( ! file_exists ( $ filePath ) ) { break ; } } $ files [ ] = $ filePath ; } } $ count = count ( $ files ) ; if ( $ count > 1 ) { $ canAppend = $ this -> canAppend ( $ name ) ; if ( $ canAppend ) { $ content = '' ; foreach ( $ files as $ file ) { $ fileContent = file_get_contents ( $ file ) ; if ( $ fileContents ) { $ content .= $ fileContent ; } } return $ content ; } else { // TODO: Create an exception throw new \ Exception ( "Too many assets found." ) ; } } elseif ( $ count === 1 ) { $ content = file_get_contents ( $ files [ 0 ] ) ; if ( $ content ) { return $ content ; } } return null ; }
Retrieve the filesystem path to a view script

@param  string $name
@param  null|Renderer $renderer
@return string
@throws Exception\DomainException
Retrieve the filesystem path to a view script