mirror of
https://ghproxy.net/https://github.com/wp-cli/wp-cli-bundle.git
synced 2025-10-04 23:02:51 +08:00
23 lines
493 B
PHP
23 lines
493 B
PHP
<?php
|
|
|
|
$file = $argv[1];
|
|
if ( ! file_exists( $file ) ) {
|
|
echo 'File does not exist.';
|
|
exit( 1 );
|
|
}
|
|
|
|
$contents = (string) file_get_contents( $file );
|
|
$composer = json_decode( $contents );
|
|
|
|
if ( empty( $composer ) || ! is_object( $composer ) ) {
|
|
echo 'Invalid composer.json for package.';
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( empty( $composer->autoload->files ) ) {
|
|
echo 'composer.json must specify valid "autoload" => "files"';
|
|
exit( 1 );
|
|
}
|
|
|
|
echo implode( PHP_EOL, $composer->autoload->files );
|
|
exit( 0 );
|