public static function readFile($package)
    {
        $root = dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))));
        $path = implode(DIRECTORY_SEPARATOR, array($root, $package, 'composer.json'));
        Logger::trace("Reading composer file %s", $path);
        if (file_exists($path)) {
            $composer = json_decode(file_get_contents($path), true);
            if (array_key_exists('require', $composer) && !empty($composer['require'])) {
                $directories = array($package);
                Logger::trace("Checking dependencies for package %s", $package);
                foreach ($composer['require'] as $requirement => $version) {
                    $directories = array_merge(self::readFile($requirement), $directories);
                }
                return $directories;
            } else {
                Logger::trace("Package %s has no dependencies", $package);
                return array($package);
            }
        } else {
            return array();
        }
    }
public static function readFile($package)
    {
        $root = dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))));
        $path = implode(DIRECTORY_SEPARATOR, array($root, $package, 'composer.json'));
        Logger::trace("Reading composer file %s", $path);
        if (file_exists($path)) {
            $composer = json_decode(file_get_contents($path), true);
            if (array_key_exists('require', $composer) && !empty($composer['require'])) {
                $directories = array($package);
                Logger::trace("Checking dependencies for package %s", $package);
                foreach ($composer['require'] as $requirement => $version) {
                    $directories = array_merge(self::readFile($requirement), $directories);
                }
                return $directories;
            } else {
                Logger::trace("Package %s has no dependencies", $package);
                return array($package);
            }
        } else {
            return array();
        }
    }
public static function readFile ( $ package ) { $ root = dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) ; $ path = implode ( DIRECTORY_SEPARATOR , array ( $ root , $ package , 'composer.json' ) ) ; Logger :: trace ( "Reading composer file %s" , $ path ) ; if ( file_exists ( $ path ) ) { $ composer = json_decode ( file_get_contents ( $ path ) , true ) ; if ( array_key_exists ( 'require' , $ composer ) && ! empty ( $ composer [ 'require' ] ) ) { $ directories = array ( $ package ) ; Logger :: trace ( "Checking dependencies for package %s" , $ package ) ; foreach ( $ composer [ 'require' ] as $ requirement => $ version ) { $ directories = array_merge ( self :: readFile ( $ requirement ) , $ directories ) ; } return $ directories ; } else { Logger :: trace ( "Package %s has no dependencies" , $ package ) ; return array ( $ package ) ; } } else { return array ( ) ; } }
Recursively reads a package and all the child dependency packages and returns a list of
packages

@param $package string the name of the package to check
@return array the array of child package names
Recursively reads a package and all the child dependency packages and returns a list of packages