You are here

public static function Stub::fromContent in Drupal 7

Parameters

string $content:

Return value

self

1 call to Stub::fromContent()
Reader::resolveContainer in misc/typo3/phar-stream-wrapper/src/Phar/Reader.php

File

misc/typo3/phar-stream-wrapper/src/Phar/Stub.php, line 23

Class

Stub
@internal Experimental implementation of Phar archive internals

Namespace

TYPO3\PharStreamWrapper\Phar

Code

public static function fromContent($content) {
  $target = new static();
  $target->content = $content;
  if (stripos($content, 'Phar::mapPhar(') !== false && preg_match('#Phar\\:\\:mapPhar\\(([^)]+)\\)#', $content, $matches)) {

    // remove spaces, single & double quotes
    // @todo `'my' . 'alias' . '.phar'` is not evaluated here
    $target->mappedAlias = trim($matches[1], ' \'"');
  }
  return $target;
}