protected function clear($path)
    {
        $directory = new \RecursiveDirectoryIterator($path, 4096);

        $iterator = new \RecursiveIteratorIterator($directory, 2);

        foreach ($iterator as $file) {
            $git = strpos($file->getRealPath(), '.git') !== false;

            $path = (string) $file->getRealPath();

            $git || ($file->isDir() ? rmdir($path) : unlink($path));
        }
    }
protected function clear($path)
    {
        $directory = new \RecursiveDirectoryIterator($path, 4096);

        $iterator = new \RecursiveIteratorIterator($directory, 2);

        foreach ($iterator as $file) {
            $git = strpos($file->getRealPath(), '.git') !== false;

            $path = (string) $file->getRealPath();

            $git || ($file->isDir() ? rmdir($path) : unlink($path));
        }
    }
protected function clear ( $ path ) { $ directory = new \ RecursiveDirectoryIterator ( $ path , 4096 ) ; $ iterator = new \ RecursiveIteratorIterator ( $ directory , 2 ) ; foreach ( $ iterator as $ file ) { $ git = strpos ( $ file -> getRealPath ( ) , '.git' ) !== false ; $ path = ( string ) $ file -> getRealPath ( ) ; $ git || ( $ file -> isDir ( ) ? rmdir ( $ path ) : unlink ( $ path ) ) ; } }
Removes the files recursively from the specified directory.

@param  string $path
@return void
Removes the files recursively from the specified directory .