classes/phing/util/PearPackageScanner.php
public function scan()
    {
        $this->init();
        $list = $this->packageInfo->getFilelist();

        if ($this->includes === null) {
            // No includes supplied, so set it to 'matches all'
            $this->includes = ["**"];
        }
        if ($this->excludes === null) {
            $this->excludes = [];
        }

        $this->filesIncluded = [];
        $this->filesNotIncluded = [];
        $this->filesExcluded = [];
        $this->filesDeselected = [];

        $this->dirsIncluded = [];
        $this->dirsNotIncluded = [];
        $this->dirsExcluded = [];
        $this->dirsDeselected = [];
        $origFirstFile = null;

        foreach ($list as $file => $att) {
            if ($att['role'] != $this->role && $this->role != '') {
                continue;
            }
            $origFile = $file;
            if (isset($att['install-as'])) {
                $file = $att['install-as'];
            } else {
                if (isset($att['baseinstalldir'])) {
                    $file = ltrim($att['baseinstalldir'] . '/' . $file, '/');
                }
            }
            $file = str_replace('/', DIRECTORY_SEPARATOR, $file);

            if ($this->isIncluded($file)) {
                if ($this->isExcluded($file)) {
                    $this->everythingIncluded = false;
                    if (@is_dir($file)) {
                        $this->dirsExcluded[] = $file;
                    } else {
                        $this->filesExcluded[] = $file;
                    }
                } else {
                    if (@is_dir($file)) {
                        $this->dirsIncluded[] = $file;
                    } else {
                        $this->filesIncluded[] = $file;
                        if ($origFirstFile === null) {
                            $origFirstFile = $origFile;
                        }
                    }
                }
            } else {
                $this->everythingIncluded = false;
                if (@is_dir($file)) {
                    $this->dirsNotIncluded[] = $file;
                } else {
                    $this->filesNotIncluded[] = $file;
                }
            }
        }

        if (count($this->filesIncluded) > 0) {
            if (empty($this->packageFile)) {
                $att = $list[$origFirstFile];
                $base_dir = substr(
                    $att['installed_as'],
                    0,
                    -strlen($this->filesIncluded[0])
                );
            } else {
                $base_dir = dirname($this->packageFile);
            }
            $this->setBasedir($base_dir);
        }

        return true;
    }
public function scan()
    {
        $this->init();
        $list = $this->packageInfo->getFilelist();

        if ($this->includes === null) {
            // No includes supplied, so set it to 'matches all'
            $this->includes = ["**"];
        }
        if ($this->excludes === null) {
            $this->excludes = [];
        }

        $this->filesIncluded = [];
        $this->filesNotIncluded = [];
        $this->filesExcluded = [];
        $this->filesDeselected = [];

        $this->dirsIncluded = [];
        $this->dirsNotIncluded = [];
        $this->dirsExcluded = [];
        $this->dirsDeselected = [];
        $origFirstFile = null;

        foreach ($list as $file => $att) {
            if ($att['role'] != $this->role && $this->role != '') {
                continue;
            }
            $origFile = $file;
            if (isset($att['install-as'])) {
                $file = $att['install-as'];
            } else {
                if (isset($att['baseinstalldir'])) {
                    $file = ltrim($att['baseinstalldir'] . '/' . $file, '/');
                }
            }
            $file = str_replace('/', DIRECTORY_SEPARATOR, $file);

            if ($this->isIncluded($file)) {
                if ($this->isExcluded($file)) {
                    $this->everythingIncluded = false;
                    if (@is_dir($file)) {
                        $this->dirsExcluded[] = $file;
                    } else {
                        $this->filesExcluded[] = $file;
                    }
                } else {
                    if (@is_dir($file)) {
                        $this->dirsIncluded[] = $file;
                    } else {
                        $this->filesIncluded[] = $file;
                        if ($origFirstFile === null) {
                            $origFirstFile = $origFile;
                        }
                    }
                }
            } else {
                $this->everythingIncluded = false;
                if (@is_dir($file)) {
                    $this->dirsNotIncluded[] = $file;
                } else {
                    $this->filesNotIncluded[] = $file;
                }
            }
        }

        if (count($this->filesIncluded) > 0) {
            if (empty($this->packageFile)) {
                $att = $list[$origFirstFile];
                $base_dir = substr(
                    $att['installed_as'],
                    0,
                    -strlen($this->filesIncluded[0])
                );
            } else {
                $base_dir = dirname($this->packageFile);
            }
            $this->setBasedir($base_dir);
        }

        return true;
    }
public function scan ( ) { $ this -> init ( ) ; $ list = $ this -> packageInfo -> getFilelist ( ) ; if ( $ this -> includes === null ) { // No includes supplied, so set it to 'matches all' $ this -> includes = [ "**" ] ; } if ( $ this -> excludes === null ) { $ this -> excludes = [ ] ; } $ this -> filesIncluded = [ ] ; $ this -> filesNotIncluded = [ ] ; $ this -> filesExcluded = [ ] ; $ this -> filesDeselected = [ ] ; $ this -> dirsIncluded = [ ] ; $ this -> dirsNotIncluded = [ ] ; $ this -> dirsExcluded = [ ] ; $ this -> dirsDeselected = [ ] ; $ origFirstFile = null ; foreach ( $ list as $ file => $ att ) { if ( $ att [ 'role' ] != $ this -> role && $ this -> role != '' ) { continue ; } $ origFile = $ file ; if ( isset ( $ att [ 'install-as' ] ) ) { $ file = $ att [ 'install-as' ] ; } else { if ( isset ( $ att [ 'baseinstalldir' ] ) ) { $ file = ltrim ( $ att [ 'baseinstalldir' ] . '/' . $ file , '/' ) ; } } $ file = str_replace ( '/' , DIRECTORY_SEPARATOR , $ file ) ; if ( $ this -> isIncluded ( $ file ) ) { if ( $ this -> isExcluded ( $ file ) ) { $ this -> everythingIncluded = false ; if ( @ is_dir ( $ file ) ) { $ this -> dirsExcluded [ ] = $ file ; } else { $ this -> filesExcluded [ ] = $ file ; } } else { if ( @ is_dir ( $ file ) ) { $ this -> dirsIncluded [ ] = $ file ; } else { $ this -> filesIncluded [ ] = $ file ; if ( $ origFirstFile === null ) { $ origFirstFile = $ origFile ; } } } } else { $ this -> everythingIncluded = false ; if ( @ is_dir ( $ file ) ) { $ this -> dirsNotIncluded [ ] = $ file ; } else { $ this -> filesNotIncluded [ ] = $ file ; } } } if ( count ( $ this -> filesIncluded ) > 0 ) { if ( empty ( $ this -> packageFile ) ) { $ att = $ list [ $ origFirstFile ] ; $ base_dir = substr ( $ att [ 'installed_as' ] , 0 , - strlen ( $ this -> filesIncluded [ 0 ] ) ) ; } else { $ base_dir = dirname ( $ this -> packageFile ) ; } $ this -> setBasedir ( $ base_dir ) ; } return true ; }
Generates the list of included files and directories

@return boolean True if all went well, false if something was wrong

@uses $filesIncluded
@uses $filesDeselected
@uses $filesNotIncluded
@uses $filesExcluded
@uses $everythingIncluded
@uses $dirsIncluded
@uses $dirsDeselected
@uses $dirsNotIncluded
@uses $dirsExcluded
Generates the list of included files and directories