You are here

class VendorStreamWrapperPathProcessor in Vendor Stream Wrapper 8

Path Processor for the Vendor Stream Wrapper module.

Hierarchy

Expanded class hierarchy of VendorStreamWrapperPathProcessor

1 string reference to 'VendorStreamWrapperPathProcessor'
vendor_stream_wrapper.services.yml in ./vendor_stream_wrapper.services.yml
vendor_stream_wrapper.services.yml
1 service uses VendorStreamWrapperPathProcessor
vendor_stream_wrapper.path_processor in ./vendor_stream_wrapper.services.yml
Drupal\vendor_stream_wrapper\PathProcessor\VendorStreamWrapperPathProcessor

File

src/PathProcessor/VendorStreamWrapperPathProcessor.php, line 11

Namespace

Drupal\vendor_stream_wrapper\PathProcessor
View source
class VendorStreamWrapperPathProcessor implements InboundPathProcessorInterface {

  /**
   * {@inheritdoc}
   */
  public function processInbound($path, Request $request) {

    // Only act on paths that start with /vendor_files/.
    if (strpos($path, '/vendor_files/') === 0) {
      $names = preg_replace('|^\\/vendor_files\\/|', '', $path);
      $names = str_replace('/', ':', $names);
      return "/vendor_files/{$names}";
    }
    return $path;
  }

}

Members