protected function buildResourceWatcher($sourceDir, $destinationDir)
    {
        $fs = new Filesystem();
        $relativeDestination = rtrim($fs->makePathRelative($destinationDir, $sourceDir), '/');

        $finder = new Finder();
        $finder->files()
            ->name('*.*')
            ->in($sourceDir);

        if (false === strpos($relativeDestination, '..')) {
            $finder->exclude($relativeDestination);
        }

        $rc = new ResourceCacheMemory();
        $rw = new ResourceWatcher($rc);
        $rw->setFinder($finder);

        return $rw;
    }
protected function buildResourceWatcher($sourceDir, $destinationDir)
    {
        $fs = new Filesystem();
        $relativeDestination = rtrim($fs->makePathRelative($destinationDir, $sourceDir), '/');

        $finder = new Finder();
        $finder->files()
            ->name('*.*')
            ->in($sourceDir);

        if (false === strpos($relativeDestination, '..')) {
            $finder->exclude($relativeDestination);
        }

        $rc = new ResourceCacheMemory();
        $rw = new ResourceWatcher($rc);
        $rw->setFinder($finder);

        return $rw;
    }
protected function buildResourceWatcher ( $ sourceDir , $ destinationDir ) { $ fs = new Filesystem ( ) ; $ relativeDestination = rtrim ( $ fs -> makePathRelative ( $ destinationDir , $ sourceDir ) , '/' ) ; $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( '*.*' ) -> in ( $ sourceDir ) ; if ( false === strpos ( $ relativeDestination , '..' ) ) { $ finder -> exclude ( $ relativeDestination ) ; } $ rc = new ResourceCacheMemory ( ) ; $ rw = new ResourceWatcher ( $ rc ) ; $ rw -> setFinder ( $ finder ) ; return $ rw ; }
Builds a ResourceWatcher instance.

@param string $sourceDir      Source path
@param string $destinationDir Destination path

@return ResourceWatcher The ResourceWatcher instance
Builds a ResourceWatcher instance .