Automattic\Jetpack\Autoloader
AutoloadGenerator::getPathCode() protected WC 1.0
Returns the path code for the given path.
{} Это метод класса: AutoloadGenerator{}
Хуков нет.
Возвращает
Строку
. The path code.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
- $filesystem(Filesystem) (обязательный)
- The filesystem instance.
- $basePath(строка) (обязательный)
- The base path.
- $vendorPath(строка) (обязательный)
- The vendor path.
- $path(строка) (обязательный)
- The path.
Код AutoloadGenerator::getPathCode() AutoloadGenerator::getPathCode WC 5.2.2
protected function getPathCode( Filesystem $filesystem, $basePath, $vendorPath, $path ) {
if ( ! $filesystem->isAbsolutePath( $path ) ) {
$path = $basePath . '/' . $path;
}
$path = $filesystem->normalizePath( $path );
$baseDir = '';
if ( 0 === strpos( $path . '/', $vendorPath . '/' ) ) {
$path = substr( $path, strlen( $vendorPath ) );
$baseDir = '$vendorDir';
if ( false !== $path ) {
$baseDir .= ' . ';
}
} else {
$path = $filesystem->normalizePath( $filesystem->findShortestPath( $basePath, $path, true ) );
if ( ! $filesystem->isAbsolutePath( $path ) ) {
$baseDir = '$baseDir . ';
$path = '/' . $path;
}
}
if ( strpos( $path, '.phar' ) !== false ) {
$baseDir = "'phar://' . " . $baseDir;
}
return $baseDir . ( ( false !== $path ) ? var_export( $path, true ) : '' );
}