original_string: protected function importFiles($source, $content)
      {
          $regex = '/url\((["\']?)(.+?)\\1\)/i';
          if ($this->importExtensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) {
              $search = array();
              $replace = array();
  
              // loop the matches
              foreach ($matches as $match) {
                  $extension = substr(strrchr($match[2], '.'), 1);
                  if ($extension && !array_key_exists($extension, $this->importExtensions)) {
                      continue;
                  }
  
                  // get the path for the file that will be imported
                  $path = $match[2];
                  $path = dirname($source).'/'.$path;
  
                  // only replace the import with the content if we're able to get
                  // the content of the file, and it's relatively small
                  if ($this->canImportFile($path) && $this->canImportBySize($path)) {
                      // grab content && base64-ize
                      $importContent = $this->load($path);
                      $importContent = base64_encode($importContent);
  
                      // build replacement
                      $search[] = $match[0];
                      $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')';
                  }
              }
  
              // replace the import statements
              $content = str_replace($search, $replace, $content);
          }
  
          return $content;
      }
code: protected function importFiles($source, $content)
      {
          $regex = '/url\((["\']?)(.+?)\\1\)/i';
          if ($this->importExtensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) {
              $search = array();
              $replace = array();
  
              // loop the matches
              foreach ($matches as $match) {
                  $extension = substr(strrchr($match[2], '.'), 1);
                  if ($extension && !array_key_exists($extension, $this->importExtensions)) {
                      continue;
                  }
  
                  // get the path for the file that will be imported
                  $path = $match[2];
                  $path = dirname($source).'/'.$path;
  
                  // only replace the import with the content if we're able to get
                  // the content of the file, and it's relatively small
                  if ($this->canImportFile($path) && $this->canImportBySize($path)) {
                      // grab content && base64-ize
                      $importContent = $this->load($path);
                      $importContent = base64_encode($importContent);
  
                      // build replacement
                      $search[] = $match[0];
                      $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')';
                  }
              }
  
              // replace the import statements
              $content = str_replace($search, $replace, $content);
          }
  
          return $content;
      }
code_tokens: protected function importFiles ( $ source , $ content ) { $ regex = '/url\((["\']?)(.+?)\\1\)/i' ; if ( $ this -> importExtensions && preg_match_all ( $ regex , $ content , $ matches , PREG_SET_ORDER ) ) { $ search = array ( ) ; $ replace = array ( ) ; // loop the matches foreach ( $ matches as $ match ) { $ extension = substr ( strrchr ( $ match [ 2 ] , '.' ) , 1 ) ; if ( $ extension && ! array_key_exists ( $ extension , $ this -> importExtensions ) ) { continue ; } // get the path for the file that will be imported $ path = $ match [ 2 ] ; $ path = dirname ( $ source ) . '/' . $ path ; // only replace the import with the content if we're able to get // the content of the file, and it's relatively small if ( $ this -> canImportFile ( $ path ) && $ this -> canImportBySize ( $ path ) ) { // grab content && base64-ize $ importContent = $ this -> load ( $ path ) ; $ importContent = base64_encode ( $ importContent ) ; // build replacement $ search [ ] = $ match [ 0 ] ; $ replace [ ] = 'url(' . $ this -> importExtensions [ $ extension ] . ';base64,' . $ importContent . ')' ; } } // replace the import statements $ content = str_replace ( $ search , $ replace , $ content ) ; } return $ content ; }
docstring: Import files into the CSS, base64-ized.
  
  @url(image.jpg) images will be loaded and their content merged into the
  original file, to save HTTP requests.
  
  @param string $source  The file to import files for
  @param string $content The CSS content to import files for
  
  @return string
docstring_tokens: Import files into the CSS base64 - ized .