function Stub::fromContent

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.