classes/phing/Phing.php
private function _findBuildFile($start, $suffix)
    {
        $startf = new PhingFile($start);
        $parent = new PhingFile($startf->getAbsolutePath());
        $file = new PhingFile($parent, $suffix);

        // check if the target file exists in the current directory
        while (!$file->exists()) {
            // change to parent directory
            $parent = $this->_getParentFile($parent);

            // if parent is null, then we are at the root of the fs,
            // complain that we can't find the build file.
            if ($parent === null) {
                throw new ConfigurationException("Could not locate a build file!");
            }
            // refresh our file handle
            $file = new PhingFile($parent, $suffix);
        }

        return $file;
    }
private function _findBuildFile($start, $suffix)
    {
        $startf = new PhingFile($start);
        $parent = new PhingFile($startf->getAbsolutePath());
        $file = new PhingFile($parent, $suffix);

        // check if the target file exists in the current directory
        while (!$file->exists()) {
            // change to parent directory
            $parent = $this->_getParentFile($parent);

            // if parent is null, then we are at the root of the fs,
            // complain that we can't find the build file.
            if ($parent === null) {
                throw new ConfigurationException("Could not locate a build file!");
            }
            // refresh our file handle
            $file = new PhingFile($parent, $suffix);
        }

        return $file;
    }
private function _findBuildFile ( $ start , $ suffix ) { $ startf = new PhingFile ( $ start ) ; $ parent = new PhingFile ( $ startf -> getAbsolutePath ( ) ) ; $ file = new PhingFile ( $ parent , $ suffix ) ; // check if the target file exists in the current directory while ( ! $ file -> exists ( ) ) { // change to parent directory $ parent = $ this -> _getParentFile ( $ parent ) ; // if parent is null, then we are at the root of the fs, // complain that we can't find the build file. if ( $ parent === null ) { throw new ConfigurationException ( "Could not locate a build file!" ) ; } // refresh our file handle $ file = new PhingFile ( $ parent , $ suffix ) ; } return $ file ; }
Search parent directories for the build file.

Takes the given target as a suffix to append to each
parent directory in search of a build file.  Once the
root of the file-system has been reached an exception
is thrown.

@param string $start Start file path.
@param string $suffix Suffix filename to look for in parents.

@throws ConfigurationException

@return PhingFile A handle to the build file
Search parent directories for the build file .