VersionPress\Initialization\WpdbReplacer::getCodeToInject PHP Méthode

getCodeToInject() private static méthode

private static getCodeToInject ( )
    private static function getCodeToInject()
    {
        $replacerMethodsClassSource = file_get_contents(__DIR__ . '/ReplacerMethods.src.php');
        $methodsStartPosition = strpos($replacerMethodsClassSource, '{') + 1;
        // after first curly bracket
        $methodsEndPosition = strrpos($replacerMethodsClassSource, '}');
        // before last curly bracket
        $methodsSourceLength = $methodsEndPosition - $methodsStartPosition;
        $methodsSource = substr($replacerMethodsClassSource, $methodsStartPosition, $methodsSourceLength);
        return $methodsSource;
    }