FeaturePhp/Specification/DirectorySpecification.php
public function getFileSpecifications() {
        $fileSpecifications = array();
        
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getSource())) as $entry)
            if (!fphp\Helper\Path::isDot($entry)) {
                $fileSource = $entry->getPathName();
                if (is_link($fileSource))
                    continue;
                $relativeFileTarget = fphp\Helper\Path::stripBase(
                    realpath($fileSource), realpath($this->getSource()));

                foreach ($this->getExclude() as $exclude) {
                    if ($relativeFileTarget === $exclude)
                        continue 2;
                    $parts = explode("/", $exclude);
                    if ($parts[count($parts) - 1] === "*")
                        try {
                            fphp\Helper\Path::stripBase($relativeFileTarget, implode("/", array_slice($parts, 0, count($parts) - 1)));
                            continue 2;
                        } catch (fphp\Helper\PathException $e) {}
                }
                        
                $fileTarget = fphp\Helper\Path::join(
                    $this->get("baseTarget"), fphp\Helper\Path::join($this->getTarget(), $relativeFileTarget));
                $fileSpecifications[] = new FileSpecification(
                    array("source" => $fileSource, "target" => $fileTarget), $this->getDirectory());
            }
        
        return $fileSpecifications;
    }
public function getFileSpecifications() {
        $fileSpecifications = array();
        
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getSource())) as $entry)
            if (!fphp\Helper\Path::isDot($entry)) {
                $fileSource = $entry->getPathName();
                if (is_link($fileSource))
                    continue;
                $relativeFileTarget = fphp\Helper\Path::stripBase(
                    realpath($fileSource), realpath($this->getSource()));

                foreach ($this->getExclude() as $exclude) {
                    if ($relativeFileTarget === $exclude)
                        continue 2;
                    $parts = explode("/", $exclude);
                    if ($parts[count($parts) - 1] === "*")
                        try {
                            fphp\Helper\Path::stripBase($relativeFileTarget, implode("/", array_slice($parts, 0, count($parts) - 1)));
                            continue 2;
                        } catch (fphp\Helper\PathException $e) {}
                }
                        
                $fileTarget = fphp\Helper\Path::join(
                    $this->get("baseTarget"), fphp\Helper\Path::join($this->getTarget(), $relativeFileTarget));
                $fileSpecifications[] = new FileSpecification(
                    array("source" => $fileSource, "target" => $fileTarget), $this->getDirectory());
            }
        
        return $fileSpecifications;
    }
public function getFileSpecifications ( ) { $ fileSpecifications = array ( ) ; foreach ( new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ this -> getSource ( ) ) ) as $ entry ) if ( ! fphp \ Helper \ Path :: isDot ( $ entry ) ) { $ fileSource = $ entry -> getPathName ( ) ; if ( is_link ( $ fileSource ) ) continue ; $ relativeFileTarget = fphp \ Helper \ Path :: stripBase ( realpath ( $ fileSource ) , realpath ( $ this -> getSource ( ) ) ) ; foreach ( $ this -> getExclude ( ) as $ exclude ) { if ( $ relativeFileTarget === $ exclude ) continue 2 ; $ parts = explode ( "/" , $ exclude ) ; if ( $ parts [ count ( $ parts ) - 1 ] === "*" ) try { fphp \ Helper \ Path :: stripBase ( $ relativeFileTarget , implode ( "/" , array_slice ( $ parts , 0 , count ( $ parts ) - 1 ) ) ) ; continue 2 ; } catch ( fphp \ Helper \ PathException $ e ) { } } $ fileTarget = fphp \ Helper \ Path :: join ( $ this -> get ( "baseTarget" ) , fphp \ Helper \ Path :: join ( $ this -> getTarget ( ) , $ relativeFileTarget ) ) ; $ fileSpecifications [ ] = new FileSpecification ( array ( "source" => $ fileSource , "target" => $ fileTarget ) , $ this -> getDirectory ( ) ) ; } return $ fileSpecifications ; }
Returns the file specifications this directory specification applies to.
The entire source directory tree is considered, except for excluded files.
@return FileSpecification[]
Returns the file specifications this directory specification applies to . The entire source directory tree is considered except for excluded files .