|
17 | 17 | use WP_CLI\Package\ComposerIO; |
18 | 18 | use WP_CLI\Extractor; |
19 | 19 | use WP_CLI\Utils; |
| 20 | +use WP_CLI\Path; |
20 | 21 | use WP_CLI\JsonManipulator; |
21 | 22 | use WP_CLI\PackageManagerEventSubscriber; |
22 | 23 | use WP_CLI\RequestsLibrary; |
@@ -308,7 +309,7 @@ public function install( $args, $assoc_args ) { |
308 | 309 | } |
309 | 310 | } elseif ( is_dir( $package_name ) && file_exists( $package_name . '/composer.json' ) ) { |
310 | 311 | $dir_package = $package_name; |
311 | | - if ( ! Utils\is_path_absolute( $dir_package ) ) { |
| 312 | + if ( ! Path::is_absolute( $dir_package ) ) { |
312 | 313 | $dir_package = getcwd() . DIRECTORY_SEPARATOR . $dir_package; |
313 | 314 | } |
314 | 315 | list( $package_name, $version ) = self::get_package_name_and_version_from_dir_package( $dir_package ); |
@@ -1192,9 +1193,9 @@ private function get_composer_json_path() { |
1192 | 1193 | if ( null === $composer_path || getenv( 'WP_CLI_TEST_PACKAGE_GET_COMPOSER_JSON_PATH' ) ) { |
1193 | 1194 |
|
1194 | 1195 | if ( getenv( 'WP_CLI_PACKAGES_DIR' ) ) { |
1195 | | - $composer_path = Utils\trailingslashit( getenv( 'WP_CLI_PACKAGES_DIR' ) ) . 'composer.json'; |
| 1196 | + $composer_path = Path::trailingslashit( getenv( 'WP_CLI_PACKAGES_DIR' ) ) . 'composer.json'; |
1196 | 1197 | } else { |
1197 | | - $composer_path = Utils\trailingslashit( Utils\get_home_dir() ) . '.wp-cli/packages/composer.json'; |
| 1198 | + $composer_path = Path::trailingslashit( Path::get_home_dir() ) . '.wp-cli/packages/composer.json'; |
1198 | 1199 | } |
1199 | 1200 |
|
1200 | 1201 | // `composer.json` and its directory might need to be created |
@@ -1243,7 +1244,7 @@ private function create_default_composer_json( $composer_path ) { |
1243 | 1244 | WP_CLI::error( sprintf( "Composer directory '%s' for packages not found: %s", $composer_dir, $error['message'] ) ); |
1244 | 1245 | } |
1245 | 1246 |
|
1246 | | - $composer_path = Utils\trailingslashit( $composer_dir ) . Utils\basename( $composer_path ); |
| 1247 | + $composer_path = Path::trailingslashit( $composer_dir ) . Path::basename( $composer_path ); |
1247 | 1248 |
|
1248 | 1249 | $json_file = new JsonFile( $composer_path ); |
1249 | 1250 |
|
@@ -1643,7 +1644,7 @@ private function set_composer_auth_env_var() { |
1643 | 1644 | * See https://github.com/composer/ca-bundle/blob/1.1.0/src/CaBundle.php#L64 |
1644 | 1645 | */ |
1645 | 1646 | private function avoid_composer_ca_bundle() { |
1646 | | - if ( Utils\inside_phar() && ! getenv( 'SSL_CERT_FILE' ) && ! getenv( 'SSL_CERT_DIR' ) && ! ini_get( 'openssl.cafile' ) && ! ini_get( 'openssl.capath' ) ) { |
| 1647 | + if ( Path::inside_phar() && ! getenv( 'SSL_CERT_FILE' ) && ! getenv( 'SSL_CERT_DIR' ) && ! ini_get( 'openssl.cafile' ) && ! ini_get( 'openssl.capath' ) ) { |
1647 | 1648 | $certificate_path = Utils\extract_from_phar( RequestsLibrary::get_bundled_certificate_path() ); |
1648 | 1649 | putenv( "SSL_CERT_FILE={$certificate_path}" ); |
1649 | 1650 | } |
|
0 commit comments