includes/phing/src/Tasks/PhingHelpTask.php
public function getBuildList(
        $buildFile,
        $level = 0,
        $parent = '',
        &$buildList = array()
    ) {

        if (is_file($buildFile)) {
            $buildFileXml = simplexml_load_file($buildFile);
            $buildFileName = $buildFileXml->xpath('//project/@name');
            $buildFileDescription = $buildFileXml->xpath('//project/@description');

            if (isset($buildFileName[0]) && isset($buildFileDescription[0])) {
                $buildList[$buildFile] = array(
                    'level'       => $level,
                    'parent'      => $parent,
                    'name'        => (string) $buildFileName[0],
                    'description' => (string) $buildFileDescription[0],
                );

                foreach ($buildFileXml->xpath('//import[@file]') as $import) {
                    $importFile = (string) $import->attributes()->file;

                    // Replace tokens.
                    if (preg_match_all('/\$\{(.*?)\}/s', $importFile, $matches)) {
                        foreach ($matches[0] as $key => $match) {
                            if (is_object($this->getProject())) {
                                $tokenText  = $this->getProject()->getProperty(
                                    $matches[1][$key]
                                );
                                $importFile = str_replace(
                                    $match,
                                    $tokenText,
                                    $importFile
                                );
                            }
                        }
                    }

                    PhingHelpTask::getBuildList(
                        $importFile,
                        ($level + 1),
                        $buildFile,
                        $buildList
                    );
                }
            }//end if

            return $buildList;
        }//end if

    }
public function getBuildList(
        $buildFile,
        $level = 0,
        $parent = '',
        &$buildList = array()
    ) {

        if (is_file($buildFile)) {
            $buildFileXml = simplexml_load_file($buildFile);
            $buildFileName = $buildFileXml->xpath('//project/@name');
            $buildFileDescription = $buildFileXml->xpath('//project/@description');

            if (isset($buildFileName[0]) && isset($buildFileDescription[0])) {
                $buildList[$buildFile] = array(
                    'level'       => $level,
                    'parent'      => $parent,
                    'name'        => (string) $buildFileName[0],
                    'description' => (string) $buildFileDescription[0],
                );

                foreach ($buildFileXml->xpath('//import[@file]') as $import) {
                    $importFile = (string) $import->attributes()->file;

                    // Replace tokens.
                    if (preg_match_all('/\$\{(.*?)\}/s', $importFile, $matches)) {
                        foreach ($matches[0] as $key => $match) {
                            if (is_object($this->getProject())) {
                                $tokenText  = $this->getProject()->getProperty(
                                    $matches[1][$key]
                                );
                                $importFile = str_replace(
                                    $match,
                                    $tokenText,
                                    $importFile
                                );
                            }
                        }
                    }

                    PhingHelpTask::getBuildList(
                        $importFile,
                        ($level + 1),
                        $buildFile,
                        $buildList
                    );
                }
            }//end if

            return $buildList;
        }//end if

    }
public function getBuildList ( $ buildFile , $ level = 0 , $ parent = '' , & $ buildList = array ( ) ) { if ( is_file ( $ buildFile ) ) { $ buildFileXml = simplexml_load_file ( $ buildFile ) ; $ buildFileName = $ buildFileXml -> xpath ( '//project/@name' ) ; $ buildFileDescription = $ buildFileXml -> xpath ( '//project/@description' ) ; if ( isset ( $ buildFileName [ 0 ] ) && isset ( $ buildFileDescription [ 0 ] ) ) { $ buildList [ $ buildFile ] = array ( 'level' => $ level , 'parent' => $ parent , 'name' => ( string ) $ buildFileName [ 0 ] , 'description' => ( string ) $ buildFileDescription [ 0 ] , ) ; foreach ( $ buildFileXml -> xpath ( '//import[@file]' ) as $ import ) { $ importFile = ( string ) $ import -> attributes ( ) -> file ; // Replace tokens. if ( preg_match_all ( '/\$\{(.*?)\}/s' , $ importFile , $ matches ) ) { foreach ( $ matches [ 0 ] as $ key => $ match ) { if ( is_object ( $ this -> getProject ( ) ) ) { $ tokenText = $ this -> getProject ( ) -> getProperty ( $ matches [ 1 ] [ $ key ] ) ; $ importFile = str_replace ( $ match , $ tokenText , $ importFile ) ; } } } PhingHelpTask :: getBuildList ( $ importFile , ( $ level + 1 ) , $ buildFile , $ buildList ) ; } } //end if return $ buildList ; } //end if }
Helper function to get the full list of buildfiles through imports.

@param string $buildFile Build file
@param int    $level     Level
@param string $parent    Parent
@param array  $buildList Build list

@return array
Helper function to get the full list of buildfiles through imports .