src/Filter/Sprockets.php
protected function _replace($matches)
    {
        $file = $this->_currentFile;
        if ($matches[1] === '"') {
            // Same directory include
            $file = $this->_findFile($matches[2], dirname($file) . DIRECTORY_SEPARATOR);
        } else {
            // scan all paths
            $file = $this->_findFile($matches[2]);
        }

        // prevent double inclusion
        if (isset($this->_loaded[$file])) {
            return "";
        }
        $this->_loaded[$file] = true;

        $content = file_get_contents($file);
        if ($return = $this->input($file, $content)) {
            return $return . "\n";
        }
        return '';
    }
protected function _replace($matches)
    {
        $file = $this->_currentFile;
        if ($matches[1] === '"') {
            // Same directory include
            $file = $this->_findFile($matches[2], dirname($file) . DIRECTORY_SEPARATOR);
        } else {
            // scan all paths
            $file = $this->_findFile($matches[2]);
        }

        // prevent double inclusion
        if (isset($this->_loaded[$file])) {
            return "";
        }
        $this->_loaded[$file] = true;

        $content = file_get_contents($file);
        if ($return = $this->input($file, $content)) {
            return $return . "\n";
        }
        return '';
    }
protected function _replace ( $ matches ) { $ file = $ this -> _currentFile ; if ( $ matches [ 1 ] === '"' ) { // Same directory include $ file = $ this -> _findFile ( $ matches [ 2 ] , dirname ( $ file ) . DIRECTORY_SEPARATOR ) ; } else { // scan all paths $ file = $ this -> _findFile ( $ matches [ 2 ] ) ; } // prevent double inclusion if ( isset ( $ this -> _loaded [ $ file ] ) ) { return "" ; } $ this -> _loaded [ $ file ] = true ; $ content = file_get_contents ( $ file ) ; if ( $ return = $ this -> input ( $ file , $ content ) ) { return $ return . "\n" ; } return '' ; }
Performs the replacements and inlines dependencies.

@param array $matches
@return string content
Performs the replacements and inlines dependencies .