WP_CLI\Utils
phar_safe_path()
Get a Phar-safe version of a path.
For paths inside a Phar, this strips the outer filesystem's location to reduce the path to what it needs to be within the Phar archive.
Use the __FILE__ or __DIR__ constants as a starting point.
Хуков нет.
Возвращает
Строку
. A Phar-safe version of the path.
Использование
phar_safe_path( $path );
- $path(строка) (обязательный)
- An absolute path that might be within a Phar.
Код phar_safe_path() phar safe path WP-CLI 2.8.0-alpha
function phar_safe_path( $path ) { if ( ! inside_phar() ) { return $path; } return str_replace( PHAR_STREAM_PREFIX . WP_CLI_PHAR_PATH . '/', PHAR_STREAM_PREFIX, $path ); }